Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual page 171

Programming actionscript 3.0
Table of Contents

Advertisement

Recall that a display object that is off the display list—one that is not included in a display
object container that is a child of the Stage—is known as an off-list display object.
Traversing the display list
As you've seen, the display list is a tree structure. At the top of the tree is the Stage, which can
contain multiple display objects. Those display objects that are themselves display object
containers can contain other display objects, or display object containers.
Stage
Stage
Instance of
the main class of
the SWF file
Display Object
Display Object
Container
Display Object
Container
Display Object
The DisplayObjectContainer class includes properties and methods for traversing the display
list, by means of the child lists of display object containers. For example, consider the
following code, which adds two display objects,
(which is a Sprite, and the Sprite class extends the DisplayObjectContainer class):
var container:Sprite = new Sprite();
var title:TextField = new TextField();
title.text = "Hello";
var pict:Loader = new Loader();
Display Object
Container
Display Object
Display Object
Container
title
and
, to the
pict
container
Working with display objects
object
171

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents