ActionScript 3.0 Display Lists and Display Objects
|
|
|
|
| Articles Reviews Actionscript | |
| Written by Tibor Gyorgy Ballai | |
| Thursday, 29 March 2007 | |
|
One of the biggest changes in ActionScript 3.0 is the way Flash renders (or rather manages rendering of) visual assets. Previously, you'd had to attachMovie() from the library, createEmptyMovieClip() or createTextField(). But all of these were methods of existing movie clips.
So if you wanted to create a new visual asset, you had to start with a defined movie clip and that asset would be bound to that clip until it was destroyed. It would also automatically be added to the rendering engine. If you wanted to create a new MovieClip on the root and then drag and drop it into another MovieClip (say a window that you could drag around), you'd have to remove the MovieClip from its origin and recreate it in the target. On top of this, there was the issue of depth management. MovieClip.getNextHighestDepth() helped depth management, but if you were using v2 components, getNextHighestDepth() often conflicted, creating headaches that I'm not going to rehash here. At the same time, you can create DisplayObjects that exist as data objects but are not necessarily added to the Display List and therefore are not even considered by the rendering engine. This means if you have something like a slide show, you may have 100 Bitmap DisplayObjects, but are only showing one or two at a time, saving resources as the rendering engine only has to consider the objects currently in the Display List. Also, at any point, you can re-parent (change the scope of a DisplayObject) by adding it as a child of another DisplayObjectContainer. Best of all, the Display List pretty much makes depth management a thing of the past. But DisplayObjects can also be Interactive Objects like SimpleButtons TextFields and DisplayObjectContainers. Among DisplayObjectContainers are the objects that can contain child DisplayObjects such as Loader, Sprite and Stage. On the bottom of the hierachy is the resource heavy, but familiar MovieClip. The chain of inheritance among DisplayObjects looks like this: Powered by jReviews |
|
| Last Updated ( Thursday, 03 January 2008 ) | |
| < Prev | Next > |
|---|







