Programming an AIR Application
In this section, we'll use ActionScript to tie all of our interface components together into a unified application. ActionScript is similar to JavaScript in some ways (they are both based on ECMAScript), but very different in other ways, since both are derived from different branches of the specification.
While we could write all of our ActionScript code using frame scripts, it is better to leverage the Object-Oriented Programming (OOP) features that are so prominent in the language and create a Document Class.
Establishing a Document Class
We'll now create a document class and bind it to our .fla
document. The document class will exist as a .as
file separate from the .fla
file. When you use a document class for your project, it must extend either the MovieClip
or Sprite
classes, depending upon whether you require animation or not in your main document timeline. Extending one class with another will give you access to all the functionality...