Accessibility
Marco Casario

Marco Casario

Created:
2 June 2008
User Level:
Intermediate
Products:
Flex

Flex Solutions excerpt: Migrating Flex applications onto the desktop with Adobe AIR

One of the characteristics of rich Internet applications (RIAs) developed with Flex is that they actually act as client-side applications. In fact, an RIA, after having been requested by users by launching the URL on a common browser, is downloaded onto the client and resides on the client for its entire life cycle. The interfaces created for RIAs are very rich and user-friendly, and many of the operations you use for desktop applications can also be developed for this type of application. For example, in Solutions 7-6 and 7-7, you saw that the classic operations of drag and drop are simple and quick to manage. The difference between a client-side application and a desktop application is small. The main reason why an RIA cannot be considered a desktop application is that it is loaded and run within the Flash Player that is a plug-in of the browser. This difference prevents the developer from using some of the functions that are native to desktop applications and very useful for most projects. The access to the file system to load, save, and edit local files, and the possibility of changing the appearance of the windows of the operating system are impossible because of the nature of RIAs.

Flex Builder 3 permits you to export the applications in Adobe Integrated Runtime (AIR) format, the new format from Adobe for loading RIAs outside of the browser and launching them as desktop applications.

Adobe AIR is a system of runtime cross-platforms (independent of the operating system) that permits developers to bring their knowledge of creating RIAs for the web (Flash, Flex, HTML, JavaScript, Ajax) onto the desktop. The Adobe AIR project has the objective of bringing web applications from the web to the desktop in a way that merges the best characteristics of both development worlds.

Therefore, developers can migrate their applications created for the web and render them usable offline, meaning they can also use functions such as access to the file system and support of system window programming. And all this is in a context that is completely independent of the operating system. Adobe AIR will, in fact, be available for Windows, Mac OS X, and Linux environments.

Developing and exporting a desktop application using Adobe AIR is very simple and does not require learning a new language or development environment. In fact, Adobe AIR can run software created using Flex, Flash, or HTML/JavaScript technologies, enabling them to use all the features of a classic desktop application.

Creating an AIR project from Flex Builder in plug-in mode

Figure 1. Creating an AIR project from Flex Builder in plug-in mode

This chapter covers the following topics:

  • Exporting a Flex application for the desktop
  • Customizing OS windows using the AIR Window API
  • Accessing the file system
  • Reading and writing persistent data on local file system
  • Embedding HTML pages into desktop applications
  • Creating occasionally connected applications
  • Keeping the application updated

Requirements

In order to make the most of this article, you need the following software and files:

Flex Builder 3

Adobe AIR

Prerequisites

Some knowledge of Flex and AIR.

Read the complete chapter

Chapter 14: Migrating Flex applications on the desktop with Adobe AIR (PDF, 1 MB)

About the author

Marco Casario has been passionate about informatics since he was little more than a child and used to program games in Basic for Commodore 64, before dedicating himself—while still very young—to innovative projects for the web using Adobe Flash and Adobe Director (as far back as versions 3 and 5). In 2005, he founded Comtaste, a company dedicated to exploring new frontiers in rich Internet applications and the convergence between the web and the world of mobile devices. Marco was a technical editor for Apress, Friends of ED, and Wrox for such books such as Flash 8 Essentials, Professional Adobe Flex 2, and Foundation Flash Applications for Mobile Devices.