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 Using Flash CS3 and Adobe AIR to Build Desktop Applications Dan Carr November 13, 2008 3:00 4:15 PM 1. AIR Basics 2. Installation and Development in Flash CS3 3. Extended ActionScript API 4. Demo: Building a simple desktop application AIR Basics AIR (Adobe Integrated Runtime) is a runtime 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 creates an installer deployed desktop application The AIR runtime and AIR applications can be seamlessly installed from a regular web-based Flash movie AIR adds an extended ActionScript API and a desktop level security sandbox AIR applications can interact with the user s system Development Environments AIR applications can be developed in the following software: 1. FlexBuilder 3 2. AIR SDK (command line) 3. Dreamweaver (HTML, AJAX, JavaScript) 4. Flash CS3/CS4 Professional 5. 3 rd Party (FlashDevelop, etc.) Installation in Flash CS3 Installation is an easy two-step process. Installation files: 1. Install the AIR runtime 2. Install the Flash CS3 Update for AIR Get the installation files and more information at: http://www.adobe.com/products/air/develop/flash/ Note: Flash CS4 includes native support for publishing to AIR format. Development 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. Workflow: 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 3. Test movie to see the AIR API active in Flash CS3 4. Publish the AIR application from Publish Settings or the Publish AIR command (Publish in CS4) Session 605 Using Flash CS3 and AIR to Build Desktop Applications Dan Carr, Dan Carr Design Page 1
November 11-14, 2008 San Jose, CA Extended ActionScript API 1. Includes all of the web-based ActionScript APIs 2. Option for synchronous or asynchronous behavior with system functions and HTTP calls 3. HTML loader, native windows, & native menus 4. Access to the local file system 5. Access to clipboard and desktop 6. Ability to connect to local SQL-based databases 7. Ability to monitor the network connection 8. Ability to display PDF content internally Demo: Building a Simple AIR Application 1. Create an application in an ActionScript 3.0 FLA file 2. Switch the Publish Settings to AIR 1.0 3. Setup the installer using the Commands menu 4. Create a self-signed certificate 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 Dan Carr, Dan Carr Design Page 2
Using Flash CS3 and the AIR to Build Desktop Applications Thursday, November 13, 3:00 pm Session 605 Presented by Dan Carr dan@dancarrdesign.com 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 Aptana 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.html 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