JPEG-XR Support

AIR 3 includes expanded support for still image file formats. Previous versions of AIR include support for the following image file formats: GIF, JPEG, and PNG – with any other files relying upon external code libraries for interpretation. The recent addition of JPEG-XR (International Standard ISO/IEC 29199-2) brings a new image file format to AIR which boasts more efficient compression than JPG, along with both lossy and lossless compression options. Like the PNG format, JPEG-XR also includes a full alpha channel.

Note

You may be wondering how to generate JPEG-XR files, since many popular tools (including Adobe Photoshop) do not support the export or conversion to .JXR natively. I’ve found the Windows-only tool Paint.NET (http://paint.net/) along with the JPEG XR plugin (http://pdnjpegxrplugin.codeplex.com/) to be most useful in converting images to JPEG-XR.

Many conversion programs actually leave out certain bytes which are necessary for the file to load into the runtime, due to security concerns.

JPEG-XR Support

Figure 2-2. JPEG-XR Support

To load a JPEG-XR file into AIR, you perform the same set of actions that are necessary for any external image to be loaded into a project:

package { import flash.display.Loader; import flash.display.Sprite; import flash.events.Event; import flash.events.ProgressEvent; import flash.net.URLRequest; import flash.text.TextField; import flash.text.TextFormat; ...

Get What's New in Adobe AIR 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.