Advantages of the ActionScript 3.0 display list
approach
In ActionScript 3.0, there are separate classes for different types of display objects. In
ActionScript 1.0 and 2.0, many of the same types of objects are all included in one class: the
MovieClip class.
This individualization of classes and the hierarchical structure of display lists have the
following benefits:
More efficient rendering and reduced memory usage
■
Improved depth management
■
Full traversal of the display list
■
Off-list display objects
■
Easier subclassing of display objects
■
These benefits are described in the next sections.
More efficient rendering and smaller file sizes
In ActionScript 1.0 and 2.0, you could draw shapes only in a MovieClip object. In
ActionScript 3.0, there are simpler display object classes in which you can draw shapes.
Because these ActionScript 3.0 display object classes do not include the full set of methods
and properties that a MovieClip object includes, they are less taxing on memory and processor
resources.
For example, each MovieClip object includes properties for the timeline of the movie clip,
whereas a Shape object does not. The properties for managing the timeline can use a lot of
memory and processor resources. In ActionScript 3.0, using the Shape object results in better
performance. The Shape object has less overhead than the more complex MovieClip object.
Flash Player does not need to manage unused MovieClip properties, which improves speed
and reduces the memory footprint the object uses.
Improved depth management
In ActionScript 1.0 and 2.0, depth was managed through a linear depth management scheme
and methods such as
ActionScript 3.0 includes the DisplayObjectContainer class, which has more convenient
methods and properties for managing the depth of display objects.
164
Display Programming
getNextHighestDepth()
.