Chapter 13. How Do I Work with the Display List?
The new display architecture is one of the two biggest ActionScript changes in version 3.0. (The other biggest change comes in the form of the new event model, which the next chapter covers.) In this chapter, you’ll learn the basics of displaying content, which have been simplified over prior versions of ActionScript in a few ways.
To begin with, presenting visual assets to the user has become much
more consistent. Previous ActionScript versions gave you a handful of
different ways to display a movie clip, for example, and many more when
factoring in the display of all types of visible assets. In ActionScript
3.0, however, all visual assets are displayed in the same general manner:
create the asset (if necessary) using the
new keyword, and then add it to the
The display list is a type of linear array (although with its own access methods) of objects that the user can see. In simple terms, an empty SWF file has an empty display list, a SWF file with a single movie clip has a display list that contains one item, and so on. (More accurately, each SWF file includes the stage and main timeline at the root of the display list, but you can’t remove these, and so they’re not included as list indices.)
Although the display list can contain only objects with visual data, you can create such a display object without adding it to the display list. That is, a sound can’t be a display object because you can’t see it, ...