Adobe® AIR® is a multi-operating system, multi-screen runtime that allows you to leverage your web development
skills to build and deploy rich Internet applications (RIAs) to the desktop and mobile devices. Desktop, television, and
mobile AIR applications can be built with ActionScript 3.0 using Adobe® Flex and Adobe® Flash® (SWF based).
Desktop AIR applications can also be built with HTML, JavaScript®, and Ajax (HTML based).
You can find more information about getting started with and using Adobe AIR at the Adobe AIR Developer
Connection (
AIR enables you to work in familiar environments, to leverage the tools and approaches you find most comfortable.
By supporting Flash, Flex, HTML, JavaScript, and Ajax, you can build the best possible experience that meets your
needs.
For example, applications can be developed using one or a combination of the following technologies:
• Flash / Flex / ActionScript
• HTML / JavaScript / CSS / Ajax
Users interact with AIR applications in the same way that they interact with native applications. The runtime is
installed once on the user's computer or device, and then AIR applications are installed and run just like any other
desktop application. (On iOS, a separate AIR runtime is not installed; each iOS AIR app is a stand-alone application.)
http://www.adobe.com/devnet/air/).
1
The runtime provides a consistent cross-operating system platform and framework for deploying applications and
therefore eliminates cross-browser testing by ensuring consistent functionality and interactions across desktops.
Instead of developing for a specific operating system, you target the runtime, which has the following benefits:
• Applications developed for AIR run across multiple operating systems without any additional work by you. The
runtime ensures consistent and predictable presentation and interactions across all the operating systems
supported by AIR.
• Applications can be built faster by enabling you to leverage existing web technologies and design patterns. You can
extend web-based applications to the desktop without learning traditional desktop development technologies or
the complexity of native code.
• Application development is easier than using lower-level languages such as C and C++. You do not need to manage
the complex, low-level APIs specific to each operating system.
When developing applications for AIR, you can leverage a rich set of frameworks and APIs:
• APIs specific to AIR provided by the runtime and the AIR framework
• ActionScript APIs used in SWF files and Flex framework (as well as other ActionScript based libraries and
frameworks)
• HTML, CSS, and JavaScript
• Most Ajax frameworks
• Native extensions for Adobe AIR, which provide ActionScript APIs that provide you access to platform-specific
functionality programmed in native code. Native extensions can also provide access to legacy native code, and
native code that provides higher performance.
Last updated 12/7/2015
BUILDING ADOBE AIR APPLICATIONS
About Adobe AIR
AIR dramatically changes how applications can be created, deployed, and experienced. You gain more creative control
and can extend your Flash, Flex, HTML, and Ajax-based applications to the desktop, mobile devices, and televisions.
For information about what is included in each new AIR update, see the Adobe AIR Release Notes
http://www.adobe.com/go/learn_air_relnotes_en).
(
2
Last updated 12/7/2015
Chapter 2: Adobe AIR installation
The Adobe® AIR® runtime allows you to run AIR applications. You can install the runtime in the following ways:
• By installing the runtime separately (without also installing an AIR application)
• By installing an AIR application for the first time through a web page installation “badge” (you are prompted to
also install the runtime)
• By creating a custom installer that installs both your application and the runtime. You must get approval from
Adobe to distribute the AIR runtime in this fashion. You can request approval on the
page. Note that Adobe does not provide tools for building such an installer. Many third-party installer toolkits are
available, however.
• By installing an AIR application that bundles AIR as a captive runtime. A captive runtime is used only by the
bundling application. It is not used to run other AIR applications. Bundling the runtime is an option on Mac and
Windows. On iOS, all applications include a bundled runtime. As of AIR 3.7, all Android applications include a
bundled runtime by default (although you have the option of using a separate runtime).
• By setting up an AIR development environment such as the AIR SDK, Adobe® Flash® Builder™ , or the Adobe Flex®
SDK (which includes the AIR command line development tools). The runtime included in the SDK is only used
when debugging applications — it is not used to run installed AIR applications.
The system requirements for installing AIR and running AIR applications are detailed here: Adobe AIR: System
Both the runtime installer and the AIR application installer create log files when they install, update, or remove AIR
applications or the AIR runtime itself. You can consult these logs to help determine the cause of any installation
problems. See
Installation logs.
Installing Adobe AIR
To install or update the runtime, a user must have administrative privileges for the computer.
Install the runtime on a Windows computer
1 Download the runtime installation file from http://get.adobe.com/air.
2 Double-click the runtime installation file.
3 In the installation window, follow the prompts to complete the installation.
Install the runtime on a Mac computer
1 Download the runtime installation file from http://get.adobe.com/air.
2 Double-click runtime installation file.
3 In the installation window, follow the prompts to complete the installation.
4 If the Installer displays an Authenticate window, enter your Mac OS user name and password.
Install the runtime on a Linux computer
Note: At this time, AIR 2.7 and later are not supported on Linux. AIR applications deployed to Linux should continue to
use the AIR 2.6 SDK.
Last updated 12/7/2015
BUILDING ADOBE AIR APPLICATIONS
Adobe AIR installation
Using the binary installer:
1 Locate the installation binary file from http://kb2.adobe.com/cps/853/cpsid_85304.html and download.
2 Set the file permissions so that the installer application can be executed. From a command line, you can set the file
permissions with:
chmod +x AdobeAIRInstaller.bin
Some versions of Linux allow you to set the file permissions on the Properties dialog opened through a context menu.
3 Run the installer from the command line or by double-clicking the runtime installation file.
4 In the installation window, follow the prompts to complete the installation.
Adobe AIR is installed as a native package. In other words, as rpm on an rpm based distribution and deb on a Debian
distribution. Currently AIR does not support any other package format.
Using the package installers:
1 Locate the AIR package file from http://kb2.adobe.com/cps/853/cpsid_85304.html. Download the rpm or Debian
package, depending on which package format your system supports.
2 If needed, double-click AIR package file to install the package.
You can also install from the command line:
4
a On a Debian system:
sudo dpkg -i <path to the package>/adobeair-2.0.0.xxxxx.deb
b On an rpm-based system:
sudo rpm -i <path to the package>/adobeair-2.0.0-xxxxx.i386.rpm
Or, if you are updating an existing version (AIR 1.5.3 or later):
sudo rpm -U <path to the package>/adobeair-2.0.0-xxxxx.i386.rpm
Installing AIR 2 and AIR applications requires you to have administrator privileges on your computer.
Adobe AIR is installed to the following location: /opt/Adobe AIR/Versions/1.0
AIR registers the mime-type "application/vnd.adobe.air-application-installer-package+zip", which means that .air files
are of this mime-type and are therefore registered with the AIR runtime.
Install the runtime on an Android device
You can install the latest release of the AIR runtime from the Android Market.
You can install development versions of the AIR runtime from a link on a web page or by using the ADT -
installRuntime command. Only one version of the AIR runtime can be installed at a time; you cannot have both a
release and a development version installed.
See “ADT installRuntime command” on page 169 for more information.
Install the runtime on an iOS device
The necessary AIR runtime code is bundled with each application created for iPhone, iTouch, and iPad devices. You
do not install a separate runtime component.
More Help topics
“AIR for iOS” on page 67
Last updated 12/7/2015
BUILDING ADOBE AIR APPLICATIONS
Adobe AIR installation
Removing Adobe AIR
Once you have installed the runtime, you can remove it using the following procedures.
Remove the runtime on a Windows computer
1 In the Windows Start menu, select Settings > Control Panel.
2 Open the Programs, Programs and Features, or Add or Remove Programs control panel (depending on which
version of Windows you are running).
3 Select “Adobe AIR” to remove the runtime.
4 Click the Change/Remove button.
Remove the runtime on a Mac computer
• Double-click the “Adobe AIR Uninstaller”, which is located in the /Applications/Utilities folder.
Remove the runtime on a Linux computer
Do one of the following:
• Select the “Adobe AIR Uninstaller” command from the Applications menu.
• Run the AIR installer binary with the -uninstall option
• Remove the AIR packages (adobeair and adobecerts) with your package manager.
5
Remove the runtime from an Android device
1 Open the Settings app on the device.
2 Tap the Adobe AIR entry under Applications > Manage Applications.
3 Tap the Uninstall button.
You can also use the ADT -uninstallRuntime command. See “ADT uninstallRuntime command” on page 170 for
more information.
Remove a bundled runtime
To remove a captive bundled runtime, you must remove the application it is installed with. Note that captive runtimes
are only used to run the installing application.
Installing and running the AIR sample applications
To install or update an AIR application, a user must have administrative privileges for the computer.
Some sample applications are available that demonstrate AIR features. You can access and install them using the
following instructions:
1 Download and run the AIR sample applications. The compiled applications as well as the source code are available.
2 To download and run a sample application, click the sample application Install Now button. You are prompted to
install and run the application.
Last updated 12/7/2015
BUILDING ADOBE AIR APPLICATIONS
Adobe AIR installation
3 If you choose to download sample applications and run them later, select the download links. You can run AIR
applications at any time by:
• On Windows, double-clicking the application icon on the desktop or selecting it from the Windows Start menu.
• On Mac OS, double-clicking the application icon, which is installed in the Applications folder of your user
directory (for example, in Macintosh HD/Users/JoeUser/Applications/) by default.
Note: Check the AIR release notes for updates to these instructions, which are located here:
http://www.adobe.com/go/learn_air_relnotes.
Adobe AIR updates
Periodically, Adobe updates Adobe AIR with new features or fixes to minor problems. The Automatic Notification and
Update feature allows Adobe to automatically notify users when an updated version of Adobe AIR is available.
Updates to Adobe AIR ensure that Adobe AIR works properly and often contain important changes to security. Adobe
recommends that users update to the latest version of Adobe AIR whenever a new version is available, especially when
a security update is mentioned.
By default, when an AIR application is launched, the runtime checks if an update is available. It performs this check if
it has been more than two weeks since the last update check. If an update is available, AIR downloads the update in the
background.
6
Users can disable the auto-update capability by using the AIR SettingsManager application. The AIR SettingsManager
application is available for download at
The normal installation process for Adobe AIR includes connecting to http://airinstall.adobe.com to send basic
information about the installation environment such as operating system version and language. This information is
only transmitted once per installation and it allows Adobe to confirm that the installation was successful. No
personally identifiable information is collected or transmitted.
Updating captive runtimes
If you distribute your application with a captive runtime bundle, the captive runtime is not updated automatically. For
the security of your users, you must monitor the updates published by Adobe and update your application with the
new runtime version when a relevant security change is published.
Last updated 12/7/2015
Chapter 3: Working with the AIR APIs
Adobe® AIR® includes functionality that is not available to SWF content running in Adobe® Flash® Player.
ActionScript 3.0 Developers
The Adobe AIR APIs are documented in the following two books:
• ActionScript 3.0 Developer's Guide
• ActionScript 3.0 Reference for the Adobe Flash Platform
HTML Developers
If you’re building HTML-based AIR applications, the APIs that are available to you in JavaScript via the AIRAliases.js
file (see
Accessing AIR API classes from JavaScript) are documented in the following two books:
• HTML Developer's Guide for Adobe AIR
• Adobe AIR API Reference for HTML Developers
7
AIR-specific ActionScript 3.0 classes
The following table contains runtime classes are specific to Adobe AIR. They are not available to SWF content running
in Adobe® Flash® Player in the browser.
HTML Developers
The classes that are available to you in JavaScript via the AIRAliases.js file are listed in Adobe AIR API Reference for
HTML Developers.
ClassActionScript 3.0 PackageAdded in AIR version
ARecordflash.net.dns2.0
AAAARecordflash.net.dns2.0
ApplicationUpdaterair.update1.5
ApplicationUpdaterUIair.update1.5
AudioPlaybackModeflash.media3.0
AutoCapitalizeflash.text3.0
BrowserInvokeEventflash.events1.0
CameraPositionflash.media3.0
CameraRollflash.media2.0
CameraRollBrowseOptionsflash.media3.0
CameraUIflash.media2.5
CertificateStatusflash.security2.0
Last updated 12/7/2015
BUILDING ADOBE AIR APPLICATIONS
Working with the AIR APIs
ClassActionScript 3.0 PackageAdded in AIR version
CompressionAlgorithmflash.utils1.0
DatagramSocketflash.net2.0
DatagramSocketDataEventflash.events2.0
DNSResolverflash.net.dns2.0
DNSResolverEventflash.events2.0
DockIconflash.desktop1.0
DownloadErrorEventair.update.events1.5
DRMAuthenticateEventflash.events1.0
DRMDeviceGroupflash.net.drm3.0
DRMDeviceGroupErrorEventflash.net.drm3.0
DRMDeviceGroupEventflash.net.drm3.0
DRMManagerErrorflash.errors1.5
EncryptedLocalStoreflash.data1.0
8
ExtensionContextflash.external2.5
Fileflash.filesystem1.0
FileListEventflash.events1.0
FileModeflash.filesystem1.0
FileStreamflash.filesystem1.0
FocusDirectionflash.display1.0
GameInputflash.ui3.0
GameInputControlflash.ui3.0
GameInputControlTypeflash.ui3.6 and earlier; dropped, as of 3.7
GameInputDeviceflash.ui3.0
GameInputEventflash.ui3.0
GameInputFingerflash.ui3.6 and earlier; dropped, as of 3.7
GameInputHandflash.ui3.6 and earlier; dropped, as of 3.7
Geolocationflash.sensors2.0
GeolocationEventflash.events2.0
HTMLHistoryItemflash.html1.0
HTMLHostflash.html1.0
HTMLLoaderflash.html1.0
HTMLPDFCapabilityflash.html1.0
HTMLSWFCapabiltiyflash.html2.0
HTMLUncaughtScriptExceptionEventflash.events1.0
Last updated 12/7/2015
BUILDING ADOBE AIR APPLICATIONS
Working with the AIR APIs
ClassActionScript 3.0 PackageAdded in AIR version
HTMLWindowCreateOptionsflash.html1.0
Iconflash.desktop1.0
IFilePromiseflash.desktop2.0
ImageDecodingPolicyflash.system2.6
InteractiveIconflash.desktop1.0
InterfaceAddressflash.net2.0
InvokeEventflash.events1.0
InvokeEventReasonflash.desktop1.5.1
IPVersionflash.net2.0
IURIDereferencerflash.security1.0
LocationChangeEventflash.events2.5
MediaEventflash.events2.5
MediaPromiseflash.media2.5
9
MediaTypeflash.media2.5
MXRecordflash.net.dns2.0
NativeApplicationflash.desktop1.0
NativeDragActionsflash.desktop1.0
NativeDragEventflash.events1.0
NativeDragManagerflash.desktop1.0
NativeDragOptionsflash.desktop1.0
NativeMenuflash.display1.0
NativeMenuItemflash.display1.0
NativeProcessflash.desktop2.0
NativeProcessExitEventflash.events2.0
NativeProcessStartupInfoflash.desktop2.0
NativeWindowflash.display1.0
NativeWindowBoundsEventflash.events1.0
NativeWindowDisplayStateflash.display1.0
NativeWindowDisplayStateEventflash.events1.0
NativeWindowInitOptionsflash.display1.0
NativeWindowRenderModeflash.display3.0
NativeWindowResizeflash.display1.0
NativeWindowSystemChromeflash.display1.0
NativeWindowTypeflash.display1.0
Last updated 12/7/2015
BUILDING ADOBE AIR APPLICATIONS
Working with the AIR APIs
ClassActionScript 3.0 PackageAdded in AIR version
NetworkInfoflash.net2.0
NetworkInterfaceflash.net2.0
NotificationTypeflash.desktop1.0
OutputProgressEventflash.events1.0
PaperSizeflash.printing2.0
PrintMethodflash.printing2.0
PrintUIOptionsflash.printing2.0
PTRRecordflash.net.dns2.0
ReferencesValidationSettingflash.security1.0
ResourceRecordflash.net.dns2.0
RevocationCheckSettingsflash.security1.0
Screenflash.display1.0
ScreenMouseEventflash.events1.0
10
SecureSocketflash.net2.0
SecureSocketMonitorair.net2.0
ServerSocketflash.net2.0
ServerSocketConnectEventflash.events2.0
ServiceMonitorair.net1.0
SignatureStatusflash.security1.0
SignerTrustSettingsflash.security1.0
SocketMonitorair.net1.0
SoftKeyboardTypeflash.text3.0
SQLCollationTypeflash.data1.0
SQLColumnNameStyleflash.data1.0
SQLColumnSchemaflash.data1.0
SQLConnectionflash.data1.0
SQLErrorflash.errors1.0
SQLErrorEventflash.events1.0
SQLErrorOperationflash.errors1.0
SQLEventflash.events1.0
SQLIndexSchemaflash.data1.0
SQLModeflash.data1.0
SQLResultflash.data1.0
SQLSchemaflash.data1.0
Last updated 12/7/2015
BUILDING ADOBE AIR APPLICATIONS
Working with the AIR APIs
ClassActionScript 3.0 PackageAdded in AIR version
SQLSchemaResultflash.data1.0
SQLStatementflash.data1.0
SQLTableSchemaflash.data1.0
SQLTransactionLockTypeflash.data1.0
SQLTriggerSchemaflash.data1.0
SQLUpdateEventflash.events1.0
SQLViewSchemaflash.data1.0
SRVRecordflash.net.dns2.0
StageAspectRatioflash.display2.0
StageOrientationflash.display2.0
StageOrientationEventflash.events2.0
StageTextflash.text3.0
StageTextInitOptionsflash.text3.0
11
StageWebViewflash.media2.5
StatusFileUpdateErrorEventair.update.events1.5
StatusFileUpdateEventair.update.events1.5
StatusUpdateErrorEventair.update.events1.5
StatusUpdateEventair.update.events1.5
StorageVolumeflash.filesystem2.0
StorageVolumeChangeEventflash.events2.0
StorageVolumeInfoflash.filesystem2.0
SystemIdleModeflash.desktop2.0
SystemTrayIconflash.desktop1.0
TouchEventIntentflash.events3.0
UpdateEventair.update.events1.5
Updaterflash.desktop1.0
URLFilePromiseair.desktop2.0
URLMonitorair.net1.0
URLRequestDefaultsflash.net1.0
XMLSignatureValidatorflash.security1.0
Flash Player classes with AIR-specific functionality
The following classes are available to SWF content running in the browser, but AIR provides additional properties or
methods:
Last updated 12/7/2015
BUILDING ADOBE AIR APPLICATIONS
Working with the AIR APIs
PackageClassProperty, method, or eventAdded in AIR version
flash.desktopClipboardsupportsFilePromise2.0
ClipboardFormatsBITMAP_FORMAT1.0
FILE_LIST_FORMAT1.0
FILE_PROMISE_LIST_FORMAT2.0
URL_FORMAT1.0
flash.displayLoaderInfochildSandboxBridge1.0
parentSandboxBridge1.0
StageassignFocus()1.0
autoOrients2.0
deviceOrientation2.0
nativeWindow1.0
orientation2.0
orientationChange event2.0
12
orientationChanging event2.0
setAspectRatio2.0
setOrientation2.0
softKeyboardRect2.6
supportedOrientations2.6
supportsOrientationChange2.0
NativeWindowowner2.6
listOwnedWindows2.6
NativeWindowInitOptionsowner2.6
Last updated 12/7/2015
BUILDING ADOBE AIR APPLICATIONS
Working with the AIR APIs
PackageClassProperty, method, or eventAdded in AIR version
flash.eventsEventCLOSING1.0
DISPLAYING1.0
PREPARING2.6
EXITING1.0
HTML_BOUNDS_CHANGE1.0
HTML_DOM_INITIALIZE1.0
HTML_RENDER1.0
LOCATION_CHANGE1.0
NETWORK_CHANGE1.0
STANDARD_ERROR_CLOSE2.0
STANDARD_INPUT_CLOSE2.0
STANDARD_OUTPUT_CLOSE2.0
USER_IDLE1.0
13
USER_PRESENT1.0
HTTPStatusEventHTTP_RESPONSE_STATUS 1.0
responseHeaders 1.0
responseURL 1.0
KeyboardEventcommandKey1.0
controlKey1.0
Last updated 12/7/2015
BUILDING ADOBE AIR APPLICATIONS
Working with the AIR APIs
PackageClassProperty, method, or eventAdded in AIR version
flash.netFileReferenceextension1.0
httpResponseStatus event1.0
uploadUnencoded()1.0
NetStreamdrmAuthenticate event1.0
onDRMContentData event1.5
preloadEmbeddedData()1.5
resetDRMVouchers()1.0
14
setDRMAuthenticationCredent
ials()
1.0
URLRequestauthenticate1.0
cacheResponse1.0
followRedirects1.0
idleTimeout2.0
manageCookies1.0
useCache1.0
userAgent1.0
URLStreamhttpResponseStatus event 1.0
flash.printingPrintJobactive 2.0
copies 2.0
firstPage 2.0
isColor 2.0
jobName 2.0
lastPage2.0
maxPixelsPerInch2.0
paperArea2.0
printableArea2.0
printer2.0
printers2.0
selectPaperSize()2.0
showPageSetupDialog()2.0
start2()2.0
supportsPageSetupDialog2.0
terminate()2.0
PrintJobOptionspixelsPerInch2.0
printMethod2.0
Last updated 12/7/2015
BUILDING ADOBE AIR APPLICATIONS
Working with the AIR APIs
PackageClassProperty, method, or eventAdded in AIR version
flash.systemCapabilitieslanguages1.1
LoaderContextallowLoadBytesCodeExecution 1.0
SecurityAPPLICATION1.0
flash.uiKeyLocationD_PAD2.5
Most of these new properties and methods are available only to content in the AIR application security sandbox.
However, the new members in the URLRequest classes are also available to content running in other sandboxes.
The ByteArray.compress() and ByteArray.uncompress() methods each include a new algorithm parameter,
allowing you to choose between deflate and zlib compression. This parameter is available only to content running in AIR.
AIR-specific Flex components
The following Adobe® Flex™ MX components are available when developing content for Adobe AIR:
• FileEvent
• FileSystemComboBox
• FileSystemDataGrid
• FileSystemEnumerationMode
• FileSystemHistoryButton
• FileSystemList
• FileSystemSizeDisplayMode
• FileSystemTree
• FlexNativeMenu
• HTML
• Window
• WindowedApplication
• WindowedSystemManager
Additionally, Flex 4 includes the following spark AIR components:
15
• Window
• WindowedApplication
For more information about the AIR Flex components, see Using the Flex AIR components.
Last updated 12/7/2015
Chapter 4: Adobe Flash Platform tools for
AIR development
You can develop AIR applications with the following Adobe Flash Platform development tools.
For ActionScript 3.0 (Flash and Flex) developers:
• Adobe Flash Professional (see Publishing for AIR)
• Adobe Flex 3.x and 4.x SDKs (see “Setting up the Flex SDK” on page 18 and “AIR Developer Tool (ADT)” on
page 158)
• Adobe Flash Builder (see Developing AIR Applications with Flash Builder)
For HTML and Ajax developers:
• Adobe AIR SDK (see “Installing the AIR SDK” on page 16 and “AIR Developer Tool (ADT)” on page 158)
• Adobe Dreamweaver CS3, CS4, CS5 (see AIR Extension for Dreamweaver)
16
Installing the AIR SDK
The Adobe AIR SDK contains the following command-line tools that you use to launch and package applications:
AIR Debug Launcher (ADL) Allows you to run AIR applications without having to first install them. See “AIR Debug
Launcher (ADL)” on page 152.
AIR Development Tool (ADT) Packages AIR applications into distributable installation packages. See “AIR Developer
Tool (ADT)” on page 158.
The AIR command-line tools require Java to be installed your computer. You can use the Java virtual machine from
either the JRE or the JDK (version 1.5 or newer). The Java JRE and the Java JDK are available at http://java.sun.com/.
At least 2GB of computer memory is required to run the ADT tool.
Note: Java is not required for end users to run AIR applications.
For a quick overview of building an AIR application with the AIR SDK, see “Creating your first HTML-based AIR
application with the AIR SDK” on page 31.
Download and install the AIR SDK
You can download and install the AIR SDK using the following instructions:
Install the AIR SDK in Windows
• Download the AIR SDK installation file.
• The AIR SDK is distributed as a standard file archive. To install AIR, extract the contents of the SDK to a folder on
your computer (for example: C:\Program Files\Adobe\AIRSDK or C:\AIRSDK).
• The ADL and ADT tools are contained in the bin folder in the AIR SDK; add the path to this folder to your PATH
environment variable.
Last updated 12/7/2015
BUILDING ADOBE AIR APPLICATIONS
Adobe Flash Platform tools for AIR development
Install the AIR SDK in Mac OS X
• Download the AIR SDK installation file.
• The AIR SDK is distributed as a standard file archive. To install AIR, extract the contents of the SDK to a folder on
your computer (for example: /Users/<userName>/Applications/AIRSDK).
• The ADL and ADT tools are contained in the bin folder in the AIR SDK; add the path to this folder to your PATH
environment variable.
Install the AIR SDK in Linux
• The SDK is available in tbz2 format.
• To install the SDK, create a folder in which you want to unzip the SDK, then use the following command: tar -jxvf
<path to AIR-SDK.tbz2>
For information about getting started using the AIR SDK tools, see Creating an AIR application using the commandline tools.
What's included in the AIR SDK
The following table describes the purpose of the files contained in the AIR SDK:
17
SDK folderFiles/tools description
binThe AIR Debug Launcher (ADL) allows you to run an AIR application without first
frameworksThe libs directory contains code libraries for use in AIR applications.
includeThe include directory contains the C-language header file for writing native
installThe install directory contains the Windows USB drivers for Android devices. (These
libContains support code for the AIR SDK tools.
runtimesThe AIR runtimes for the desktop and for mobile devices.
samplesThis folder contains a sample application descriptor file, a sample of the seamless
packaging and installing it. For information about using this tool, see
Launcher (ADL)” on page 152.
The AIR Developer Tool (ADT) packages your application as an AIR file for distribution.
For information about using this tool, see
The projects directory contains the code for the compiled SWF and SWC libraries.
extensions.
are the drivers provided by Google in the Android SDK.)
The desktop runtime is used by ADL to launch your AIR applications before they have
been packaged or installed.
The AIR runtimes for Android (APK packages) can be installed on Android devices or
emulators for development and testing. Separate APK packages are used for devices
and emulators. (The public AIR runtime for Android is available from the Android
Market.)
install feature (badge.swf), and the default AIR application icons.
“AIR Developer Tool (ADT)” on page 158.
“AIR Debug
templatesdescriptor-template.xml - A template of the application descriptor file, which is
required for each AIR application. For a detailed description of the application
descriptor file, see
Schema files for the XML structure of the application descriptor for each release
version of AIR are also found in this folder.
“AIR application descriptor files” on page 195.
Last updated 12/7/2015
BUILDING ADOBE AIR APPLICATIONS
Adobe Flash Platform tools for AIR development
Setting up the Flex SDK
To develop Adobe® AIR® applications with Adobe® Flex™, you have the following options:
• You can download and install Adobe® Flash® Builder™, which provides integrated tools to create Adobe AIR projects
and test, debug, and package your AIR applications. See
Builder” on page 19.
• You can download the Adobe® Flex™ SDK and develop Flex AIR applications using your favorite text editor and the
command-line tools.
For a quick overview of building an AIR application with Flex SDK, see “Creating your first desktop AIR application
with the Flex SDK” on page 35.
Install the Flex SDK
Building AIR applications with the command-line tools requires that Java is installed on your computer. You can use
the Java virtual machine from either the JRE or the JDK (version 1.5 or newer). The Java JRE and JDK are available at
http://java.sun.com/.
Note: Java is not required for end users to run AIR applications.
“Creating your first desktop Flex AIR application in Flash
18
The Flex SDK provides you with the AIR API and command-line tools that you use to package, compile, and debug
your AIR applications.
1 If you haven't already done so, download the Flex SDK at
2 Place the contents of the SDK into a folder (for example, Flex SDK).
3 Copy the contents of the AIR SDK over the files in the Flex SDK.
Note: On Mac computers, make sure that you copy or replace the individual files in the SDK folders — not entire
directories. By default, copying a directory on the Mac to a directory of the same name removes the existing files in the
target directory; it does not merge the contents of the two directories. You can use the
window to merge the AIR SDK into the Flex SDK:
4 The command-line AIR utilities are located in the bin folder.
ditto air_sdk_folder flex_sdk_folder
ditto command in a terminal
Setting up external SDKs
Developing applications for Android and iOS requires that you download provisioning files, SDKs or other
development tools from the platform makers.
For information about downloading and installing the Android SDK, see Android Developers: Installing the SDK. As
of AIR 2.6, you are not required to download the Android SDK. The AIR SDK now includes the basic components
needed to install and launch APK packages. Still, the Android SDK can be useful for a variety of development tasks,
including creating and running software emulators and taking device screenshots.
An external SDK is not required for iOS development. However, special certificates and provisioning profiles are
needed. For more information, see
Obtaining developer files from Apple.
Last updated 12/7/2015
Chapter 5: Creating your first AIR
application
Creating your first desktop Flex AIR application in Flash
Builder
For a quick, hands-on illustration of how Adobe® AIR® works, use these instructions to create and package a simple
SWF file-based AIR “Hello World” application using Adobe® Flash® Builder.
If you haven’t already done so, download and install Flash Builder. Also, download and install the most recent version
of Adobe AIR, which is located here:
Create an AIR project
Flash Builder includes tools to develop and package AIR applications.
www.adobe.com/go/air.
19
You begin to create AIR applications in Flash Builder or Flex Builder in the same way that you create other Flex-based
application projects: by defining a new project.
1 Open Flash Builder.
2 Select File > New > Flex Project.
3 Enter the project name as AIRHelloWorld.
4 In Flex, AIR applications are considered an application type. You have two type options:
• a web application that runs in Adobe® Flash® Player
• a desktop application that runs in Adobe AIR
Select Desktop as the application type.
5 Click Finish to create the project.
AIR projects initially consist of two files: the main MXML file and an application XML file (known as the application
descriptor file). The latter file specifies application properties.
For more information, see Developing AIR applications with Flash Builder.
Write the AIR application code
To write the “Hello World” application code, you edit the application MXML file (AIRHelloWorld.mxml), which is
open in the editor. (If the file isn't open, use the Project Navigator to open the file.)
Flex AIR applications on the desktop are contained within the MXML WindowedApplication tag. The MXML
WindowedApplication tag creates a simple window that includes basic window controls such as a title bar and close
button.
1 Add a title attribute to the WindowedApplication component, and assign it the value "Hello World":
Next, you will change some settings in the application descriptor to allow the application to be transparent:
1 In the Flex Navigator pane, locate the application descriptor file in the source directory of the project. If you named
your project AIRHelloWorld, this file is named AIRHelloWorld-app.xml.
2 Double-click the application descriptor file to edit it in Flash Builder.
3 In the XML code, locate the commented lines for the systemChrome and transparent properties (of the
initialWindow property). Remove the comments. (Remove the "<!--" and "-->" comment delimiters.)
4 Set the text value of the systemChrome property to none, as in the following:
<systemChrome>none</systemChrome>
5 Set the text value of the transparent property to true, as in the following:
<transparent>true</transparent>
6 Save the file.
Test the AIR application
To test the application code that you’ve written, run it in debug mode.
1 Click the Debug button in the main toolbar.
You can also select the Run > Debug > AIRHelloWorld command.
21
The resulting AIR application should look like the following example:
2 Using the horizontalCenter and verticalCenter properties of the Label control, the text is placed in the center
of the window. Move or resize the window as you would any other desktop application.
Note: If the application does not compile, fix any syntax or spelling errors that you inadvertently entered into the code.
Errors and warnings are displayed in the Problems view in Flash Builder.
Last updated 12/7/2015
BUILDING ADOBE AIR APPLICATIONS
Creating your first AIR application
Package, sign, and run your AIR application
You are now ready to package the "Hello World" application into an AIR file for distribution. An AIR file is an archive
file that contains the application files, which are all of the files contained in the project’s bin folder. In this simple
example, those files are the SWF and application XML files. You distribute the AIR package to users who then use it
to install the application. A required step in this process is to digitally sign it.
1 Ensure that the application has no compilation errors and runs as expected.
2 Select Project > Export Release Build.
3 Check that the AIRHelloWorld project and AIRHelloWorld.mxml application are listed for project and
application.
4 Select Export as signed AIR package option. Then click Next.
5 If you have an existing digital certificate, click Browse to locate and select it.
6 If you must create a new self-signed digital certificate, select Create.
7 Enter the required information and click OK.
8 Click Finish to generate the AIR package, which is named AIRHelloWorld.air.
You can now install and run the application from the Project Navigator in Flash Builder or from the file system by
double-clicking the AIR file.
22
Creating your first desktop AIR application using Flash
Professional
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® Professional.
If you haven’t already done so, download and install Adobe AIR, which is located here: www.adobe.com/go/air.
Create the Hello World application in Flash
Creating an Adobe AIR application in Flash is much like creating any other FLA file. The following procedure guides
you through the process of creating a simple Hello World application using Flash Professional.
To create the Hello World application
1 Start Flash.
2 In the Welcome Screen, click AIR to create an empty FLA file with Adobe AIR publish settings.
3 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.
4 Enter the text “Hello World” in the text field.
5 Save the file, giving it a name (for example, HelloAIR).
Test the application
1 Press Ctrl + Enter or select Control ->Test Movie->Test to test the application in Adobe AIR.
Last updated 12/7/2015
BUILDING ADOBE AIR APPLICATIONS
Creating your first AIR application
2 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");
3 Press Ctrl + Shift + Enter, or select Debug->Debug Movie->Debug to run the application with Debug Movie.
The Hello World application looks like this illustration:
23
Package the application
1 Select File > Publish.
2 Sign the Adobe AIR package with an existing digital certificate or create a self-signed certificate using the following
steps:
a Click the New button next to the Certificate field.
b Complete the entries for Publisher name, Organizational unit, Organizational name, E-mail, Country,
Password, and Confirm Password.
c 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).
d 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.
e 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 filename or click the Browse button to locate
and select it.
f Enter the same password in the Password text field of the Digital Signature dialog box as the password that you
assigned in step b. For more information about signing your Adobe AIR applications, see
AIR file” on page 181.
3 To create the application and installer file, click the Publish button. (In Flash CS4 and CS5, click the OK button.)
You must execute Test Movie or Debug Movie to create the SWF file and application.xml files before creating the
AIR file.
“Digitally signing an
Last updated 12/7/2015
BUILDING ADOBE AIR APPLICATIONS
Creating your first AIR application
4 To install the application, double click the AIR file (application.air) in the same folder where you saved your
application.
5 Click the Install button in the Application Install dialog.
6 Review the Installation Preferences and Location settings and make sure that the ‘Start application after installation’
checkbox is checked. Then click Continue.
7 Click Finish when the Installation Completed message appears.
Create your first AIR application for Android in Flash
Professional
To develop AIR applications for Android, you must download the Flash Professional CS5 extension for Android from
Adobe Labs.
You must also download and install the Android SDK from the Android web site, as described in: Android Developers:
Installing the SDK.
Create a project
1 Open Flash Professional CS5
2 Create a new AIR for Android project.
The Flash Professional home screen includes a link to create an AIR for Android application. You can also select
File > New, and then select the AIR for Android template.
24
3 Save the document as HelloWorld.fla
Write the code
Since this tutorial isn't really about writing code, just use the Text tool to write, "Hello, World!" on the stage.
Set the application properties
1 Select File > AIR Android Settings.
2 In the General tab, make the following settings:
• Output File: HelloWorld.apk
• App name: HelloWorld
• App ID: HelloWorld
• Version number: 0.0.1
• Aspect ratio: Portrait
3 On the Deployment tab, make the following settings:
• Certificate: Point to a valid AIR code-signing certificate. You can click the Create button to create a new
certificate. (Android apps deployed via the Android Marketplace must have certificates that are valid until at
least 2033.) Enter the certificate password in the Password field.
• Android deployment type: Debug
• After Publish: Select both options
• Enter the path to the ADB tool in the tools subdirectory of the Android SDK.
Last updated 12/7/2015
BUILDING ADOBE AIR APPLICATIONS
Creating your first AIR application
4 Close the Android settings dialog by clicking OK.
The app does not need icons or permissions at this stage in its development. Most AIR apps for Android do require
some permissions in order to access protected features. You should only set those permissions your app truly
requires since users may reject your app if it asks for too many permissions.
5 Save the file.
Package and Install the application on the Android device
1 Make sure that USB debugging is enabled on your device. You can turn USB debugging on in the Settings app under
Applications > Development.
2 Connect your device to your computer with a USB cable.
3 Install the AIR runtime, if you have not already done so, by going to the Android Market and downloading Adobe
AIR. (You can also install AIR locally using the
for use on Android devices and emulators are included in the AIR SDK.)
4 Select File > Publish.
Flash Professional creates the APK file, installs the app on the connected Android device, and launches it.
“ADT installRuntime command” on page 169. Android packages
25
Creating your first AIR application for iOS
AIR 2.6 or later, iOS 4.2 or later
You can code, build, and test the basic features of an iOS application using only Adobe tools. However, to install an
iOS application on a device and to distribute that application, you must join the Apple iOS Developer program (which
is a fee-based service). Once you join the iOS Developer program you can access the iOS Provisioning Portal where
you can obtain the following items and files from Apple that are required to install an application on a device for testing
and for subsequent distribution. These items and files include:
• Development and distribution certificates
• Application IDs
• Development and distribution provisioning files
Create the application content
Create a SWF file that displays the text, “Hello world!” You can perform this task using Flash Professional, Flash
Builder, or another IDE. This example simply uses a text editor and the command line SWF compiler included in the
Flex SDK.
1 Create a directory in a convenient location to store your application files. Create a file named, HelloWorld.as and
edit the file in your favorite code editor.
2 Add the following code:
Last updated 12/7/2015
Loading...
+ 269 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.