2007年3月27日星期二

Display Objects

Display Objects

ActionScript 3 now has a new collection of "display objects" which includes those objects that can be seen on the screen or added to the "display list." This goes beyond the simple movie clip, button, and text field objects that ActionScript had access to before. AS3 display objects include

  • AVM1Movie
  • Bitmap
  • Loader
  • MorphShape*
  • MovieClip
  • Shape
  • SimpleButton
  • Sprite
  • StaticText*
  • TextField
  • Video

*Are for referencing pre-existing objects existing on the timeline; you cannot create them via AS.

AVM1Movie represents a movie created with ActionScript 1 or 2. Those movies use ActionScript Virtual Maching 1 where AS3 movies use AVM2. AVM2 movies can play AVM1 movies, but cannot interact with them (their ActionScript) using AS3.

Bitmaps are bitmap objects. You can specify their imagery with BitmapData objects or they can be bitmaps from files.

Loader objects are display objects that load external content into them. This content can be images or other SWF movies.

MorphShapes are shape tweens created in the timeline. Though you cannot create them in ActionScript, you can access those that exist on the timeline already using ActionScript and they are of the type MorphShape.

MovieClips are the movie clips you know and love.

Shapes are stripped down movie clips that essentially only contain a graphics object for drawing in with the vector drawing API. Using Shapes instead of MovieClips or Sprites can help conserve memory

Sprite objects are essentially movie clips without timelines. This is your most common display object in AS3 and usually the one extended when creating your own display object subclasses.

StaticText, like MorphShapes, cannot be created with ActionScript instead referening static text objects that are pre-existing on the Flash timeline.

TextField objects include dynamic and input text.

Video objects represent Flash video.

0 评论: