| Programming ActionScript 3.0 > Overview of ActionScript Programming > Display Programming > Understanding the display architecture | |||
Each application built with ActionScript 3.0 has a hierarchy of displayed objects known as the display list. The display list contains all the visible elements in the application. Display elements fall into one or more of the following groups:
The Stage is the base container of display objects. Each application has one Stage object, which contains all onscreen display objects. The Stage is the top-level container and is at the top of the display list hierarchy:
Each SWF file has an associated ActionScript class, known as the main class of the SWF file. When you embed a SWF file in an HTML page, Flash Player calls the constructor function for that class and the instance that is created (which is always a type of display object) is added as a child of the Stage object. The main class of a SWF file always extends the Sprite class (for more information, see Core display classes).
You can access the Stage through the stage property of any DisplayObject instance. For more information, see Setting Stage properties.
In ActionScript 3.0, all elements that appear on screen in an application are types of display objects. The flash.display package includes a DisplayObject class, which is a base class extended by a number of other classes. These different classes represent different types of display objects, such as vector shapes, movie clips, and text fields, to name a few. For an overview of these classes, see Core display classes.
Display object containers are special types of display objects that can contain child objects that are also display objects.
The DisplayObjectContainer class is a subclass of the DisplayObject class. A DisplayObjectContainer object can contain multiple display objects in its child list. For example, the following illustration shows a type of DisplayObjectContainer object known as a Sprite that contains various display objects:
In the context of discussing display objects, DisplayObjectContainer objects are also known as display object containers or simply containers.
Although all visible display objects inherit from the DisplayObject class, the type of each is of a specific subclass of DisplayObject class. For example, there is a constructor function for the Shape class or the Video class, but there is no constructor function for the DisplayObject class.
As noted earlier, the Stage is a display object container.
Flex 2.01
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flex/201/html/05_Display_Programming_162_02.html