Among the language and runtime enhancements in AIR 3 are a variety of new classes, methods, properties, and architectures whose aim it is to make things easier, extensible, and faster in regard to the runtime and its usage. In this chapter, we will have a look at the variety of language and runtime improvements along with general implementation examples that can be easily built upon for a variety of projects.
With the release of AIR 2, developers were given the option in desktop AIR to interface with native processes on the host operating system. This was great, as it meant that an AIR application could be somewhat extended by passing messages back and forth between the application and a running process. It wasn’t ideal though, and wasn’t available for mobile AIR projects.
Now, with AIR 3 we have something much more powerful at our disposal: ActionScript Native Extensions (ANE). This new functionality allows a developer to write the bulk of an application in ActionScript but also provide a portion of it in the language of the native operating system in order to extend the AIR runtime itself, providing hooks into hitherto untouchable possibilities.
Note that the bulk of the code will more than likely be written in a language other than ActionScript!
For example, while the AIR runtime has native support for sensors like the accelerometer on iOS or Android…it does not provide any way of tapping into a gyroscope, barometer, ...