Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com�s entire library of video tutorials.
The ease with which ActionScript can create, control and display a variety of graphic elements as a project is running and in response to user actions and other events is what makes it so worth learning and mastering. ActionScript can create and manipulate movie clips, buttons, music, videos, shapes and even masks. It can modify the properties that control how these objects appear including the color, position, scale, rotation, transparency and much, much more. Flash also provides methods for controlling an object's behavior, making it possible to develop immersive games or online shopping experiences where users can pick up and manipulate and interact with game objects or store merchandise. This ability to control display graphics in Flash while the movie is playing back gives you, as the author, a very powerful tool for creating the types of interactivity that web audiences now expect and will reward you for. So in this Section of the tutorial I'll be reviewing scripts for creating and manipulating graphic objects dynamically so that they appear on the Stage during playback and then Change Properties based on user interactions or choices. In previous versions of ActionScript much of the work of displaying graphics relied on the movie clip object because the movie clip was the focal point of the Flash renderer. Every SWF movie contained a root movie clip, commonly referred to as the Stage, however, the rendering model for ActionScript 3.0 and Flash Player 9 is very different. It centers on something called the Display List, this focuses on the classes available in the Flash.display package. The display list is the hierarchy of display objects that will be rendered as visible screen content by the Flash Player. As this diagram demonstrates, the Stage is the root of the display list and all of the display objects that are attached to the Stage or one of its children from the display list and that is even if the object isn't actually rendered, for example if it's outside the boundaries of the Stage. Now any object not on the display list will not be drawn by the renderer. Each SWF movie contains exactly one display list which is comprised of three types of elements: the Stage, the display objects and the display object Containers. The Stage is the root of the display list hierarchy. Every movie has a single Stage object that contains the entire object hierarchy of everything displaying on all the screens. In ActionScript 3.0 the Stage is a container that typically contains only a single child, the main application class of the SWF movie. You access the Stage by referring to the Stage property on any display object in the display list. A display object is a visual element. Some classes function as both display objects and display object containers, such as the movie clip, while other classes are only display objects such as the text field. All display object classes are subclasses of the display object class. After a display object is created it won't appear on the screen until it's added into a display object container. A display object container is an object that is capable of containing child display objects. The Stage is an example of a display object container. Other display object containers include: sprites, movie clips and shapes. When a display object container is removed from the display list, all of its children are removed as well. Now the most common graphic task in Flash is adding a display object to this display list. To do that you create the child display object and then add it to a display object container by calling the container's addChild method. You've seen it several times already in the scripts presented in this tutorial Here in our Preloader remember we're adding the SWF file that we're loading onto the Stage using the addChild myloader method. By default, the display object is added to the front of the container's children. If you want to insert it somewhere else in the stack of child objects you can use the addChildAt method instead. That would be written like this addChildAt. Now another task you'll need to commonly perform is to remove a display object from the display list. To remove a display object from a container's child list you'll call the container's removeChild method, passing the display object to remove as a parameter. We've also seen an example utilizing this method to remove a display object from the Stage. Here in this example, in our Preloader2 example, we're removing the Preloader bar, the background and the dynamic text field from the Stage after the main SWF file has downloaded using the removeChild method right there and then again in the parameter, is the display object that we want to remove, the bar movie clip, the background movie clip, the text field and so on. The display list model contains core classes that revolve around the display object class and I'll be reviewing these Flash display classes in the next movie.
| Course: | Adobe Flash ActionScript 3.0 for Designers |
| Author: | James Gonzalez |
| SKU: | 34060 |
| ISBN: | 1-935320-82-3 |
| Release Date: | 2009-11-09 |
| Duration: | 9.5 hrs / 101 lessons |
| Work Files: |
Yes |
| Captions: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |