You are previewing Adobe AIR 1.5 Cookbook.
O'Reilly logo
Adobe AIR 1.5 Cookbook

Book Description

Thoroughly vetted by Adobe's AIR development team, Adobe AIR 1.5 Cookbook addresses fundamentals, best practices, and topics that web developers and application designers inquire about most. The hands-on recipes in this cookbook help you solve a variety of tasks and scenarios you may encounter using Adobe AIR to build Rich Internet Applications for the desktop. It's an ideal way to learn the nuances of Adobe AIR, with practical solutions you can use right away, and detailed explanations of why and how they work. These recipes will help you:

  • Build an AIR application with Flex, Flash, or HTML and Ajax

  • Create a database and connect it to your application

  • Put together native menus for PCs and Macs

  • Work with the Service Monitor Framework

  • Utilize the Adobe AIR Update Framework

  • Create branded desktop experiences with custom chrome and custom application icons

  • Distribute your AIR application with the Seamless Install Badge

And more. Adobe AIR 1.5 Cookbook includes dozens of recipes from rising stars in the AIR development community-David Tucker, Rich Tretola, Marco Casario, and Koen De Weggheleire-along with the best solutions posted by visitors to the Adobe AIR Cookbook community website hosted by Adobe and O'Reilly ( If you're ready to expand your skill set with Adobe AIR, this is the book you've been waiting for.

