flash display_list
Display list
When an animation is loaded in Flash player, it is automatically added to the main stage of the SWF as first child of the main container, the Stage. This hierarchy defines what we call the display list of the application.
Here is a diagram illustrating the display system of Flash player:
In order to understand how the display list is organized, create a new CS3 Flash document and test the following code on the main timeline:
// display : [object MainTimeline] trace( this ); // display : [object Stage] trace( this.parent );
When calling the keyword this, we make reference to our main timeline the MainMovie contained by the Stage object.
Beware, the Stage object is no longer accessible in a global way as it was in ActionScript 1 and 2. The following code generates a compilation code:
trace( Stage );
To make reference to the Stage object we have to go via the stage property of a DisplayObject present in the display list:
myDisplayObject.stage
To get the number of display objects contained in a DisplayObjectContainer object type we use the numChildren property.
To get the number of display objects contained by the stage object we write:
// display : 1 trace( this.stage.numChildren );
Or in a more implicit manner:
// display : 1 trace( stage.numChildren );
We will come back to the access to this property which merits particular investigation.
Our Stage object contains one child only, our main timeline, the MainMovie. When an empty SWF is read, two DisplayObjects are present by default in the display list:
- The Stage object
- The SWF timeline, the MainTimeline object
As illustrated, each ActionScript 3 application has a single Stage object and therefore a single display list. You should consider the Stage object as the main knot of the display list. In reality it can be represented by an XML site structure, a main node from which other child-nodes stem, the display objects. When we place an occurrence of a button on the main stage of our animation, we get the following display list:
We will see in the chapter Document class how to replace the Main Movie class by a personalized visual sub-class.
Until now we hadn’t created visual objects through development. ActionScript 3 integrates a new more efficient procedure of visual class instancing that we will now investigate.
Worth remembering
- The Stage object is no longer accessible in a global way
- We access the *Stage object through the stage property for al DisplayObjects**
Mediabox Training Centre © 2000 - 2008 All rights reserved.
Adobe Authorized Training Centre. State convention under number 25 14 02167 14.
Mediabox : SARL au capital de 62.000€ - Activity number: 25 14 02167 14 - SIRET : 493 716 468 00027
MEDIABOX, 102 Avenue des Champs Elysées, 75008 PARIS - Tel. +33(0)2.31.91.96.89 - Fax. +33(0)2.72.68.56.42



