O'Reilly logo

Adobe AIR 1.5 Cookbook by Koen De Weggheleire, Koen DeWeggheleire, Marco Casario, David Tucker, Rich Tretola

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 14. File Types

When a file type is associated with your AIR application, then every associated file of that type will open itself in your AIR application. This gives you great opportunities to work with external files in your AIR application. Registering Custom File Types discusses how to register a file type with your AIR application.

Before you begin, you should note that you make associations for an AIR application when installing the application, not at compile or debug time. This means you can’t test file associations until you package and install your application. When your application is packaged, the application descriptor XML file is read, and the file associations are set. This is not automatically done if another application on the system is already the default application; in other words, the AIR application install process does not override an existing file type association. If you want to take over the association from another application, take a look at Setting and Removing an Application as the Default Application for a File Type.

Registering Custom File Types

Problem

You want to register a custom file type so that the operating system will associate it with your AIR application.

Solution

Use the fileTypes element in the application descriptor file to declare the file types associated with your AIR application.

Discussion

Associations between your application and a file type must be declared in the application descriptor file. Depending on your environment and compiler ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required