Adobe AIR for Flex Developers Pocketguide
English, 0.85
Preface
This book provides a quick introduction to developing applications for Adobe AIR. Adobe AIR is a new cross-platform desktop application runtime created by Adobe. Although Adobe AIR allows both Flash- and HTML-based application development, this book focuses on building applications using the Adobe Flex framework.
The book gives an overview of Adobe AIR, shows how to set up your development environment, and discusses new Adobe AIR functionality and APIs. Once you have finished reading this book, you should have a good understanding of what Adobe AIR is as well as how to build HTML and JavaScript applications for it.
Adobe AIR Runtime Naming Conventions
Adobe AIR allows developers to leverage a number of web technologies to deploy web applications to the desktop. Indeed, there are so many technologies that it can be difficult to keep track of them all. Table 1 lists the terms used in the book, and defines each one.
Table 1. AIR runtime naming conventions
| Name | Meaning |
| Adobe AIR | The cross-platform desktop runtime that enables the running of Adobe AIR applications. |
| Adobe AIR application | An application built with Flash, HTML, and/or PDF that runs on top of Adobe AIR. |
| Adobe Flash | Any content contained within a SWF 9 file format that runs in the Adobe Flash Player or Adobe AIR. |
| ActionScript | The ECMAScript-based programming language used to program Flash content. Unless otherwise noted, all references to ActionScript in this book refer to ActionScript 3. |
| HTML | Standard web-based markup language used to create and lay out web pages. |
| JavaScript | Web-based implementation of ECMAScript used to program content within HTML applications. |
| Short for Portable Document Format, a technology that allows for seamless distribution and display of electronic documents. | |
| Adobe Flex Framework | An XML- and ActionScript-based framework designed to make developing Flash-based Rich Internet Applications (RIAs) easy. |
| Adobe Flex Builder | An Eclipse-based IDE used to build Flash-based RIAs using Flex and ActionScript. |
What This Book Covers
This book gives a general overview of what Adobe AIR is, shows how to set up your development environment to start building applications, focuses on a couple of the Adobe AIR APIs (HTML and File), and finally, shows how to do a number of common programming tasks within AIR.
The following is a partial list of features and functionality included in the Adobe AIR 1.1 release:
- Mac support (OS X 10.4.9 and later; Intel and PPC)
- Windows support (Windows Vista, Windows XP SP2, and Windows 2000 SP4)
- File I/O API
- SQLite embedded database
- All functionality within Flash Player 9, including complete network stack
- Windowing APIs
- Command-line tools (ADL and ADT)
- HTML support within Flash-based content
- Top-level HTML applications
- Flash content within HTML applications
- ActionScript/JavaScript script bridging
- Flex Builder and Flex Framework support for authoring Adobe AIR applications
- Application command-line arguments
- Drag-and-drop support
- Rich clipboard access
- Native menu API
- Full-screen support
- Application update API
- Online/offline detection API
- Encrypted local data stores
- Presence APIs
- File type associations
- Application icons
- PDF support
- Right-click and contextual menu control
- System notifications
While it has always been possible to develop non-Enlgish AIR applications, Adobe AIR 1.1 added support for localizing the installer dialog into the following languages:
- Chinese Traditional
- Chinese Simplified
- English
- French
- German
- Italian
- Japanese
- Korean
- Brazilian Portugues
- Russian
- Spanish
We will cover these features in more detail throughout the rest of the book.
Errors and Errata
This book is written against the 1.1 release of Adobe AIR, and was finalized after the runtime was released. Thus, all information in the book should be correct for Adobe AIR 1.1.
However, it is possible that there will be updates to the runtime, or that there are errors within the book. If something in the book does not seem correct, check the online documentation for the latest information.
You can find the latest information and documentation on Adobe AIR at:
You should also check the book's errata web site for the latest updates and corrections:
Audience for This Book
We hope that this book is for you, but just to be sure, let's discuss some of the assumptions that we made, as well as what type of developers the book is targeted at.
Who This Book Is For
This book is for developers interested in leveraging the Flex Framework to build and deploy Flash-based applications to the desktop via Adobe AIR. If you don't have any experience with developing with the Flex Framework, then we suggest that you at least view some of the Flex introductory information and videos available at:
What Does This Book Assume?
The book assumes that the reader has at least a basic familiarity with creating Flash-based applications and content using the Flex Framework and ActionScript 3.0.
You should be familiar with web technologies such as Flash, Flex, HTML and JavaScript, as well as general web development concepts.
Who This Book Is Not For
While it is possible to create HTML-and JavaScript-based applications with Adobe AIR, this book does not go into any detail on HTML-and JavaScript-focused AIR application development. If you are an HTML and JavaScript developer interested in building AIR applications, then this book can provide a good introduction and overview of AIR and its functionality, but you should view the Adobe AIR documentation and articles available from the Adobe AIR web site for a more HTML/ JavaScript-focused discussion.
We also recommend that you check out the Adobe AIR for JavaScript Developers Pocketguide:
http://www.tostring.org/books/adobe-air-for-javascript-developers-pocketguide/1.0/
which was written by some of the authors of this books, and provides an introduction to getting started with Adobe AIR using JavaScript and HTML.
How This Book Is Organized
This book contains the following chapters and appendixes:
Chapter 1, Introduction to Adobe AIR
Provides a general overview of what Adobe AIR is and the types of applications it targets
Chapter 2: Getting Started with Adobe AIR Development
Covers tips on starting developing for Adobe AIR, and shows how to build your first application using both the Adobe Flex SDK as well as Flex Builder.
*Chapter 3, Using HTML Within Flex-Based AIR Applications
Discusses how HTML can be leveraged within Flash-based applications, and covers JavaScript/ActionScript communication via script bridging.
*Chapter 4, Using the File System API
Provides an introduction to the File API within Adobe AIR, and how to use both synchronous and asynchronous APIs.
Chapter 5, Adobe AIR Mini-Cookbook
Provides tips and tricks for accomplishing common tasks within AIR applications, presented in the O'Reilly Cookbook format.
How to Use This Book
You can use this book as an introduction to and overview of Adobe AIR, and as a step-by-step guide to getting started with Adobe AIR application development. Although it may be tempting to jump ahead to specific sections, it is strongly suggested that you at least read the first two chapters, which provide an overview of the runtime and discuss how to set up your development environment for building Adobe AIR applications. This will make it much easier to then jump into the specific areas of runtime functionality that may interest you.
Once you have read the book and understand the basics of how to build an Adobe AIR application with ActionScript and Flex, then you can use the book as a reference, referring to specific sections when you need to know how to tackle a specific problem. In particular, the Cookbook sections should prove useful as you develop your applications.
Finally, this book is just an introduction to Adobe AIR and does not cover all of the features and functionality included within it. It is meant to complement, but not replace, the extensive and in-depth documentation on the runtime provided by Adobe. Make sure to explore the documentation to ensure that you're familiar with all of the APIs and functionality not covered in this book.
Conventions Used in This Book
The following typographical conventions are used in this book:
Plain text
Indicates menu titles, menu options, menu buttons, and keyboard accelerators (such as Alt and Ctrl).
Italic
Indicates new terms, URLs, email addresses, filenames, file extensions, pathnames, directories, and Unix utilities
Constant widthIndicates commands, options, switches, variables, attributes, keys, functions, types, classes, namespaces, methods, modules, properties, parameters, values, objects, events, event handlers, XML tags, HTML tags, macros, the contents of files, and the output from commands
Constant width boldShows commands or other text that should be typed literally by the user
*
Constant width italic*Shows text that should be replaced with user-supplied values
License and Code Examples
This work, including all text and code samples, is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.
To view a copy of this license, visit http://creativecommons.org/licenses/by- nc-sa/3.0/; or send a letter to Creative Commons, 543 Howard St., 5th Floor, San Francisco, California, 94105, USA.
You can find more information on Creative Commons at http://www.creativecommons.org.
Support and More Information
Accessing the Book Online
You can always find the latest information about this book, as well as download free electronic versions of it from the book's web site at:
Online Adobe AIR Resources
Although Adobe AIR is a relatively new technology, there are already a number of resources where you can find more information on Adobe AIR and Rich Internet Application development.
Adobe AIR site
Primary web site for information, downloads, and documentation of Adobe AIR:
Adobe AIR Developer Center
Developer Center with articles, information, and resources on developing Applications for Adobe AIR:
Adobe AIR Documentation
Complete Adobe AIR Documentation:
Adobe AIR Forum
Official Adobe Forum for discussing Adobe AIR:
Apollo coders mailing list
Mailing list for discussing Adobe AIR application development:
Mike Chambers' weblog
One of the authors of this book, Mike Chambers is a member of the Adobe platform team who posts frequently on Adobe AIR:
MXNA Adobe AIR Smart Category
Adobe AIR Smart Category that lists any discussions about Adobe AIR within the Adobe online development community:
Flex Developer Center
Developer Center with articles, information, and resources on working with the Flex Framework:
Flex coders mailing list
Popular mailing list for discussing development using the Flex Framework:
Universal Desktop Weblog
Ryan Stewart's weblog, which focuses on the latest developments in the world of Rich Internet Applications:
About the Authors
Mike Chambers
Mike Chambers has spent the past eight years building applications that target the Flash runtime. During that time, he has worked with numerous technologies, including Flash, Generator, .NET, Central, Flex, and JavaScript. He is currently the principal product manager for developer relations for the Flash platform. He has written and spoken extensively on Flash and RIA development and is coauthor of Adobe Apollo for Flex Developers Pocket Guide, Adobe AIR for JavaScript Developers Pocketguide, Flash Enabled: Flash Design and Development for Devices, and Generator and Flash Demystified.
Mike received his master's degree in international economics and European studies from the John Hopkins School of Advanced International Studies (SAIS) in 1998.
When he is not programming, Mike can be found playing Halo, trying to recover from his World of Warcraft addiction, working on scale models, or hanging out with his two daughters, Isabel and Aubrey, and his wife Cathy.
Mike maintains a weblog at http://www.mikechambers.com/.
Robert L. Dixon
Rob Dixon began developing Flash applications in 1998, back when Rich Internet Applications weren't nearly as well off. He is presently the Content Architect for the Platform Documentation group at Adobe. He developed sample applications and documentation for products including Adobe AIR, ActionScript, Flash Player, and Central. He helped write Programming ActionScript 3.0 and the ActionScript Language Reference.
In previous lives he programmed video games, designed web sites, built enterprise software using Java and .NET, and spoke at many software development conferences. He wrote a book on CASE software back when CASE was all the rage.
On weekends you can usually find him hiking or biking just generally cruising around in Marin County, California, if you know just where to look. Or if you attach a homing device to his jacket or something.
Jeff Swartz
Jeff Swartz first worked at Macromedia (now Adobe Systems) in 1992 and has participated in a number of multimedia and web software projects. He is currently the lead technical writer for the Adobe AIR project. Jeff received a bachelor's degree in Computer Science and Mathematics from the University of Illinois at Urbana-Champaign and studied at the Edinburgh University Department of Artificial Intelligence.
Audiences around the San Francisco Bay Area have tolerated Jeff's artistry on the trombone. He has served as Big Frank, a dancing hot dog, for Vienna Beef Ltd.
Acknowledgments
The authors would like to thank Mark Nichoson from Adobe and Steve Weiss, Phil Dangler, and Mary Brady from O'Reilly for helping make the initial versiono of the book possible in an incredibly short amount of time.
Thank you to everyone on the Adobe AIR team for all of the dedication and hard work in getting a 1.0 runtime out the door. Particular thanks to Chris Brichford, Ethan Malasky, Stan Switzer, and Oliver Goldman (all on the AIR team) for reviewing and providing feedback on the original version of the book.
Table of Contents
- Preface
- Chapter 1 : Introduction to Adobe AIR
- Chapter 2 : Getting Started with Adobe AIR Development
- Appendix A : Uninstalling Prerelease Versions of Adobe AIR
Comments
# Laurent Lozan (Jul 16, 2008 3:51 a.m.)
I've already translated this in Romanian. :-) E-mailing it to Mike.