Chapter 12. Understanding the Flash Player 9 Display List
Introduction
In this chapter
Understanding the display list
Using the DisplayObject and DisplayObject Container
Creating a User Interface element with Sprite
Introducing the Graphics Object
Working with the Stage
Working with the MovieClip
Examples using the display list
One of the biggest updates between ActionScript 2.0 and ActionScript 3.0 and Flash 8 and Flash 9 is the way that you can create new graphics and handle the graphics you've already created. In order to fully understand the differences between ActionScript 2.0 and ActionScript 3.0, you need to look at the following commonplace code:
var myMovieClip:MovieClip = → _root.attachMovie(libraryNameString);
You want to create a movie that has some drawings in it, so you create a reference to what you've just attached to the Stage, and use that to call methods and access properties of what we've just attached. Seems a little strange right? As it should. What ActionScript 3.0 enables you to do is instantiate and work with the clips in a far more streamlined way. Although to the practiced ActionScript 2.0 developer much of what you're about to look at will seem very strange, it will ultimately make your life better in deep and wonderful ways. So say good‐bye to createEmptyMovieClip()
, you're going to get a whole new way to program all of your graphics in Flash.
Display List
The display list has been around for a while. You could always access all the graphic objects present on ...
Get ActionScript™ 3.0 Bible now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.