28.04.2016 Views

Adobe AIR Building Apps

Adobe AIR Building Apps AS3 Actionscript

Adobe AIR Building Apps AS3 Actionscript

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

BUILDING ADOBE <strong>AIR</strong> APPLICATIONS<br />

Creating your first <strong>AIR</strong> application<br />

38<br />

Test the application<br />

To run and test the application from the command line, use the <strong>AIR</strong> Debug Launcher (ADL) to launch the application<br />

using its application descriptor file. (ADL can be found in the bin directory of the Flex SDK.)<br />

❖ From the command prompt, enter the following command:<br />

adl HelloWorld-app.xml<br />

The resulting <strong>AIR</strong> application looks something like this illustration:<br />

Using the horizontalCenter and verticalCenter properties of the Label control, the text is placed in the center of the<br />

window. Move or resize the window as you would any other desktop application.<br />

For more information, see “<strong>AIR</strong> Debug Launcher (ADL)” on page 152.<br />

Create the <strong>AIR</strong> installation file<br />

When your application runs successfully, you can use the ADT utility to package the application into an <strong>AIR</strong><br />

installation file. An <strong>AIR</strong> installation file is an archive file that contains all the application files, which you can distribute<br />

to your users. You must install <strong>Adobe</strong> <strong>AIR</strong> before installing a packaged <strong>AIR</strong> file.<br />

To ensure application security, all <strong>AIR</strong> installation files must be digitally signed. For development purposes, you can<br />

generate a basic, self-signed certificate with ADT or another certificate generation tool. You can also buy a commercial<br />

code-signing certificate from a commercial certification authority. When users install a self-signed <strong>AIR</strong> file, the<br />

publisher is displayed as “unknown” during the installation process. This is because a self-signed certificate only<br />

guarantees that the <strong>AIR</strong> file has not been changed since it was created. There is nothing to prevent someone from selfsigning<br />

a masquerade <strong>AIR</strong> file and presenting it as your application. For publicly released <strong>AIR</strong> files, a verifiable,<br />

commercial certificate is strongly recommended. For an overview of <strong>AIR</strong> security issues, see <strong>AIR</strong> security (for<br />

ActionScript developers) or <strong>AIR</strong> security (for HTML developers).<br />

Generate a self-signed certificate and key pair<br />

❖ From the command prompt, enter the following command (the ADT executable can be found in the bin directory<br />

of the Flex SDK):<br />

adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword<br />

This example uses the minimum number of attributes that can be set for a certificate. The key type must be either<br />

1024-RSA or 2048-RSA (see “Signing <strong>AIR</strong> applications” on page 181).<br />

Create the <strong>AIR</strong> package<br />

❖ From the command prompt, enter the following command (on a single line):<br />

Last updated 2/22/2016

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!