The Document Class in the Flash IDE, or Main Application File in Flex Builder and Flash Builder, is a special class that contains a constructor, which will be called by the SWF file once it's loaded. You could say that the constructor inside your document class will be the entry point of your application. The document class requires that it is an extended Sprite
or MovieClip
, or any other class type that inherits from either of these objects.
Note
For the sake of simplicity, this book refers to the document class and not to the main application file. Although their names differ, their usage is exactly the same.
Also note that a synonym for main application file is Application Class.
Flex Builder and Flash Builder have the same workflow to get the document class up and running. However, the Flash IDE takes another approach. Let's start by explaining how it is done in the Flash IDE.