User Guide

Working with display objects 171
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 youve 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.
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,
title and pict, to the container object
(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
Display Object
Container
Instance of
the main class of
the SWF file
Stage
Stage
Display Object
Container
Display Object
Display Object