Core Display Classes Illustration in Flash CS3
插图为Flash CS3 的核心Display 类的继承关系的图。
- DisplayObject: At the top of the hierarchy, this class provides the basic properties for all visual items in the display list, such as x, y, width, and height. Everything in the display list is an instance of one of the classes that extends the DisplayObject class, either directly or indirectly.
- InteractiveObject: This class adds various properties, methods, and events that allow users to interact with display objects using the mouse and keyboard. You’ll learn more about events and how to allow users to interact with display objects.
- DisplayObjectContainer: This class gives display objects the ability to contain other display objects, which can be manipulated using methods like addChild() and removeChild(). Other display list classes allow a specific number of child display objects. A good example is SimpleButton, which allows you to specify a different display object for each of the button states, but only DisplayObjectContainer instances allow you to have an open-ended number of child display objects.
- Sprite: This is a new type of object available with ActionScript 3.0, and there is no equivalent in the IDE. Basically, it is like a movie clip without a timeline, so it doesn’t contain any of the timeline controlling ActionScript necessary with MovieClip instances. You can still draw into it, add new display objects to it, and code for interactivity, but it is lighter weight in memory than a movie clip. It is the best bet if you are programmatically creating interactive graphics in your applications.
- MovieClip: This class adds the concept of frames, frame labels, and scenes, with all the properties and methods you need to query and manipulate the playhead. Note that while you can create MovieClip objects programmatically, you cannot add frames, labels, or scenes with ActionScript code.
以上说明摘录至【Foundation ActionScript 3.0 with Flash CS3 and Flex】
尚无评论
