605 Using Flash CS3 and AIR to Build Desktop Applications

Dan Carr, Dan Carr Design

www.eLearningGuild.com November 11-14, 2008 San Jose, CA

Session Overview

1. AIR Basics Using Flash CS3 and Adobe AIR 2. Installation and Development in Flash to Build Desktop Applications CS3 3. Extended ActionScript API 4. Demo: Building a simple desktop Dan Carr application November 13, 2008 3:00 – 4:15 PM

AIR Basics Development Environments

• AIR (Adobe Integrated Runtime) is a runtime AIR applications can be developed in the following software: technology built on top of the WebKit open-source browser, Flash Player 9, and ActionScript 3.0 • Publishing to the AIR format from Flash Professional 1. FlexBuilder 3 creates an installer deployed desktop application 2. AIR SDK (command line) • The AIR runtime and AIR applications can be seamlessly installed from a regular web-based Flash movie 3. Dreamweaver (HTML, , JavaScript) • AIR adds an extended ActionScript API and a desktop level security sandbox 4. Flash CS3/CS4 Professional • AIR applications can interact with the user’s system 5. 3rd Party (FlashDevelop, etc.)

Installation in Flash CS3 Development Process

Installation is an easy two-step process. Developing an AIR application in Flash follows the same process as any other type of Flash project, but adds a new set of Publish Settings to the mix. Installation files: 1. Install the AIR runtime Workflow: 2. Install the Flash CS3 Update for AIR 1. Work in an ActionScript 3.0 file as usual 2. Use the FLA’s Publish Settings and Commands menu to configure the AIR file Get the installation files and more information at: 3. Test movie to see the AIR API active in Flash CS3 http://www.adobe.com/products/air/develop/flash/ 4. Publish the AIR application from Publish Settings or the Publish AIR command (Publish in CS4) Note: Flash CS4 includes native support for publishing to AIR format.

Session 605 – Using Flash CS3 and AIR to Build Desktop Applications – Page 1 Dan Carr, Dan Carr Design November 11-14, 2008 San Jose, CA

Demo: Building a Simple AIR Extended ActionScript API Application 1. Includes all of the web-based ActionScript APIs 2. Option for synchronous or asynchronous 1. Create an application in an ActionScript 3.0 behavior with system functions and HTTP calls FLA file 3. HTML loader, native windows, & native menus 4. Access to the local file system 2. Switch the Publish Settings to AIR 1.0 5. Access to clipboard and desktop 3. Setup the installer using the Commands 6. Ability to connect to local SQL-based menu databases 4. Create a self-signed certificate 7. Ability to monitor the network connection 8. Ability to display PDF content internally 5. Publish the AIR file 6. Launch the installer to test

Resources

Dan Carr Design www.dancarrdesign.com

Adobe Developer Center http://www.adobe.com/devnet/air/flash/

Beginning Adobe AIR Author Rich Tretola, O’reilly books

Session 605 – Using Flash CS3 and AIR to Build Desktop Applications – Page 2 Dan Carr, Dan Carr Design Using Flash CS3 and the AIR to Build Desktop Applications Thursday, November 13, 3:00 pm Session 605

Presented by Dan Carr [email protected]

Overview

The Adobe Integrated Runtime (AIR) is a multi-platform runtime for building desktop applications. The true power of AIR lies in its ability to tie into the desktop and web environments seamlessly using development techniques you most likely already know. This session will show you how easy it is to use Flash CS3 to create a desktop application deployed to the AIR runtime. You’ll explore options for development environments, the basics of working with AIR in Flash CS3, and the step by step process of creating a Flash movie with full local file system access.

Session topics

 The elements of the AIR runtime  Development environments and technology options  How to work with AIR in Flash CS3  How to publish a Flash application to AIR format  How to work with the extended ActionScript 3.0 API for AIR  How to work with badge.swf and air.swf

Audience

This topic is of interest to beginning to intermediate level developers who are interesting in an overview of the technology and the specifics of working with AIR in Flash CS3.

Adobe Integrated Runtime (AIR)

The Adobe Integrated Runtime is built on top of Flash Player 9, ActionScript 3.0, and the WebKit HTML/JavaScript engine. Essentially AIR adds to Flash the ability to run from the desktop with extended system access and functionality unavailable to network-based Flash movies. But AIR is not just about Flash. In fact you don’t have to use Flash at all if you prefer other mediums. AIR allows web developers to take knowledge in web technologies they already use to create full-fledged desktop applications.

Development Environments

AIR is not necessarily about Flash. AIR applications can be built using a handful of different development environments including:

 Flash CS3 and higher  Flex Builder 2 and Higher  Flex/AIR SDK (command line compiler)  Dreamweaver CS3 and higher  Studio

The AJAX and JavaScript communities were some of the early supporters of AIR developing desktop applications in non-Flash based web technologies. The Flex community hopped onboard with the early implementation of ActionScript 3.0. And last but not least the Flash community joined the game when the Flash CS3 updater for AIR was released. Look for new communities to join the mix as AIR moves toward mobile integration in the near future.

Extended ActionScript 3.0 API

One of the most impressive things about the AIR runtime is the APIs it adds to the already feature packed ActionScript 3.0 language. The extended API allows you access to the following features:

 Includes all of the web-based ActionScript APIs  Extends the security sandbox for many of the features limited on the web  Option for synchronous or asynchronous behavior with system functions and HTTP calls  HTML loader, native windows, & native menus  Access to the local file system  Access to clipboard and desktop  Ability to connect to local SQL-based databases  Ability to monitor the network connection  Ability to display PDF content internally  And many more details…

For developers who choose to work with JavaScript, AJAX, and HTML, there is a JavaScript wrapper for the AIR portions of the API.

Customizing the Experience Using badge.swf and air.swf

Adobe provides utilities for connecting the browser environment to the AIR desktop environment. The utilities come in the form of SWF files which can be loaded from the Adobe domain called “badge.swf” and “air.swf”. The SWF files has the ability to:

 Check to see if the runtime is available on the user’s computer  Download the runtime for installation if needed (seamless install feature)  Check to see if an AIR application exists on the desktop from a browser  Check the version of the AIR application.  Download the application or updates to the application as needed More Resources:

For general information and downloads visit the Adobe website: http://www.adobe.com/products/air/ http://www.adobe.com/devnet/air/flash/

For documentation on working with AIR and Flash CS3, please visit: http://livedocs.adobe.com/air/1/devappsflash/

For documentation on ActionScript 3.0 including the AIR APIs, please visit: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/index.

For information about working with Flash to create desktop applications backward compatible to Flash Player 6.r65, please see the following: http://www.adobe.com/devnet/flash/articles/local_network_playback.html