O'Reilly logo

Agile Enterprise Application Development with Flex by Tony Hillerson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hello World in AIR

The AIR SDK is free, so if you are willing to write code in Notepad (or your favorite text editor) and compile and build your applications using command-line tools either directly or hooked up to an IDE of your choice, you can certainly create AIR applications without having to purchase any additional software. In particular, AIR comes with the following tools:

ADL

The AIR Debug Launcher that you can use from a command line

ADT

The AIR Developer Tool with which you create deployable .air files

Most likely, you’ll work in the Flash Builder IDE, which includes the AIR project creation wizard. To get familiar with this method, try developing a HelloWorld application.

  1. Create a new Flex project called HelloWorld in Flash Builder.

  2. In the same window where you enter the project name, select the radio button titled “Desktop application (runs in Adobe AIR).” Click the Finish button to see a window similar to Figure 9-1.

  3. Instead of the familiar <mx:Application> tag, the root tag of an AIR application is <mx:WindowedApplication>. Add a line <mx:Label text="Hello World"> to the code and run this application. Figure 9-2 shows the results.

An empty template of the AIR application

Figure 9-1. An empty template of the AIR application

The src folder of your Flash Builder project now contains an application descriptor file called HelloWorld-app.xml. Example 9-1 shows a fragment of this file. (If you don’t use Flash Builder, you’ll ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required