For a quick, hands-on demonstration of how Adobe® AIR™ works, follow the instructions in this topic to create and package a simple "Hello World" AIR application using Adobe® Flash® CS3 Professional.
If you haven't already done so, download and install the Adobe AIR update for Flash CS3. For more information on installing Adobe AIR for Flash CS3, see Setting up Flash CS3 for Adobe AIR.
Contents
Create the Hello World application in Flash
Test the application
Convert a Flash application to an Adobe AIR application
Create the Hello World application in Flash
Creating an Adobe AIR application in Flash is much like creating any other Flash application. The differences are that you begin by creating a Flash File (Adobe AIR) from the Welcome screen and conclude by creating application and installer settings and installing your AIR application. The following procedure guides you through the process of creating a simple Hello World application using Flash CS3.
To create the Hello World application
Start Flash.
In the Welcome Screen, click Flash File (Adobe AIR) to create an empty FLA file with Adobe AIR publish settings.
Click OK to respond to the summary dialog, Authoring for Adobe AIR with Flash CS3. This dialog takes a few seconds to come up the first time.
Select the Text tool in the Tools panel and create a static text field (the default) in the center of the Stage. Make it wide enough to contain 15 -20 characters.
If you haven't already done so, download and install the Adobe AIR update for Flash CS3. For more information on installing Adobe AIR for Flash CS3, see Setting up Flash CS3 for Adobe AIR.
Contents
Create the Hello World application in Flash
Test the application
Convert a Flash application to an Adobe AIR application
Create the Hello World application in Flash
Creating an Adobe AIR application in Flash is much like creating any other Flash application. The differences are that you begin by creating a Flash File (Adobe AIR) from the Welcome screen and conclude by creating application and installer settings and installing your AIR application. The following procedure guides you through the process of creating a simple Hello World application using Flash CS3.
To create the Hello World application
Start Flash.
In the Welcome Screen, click Flash File (Adobe AIR) to create an empty FLA file with Adobe AIR publish settings.
Click OK to respond to the summary dialog, Authoring for Adobe AIR with Flash CS3. This dialog takes a few seconds to come up the first time.
Select the Text tool in the Tools panel and create a static text field (the default) in the center of the Stage. Make it wide enough to contain 15 -20 characters.

Enter the text "Hello World" in the text field.
Save the file, giving it a name (for example, helloAIR).
Test the application
To test the Hello World application
Press Ctrl + Enter or select Control ->Test Movie to test the application in Adobe AIR.
To use the Debug Movie feature, first add ActionScript code to the application. You can try it quickly by adding a trace statement like the following:trace("Running AIR application using Debug Movie");
Press Ctrl + Shift + Enter, or select Control->Debug Movie to run the application with Debug Movie.
Select the Commands > AIR - Applications and Installer Settings menu item to open the AIR - Application & Installer Settings dialog.
Sign the Adobe AIR package with a self-signed digital certificate:
Click the Set… button for the Digital Signature prompt to open the Digital Signature dialog box.
Click the Create... button to open the Create Self-Signed Digital Certificate dialog box
Complete the entries for Publisher name, Organizational unit, Organizational name, E-mail, Country, Password, and Confirm Password.
Specify the type of certificate. The certificate Type option refers to the level of security: 1024-RSA uses a 1024-bit key (less secure), and 2048-RSA uses a 2048-bit key (more secure).
Save the information in a certificate file by completing the Save as entry or clicking the Browse... button to browse to a folder location. (For example, C:/Temp/mycert.pfx). When you're finished click OK.
Flash returns you to the Digital Signature Dialog. The path and filename of the self-signed certificate that you created appears in the Certificate text box. If not, enter the path and file name or click the Browse button to locate and select it.
Enter the same password in the Password text field of the Digital Signature dialog box as the password that you assigned in step c and click OK. For more information about signing your Adobe AIR applications, see Signing your application.
To create the application and installer file, click the Publish AIR file button. You must execute Test Movie or Debug Movie to create the SWF and application.xml files before creating the AIR file.
To install the application, double click the AIR file (application.air) in the same folder where you saved your application.
Click the Install button in the Application Install dialog.
Review the Installation Preferences and Location settings and make sure that the 'Start application after installation' checkbox is checked. Then click Continue.
Click Finish when the Installation Completed message appears.
The Hello World application looks like this illustration:
Convert a Flash application to an Adobe AIR application
You can also convert an existing Flash application to an AIR application. For more information, see Setting Adobe AIR publish settings
No comments:
Post a Comment