Table of Contents

  1. Special Upgrade Offer
  2. A Note Regarding Supplemental Files
  3. Foreword
  4. Credits
    1. Author Bios
    2. Technical Editor Bios
    3. Community Contributor Bios
  5. Preface
    1. AIR 1.5
    2. Bonus Chapter Online: Developing Mashup AIR Applications
    3. Who This Book Is For
    4. Who This Book Is Not For
    5. How This Book Is Organized
    6. Conventions Used in This Book
    7. This Book’s Example Files
    8. Using the Code Examples
    9. How to Use This Book
    10. The Adobe AIR Cookbook Cook-Off
    11. O’Reilly Cookbooks
    12. Safari® Books Online
    13. How to Contact Us
    14. Acknowledgments
  6. 1. AIR Basics
    1. Creating and Running an AIR Application with Flex Builder 3
    2. Creating and Running an AIR Application with Flash
    3. Creating and Running an AIR Application with HTML and JavaScript
    4. Debugging an AIR Application with JavaScript
    5. Signing and Exporting an AIR Application
    6. Signing an AIR File with a Trusted Certificate
    7. Understanding Synchronous and Asynchronous Programming in AIR
  7. 2. Application Settings
    1. Targeting a Specific Version of AIR
    2. Setting the Application ID
    3. Setting the Application Name and Filename
    4. Setting the Application Version
    5. Editing the Application Description and Copyright Information
    6. Editing the Initial Window Settings
    7. Setting the Installation Folder for an Application
    8. Setting the Default Program Menu Folder
    9. Setting a Custom Application Icon
    10. Allowing an AIR Application to Interact with the Browser
    11. Setting the Application to Handle All Updates
    12. Determining the Application Version at Runtime
    13. Creating Multilingual AIR Installations
  8. 3. Application Windows
    1. Changing the Main Application Window
    2. Launching a New Window in ActionScript
    3. Launching a New Window (Flex)
    4. Launching a New Window (JavaScript)
    5. Creating Utility Windows
    6. Creating Lightweight Windows
    7. Creating a Full-Screen Window
    8. Managing Multiple Windows
    9. Creating Windows with Custom Chrome
    10. Minimizing and Maximizing a Window
    11. Resizing a Window
    12. Closing a Window
    13. Displaying a Prompt Before Closing a Window
    14. Closing All Open Windows at Once
    15. Adding a Drop Shadow to a Custom Chrome Window in ActionScript
    16. Applying a Pixel Bender Filter to a Custom Chrome Window in ActionScript
  9. 4. Screens
    1. Positioning Windows on the Desktop
    2. Positioning Windows Across Multiple Monitors
    3. Determining the Monitors on Which an Application Is Currently Displayed
  10. 5. HTML Content
    1. Displaying HTML Content
    2. Accessing JavaScript from ActionScript in an HTML Container
    3. Accessing ActionScript from JavaScript in an HTML Container
    4. Scripting the DOM from ActionScript
    5. Accessing and Editing an HTML Style Sheet from ActionScript
    6. Accessing the HTML Container History List
    7. Bridging Content from Different Security Sandboxes
    8. Creating JavaScript Functions from ActionScript
    9. Scrolling HTML Content in ActionScript
    10. Using ActionScript Libraries Within an HTML Page
  11. 6. PDF Support
    1. Detecting Whether PDF Support Is Available
    2. Loading a PDF Document
    3. Communicating from AIR to PDF
    4. Communicating from PDF to AIR
  12. 7. Clipboard Support
    1. Working with the Clipboard Data Types
    2. Adding Data to the Operating System Clipboard
    3. Retrieving Data from the Operating System Clipboard
    4. Clearing Data from a Clipboard
    5. Using Deferred Rendering with Clipboard Data
    6. Creating Custom Clipboard Data Formats
  13. 8. Drag and Drop Support
    1. Dragging Data Out of an Application in ActionScript
    2. Dragging Data Out of an Application in JavaScript
    3. Dragging Data Into an Application in ActionScript
    4. Dragging Data Into an Application in JavaScript
    5. Dragging and Dropping Within an Application in ActionScript
    6. Dragging and Dropping Within an Application in JavaScript
  14. 9. File System Integration
    1. Accessing Directory Aliases in the File Class
    2. Creating a New File or Directory
    3. Deleting a File or Directory
    4. Copying a File or Directory
    5. Moving a File or Directory
    6. Moving a File or Directory to the Trash
    7. Prompting the User to Select a File or Directory
    8. Reading Data from a File
    9. Writing Data to a File
    10. Creating a Temporary File or Directory
    11. Caching Images to Disk in ActionScript
    12. Searching for Files of a Given Extension in a Directory in ActionScript
    13. 9.1. Migrating Serialization Changes in ActionScript
  15. 10. Embedded SQL Database Programming
    1. Creating a Database
    2. Connecting to a Database in Synchronous Mode
    3. Connecting to a Database in Asynchronous Mode
    4. Creating an In-Memory Database
    5. Creating an Encrypted Database
    6. Encrypting a Database with a Password
    7. Creating Tables in a Database
    8. Querying a Database Synchronously
    9. Querying a Database Asynchronously
    10. Retrieving Results from a Query
    11. Using Parameters in Queries
    12. Including a Database in an Application
    13. Persisting Application Settings
  16. 11. Encrypted Local Store
    1. Storing Data in the Encrypted Local Store
    2. Retrieving Data from the Encrypted Local Store
    3. Removing and Resetting Data in the Encrypted Local Store
    4. Storing Application-Specific Data in the Encrypted Local Store
    5. Safeguarding Files with Encrypted Local Store
  17. 12. Application and Window Native Menus
    1. Creating a Native Menu
    2. Responding to Menu Events
    3. Adding a Menu Separator
    4. Creating Nested Menus
    5. Creating a Native Window Menu (Windows)
    6. Creating a Native Window Menu (Mac)
    7. Creating a Context Menu (ActionScript)
    8. Creating a Context Menu (JavaScript)
    9. Assigning Keyboard Shortcuts to Menu Items
    10. Enabling and Disabling Menu Items
    11. Toggling Menu Items
  18. 13. Taskbar and Dock Integration
    1. Adding an Icon to the System Tray (Windows)
    2. Adding a Custom Menu to the System Tray Icon (Windows)
    3. Adding a Custom Menu to the Dock Icon (Mac)
    4. Changing the System Tray or Dock Icon
    5. Notifying the User Through the Dock (Mac)
    6. Notifying the User Through the Taskbar (Windows)
  19. 14. File Types
    1. Registering Custom File Types
    2. Determining Whether an Application Is the Default Application for a File Type
    3. Setting and Removing an Application as the Default Application for a File Type
    4. Getting the Path of the Default Application for a File Type
  20. 15. Service Monitor Framework
    1. Including the Service Monitor Framework in an Application (JavaScript)
    2. Including the Service Monitor Framework in an Application (Flash)
    3. Monitoring the Connection to a URL
    4. Reading Only the Head of a URL
    5. Monitoring the Connection to a Specific Port on a Server
  21. 16. Application Updates
    1. Creating Applications with Update Capabilities
    2. Creating Custom Update Interfaces for Applications with Update Capabilities
  22. 17. AIR Application Distribution with the Browser API
    1. Including the Browser API
    2. Detecting the Installed Version of AIR
    3. Launching an AIR Application from the Browser
    4. Installing an AIR Application from the Browser
    5. Using the Included Seamless Install Badge
  23. Index
  24. About the Authors
  25. Colophon
  26. Special Upgrade Offer
  27. Copyright