Update:

Please note that developing AIR applications with FDT 3 is very easy now. Simply create a launcher for viewing and debugging your application and one launcher to release it as .air file. To create an AIR debug launch configuration select your Document Class in the Flash Explorer and then open the Run Dialog (Run > Open Run Dialog…). Double click “FDT AS3 Application “ to create a new launch configuration. After that select the “Start” tab and choose “AIR Debug Launcher” as viewer.
Press the “Run“ button to compile and launch your AIR application. FDT automatically generates a default application XML file into your output folder.
To release and package your AIR application open the Run Dialog and double click “FDT AIR Application Release” and configure the settings on the right-hand side.
see: http://fdt.powerflasher.com/blog/?p=94

Please note that developing AIR applications with FDT 3 is very easy now. Simply create a launcher for viewing and debugging your application and one launcher to release it as .air file. To create an AIR debug launch configuration select your Document Class in the Flash Explorer and then open the Run Dialog (Run > Open Run Dialog…). Double click “FDT AS3 Application “ to create a new launch configuration. After that select the “Start” tab and choose “AIR Debug Launcher” as viewer.

Press the “Run“ button to compile and launch your AIR application. FDT automatically generates a default application XML file into your output folder.
To release and package your AIR application open the Run Dialog and double click “FDT AIR Application Release” and configure the settings on the right-hand side. See new post: http://fdt.powerflasher.com/blog/?p=94

Previous Post:

On October 1, 2007 Adobe released the beta 2 version of AIR (Adobe Integrated Runtime), formerly known as Apollo.
As a cross-operating system runtime AIR provides developers with the possibility to deploy RIAs to the desktop. This is very promising regarding the users interaction with the web because it provides a faster access to related data by using native desktop applications. On top of this, AIR applications can have a great look and feel by using customized windows.
All you need to do if you want to build those cool things is to download the Runtime, which is required to run any Adobe AIR application and to also download the Flex 3 SDK. The latter includes as well the AIR SDK as the AIR compiler, the AIR debug launcher and the AIR packager. These tools can be used together with ANT to map the whole AIR workflow.
To distribute AIR applications means to pack the required files like swfs, assets and the application descriptor file. These packages are used by the runtime environment, which should be installed at first, to make sure that all AIR applications will work.
Nico Zimmerman promised that there will be an add-on for FDT to support the AIR workflow with which it will be much easier to develop AIR applications.
Now, let’s take a closer look at the current workflow and let’s build a “hello world” Air application step by step.
<!–[endif]–>

  1. Download and install the Runtime (http://labs.adobe.com/downloads/air.html).
  2. Download the Flex 3 SDK (http://labs.adobe.com/technologies/flex/sdk/flex3sdk.html).<!–[endif]–>
  3. Now you can start your eclipse in the FDT perspective and add a new AS3 core library.
    • Window -> Preferences -> FDT -> Core Libraries -> AS3 Core Libraries -> Add…
    • 2. Choose Flex 3 SDK with AIR as Type, type in “Flex3_AIR” as Name and choose a path variable by clicking the “Browse…” button. If there is no variable linking to the Flex 3 SDK, click “New…”, type in “Flex3SDK_AIR” as Name and add the Path to your Flex 3 SDK folder. Press a few times OK, to get back to eclipse.
      Setting the classpath to Flex3 SDK
  4. Now you’re prepared to start with your first AIR application in FDT: create a New Flash Project with the Name “Hello World”. Choose Action Script 3 with your new core library (“Flex3_AIR”) as the project language and press “Finish”.
    Creating a new flash project
  5. Downloading this zip-file and copying the content to your project folder is the easiest way to go on. The zip-file contains a settings folder within an assets folder. The settings folder contains the application descriptor file which is essential for running AIR applications. This file contains parameters as well for the AIR application as for the first window. You have to customize these parameters as explained in the comments in the file.
    Note that the content tag and all tags marked “required” are very important to run the AIR application! Rename the application descriptor file like shown in this example: “-app.xml” (e.g. “powerflasher-app.xml”).
    The application-descriptor-file
  6. Add the “src” folder to the classpath and double-click the “Build-Air”file. The most important properties which you have to customize are marked with comments and are located at the top of the file.
    • Clean -> Deletes the built directories.
    • Build directories -> Creates directories. “Debug” contains the compiled swf for debugging, “build” contains the compiled swf for publishing and “publish” contains the final AIR file.
    • Compile for debuging -> Uses the mxml compiler with a special air parameter to compile the AIR swf. Instead of that you can use the amxml compiler as normal as you use the mxml compiler.
    • Compile for publishing -> Does the same as “Compile for debuging”.
    • Test application -> Uses the AIR debug launcher (ADL) to start the AIR application without packaging and installation. The ADL uses the application descriptor file to set up the window.
    • Package application -> Uses the AIR development tool (ADT) to package all required files to an AIR package.
    • Create certificate -> Uses the ADT to create a certificate which is required to sign and build the AIR package.
  7. Now you are ready to create the ActionScript Classnamed “HelloWorld”. The code should look like this:
    package
    {
        import flash.display.Sprite;
        import flash.text.TextField;
        import flash.text.TextFieldAutoSize;
    
        /**
         * @author Stephan Partzsch
         */
        public class HelloWorld extends Sprite
        {
    
            public function HelloWorld()
            {
                var textField:TextField = new TextField();
                textField.autoSize = TextFieldAutoSize.CENTER;
    
                textField.text = "Hello world!";
    
                textField.x = (stage.stageWidth - textField.width) / 2;
                textField.y = (stage.stageHeight - textField.height) / 2;
    
                this.addChild(textField);
            }
    
        }
    }
  8. Open the ANT view. You can find it here: Window -> Show View -> Other -> ANT. Drag the “Build_Air” file to the ANT view and double-click number 4 to test your application. Create a certificate with number 7 and than double-click number 6 to package your first AIR application.
    The ANT view in eclipse
  9. Finally you find HelloWorld.air in your project directory in the publish folder. Double-click it to install it on your desktop.<!–[endif]–>

Of course, you can also download this sample project right here.
That’s it and I hope I could demonstrate the workflow of AIR so that you can go on with developing ultra-cool AIR applications. 🙂

Stephan