Developer Guide
Loading and controlling external SWF files, including files created for previous Flash Player versions
Building an ActionScript system for creating graphical assets to be loaded and used at run time
Important concepts and terms
The following reference list contains important terms used in this chapter:
AVM1 SWF: A SWF file created using ActionScript 1.0 or ActionScript 2.0, usually targeting Flash Player 8 or
AVM2 SWF: A SWF file created using ActionScript 3.0 for Adobe Flash Player 9 or Adobe AIR.
External SWF: A SWF file that is created separately from the project SWF file and is intended to be loaded into
the project SWF file and played back within that SWF file.
Frame: The smallest division of time on the timeline. As with a motion picture filmstrip, each frame is like a
snapshot of the animation in time, and when frames are played quickly in sequence, the effect of animation is
Timeline: The metaphorical representation of the series of frames that make up a movie clips animation
sequence. The timeline of a MovieClip object is equivalent to the timeline in the Flash authoring tool.
Playhead: A marker identifying the location (frame) in the timeline that is being displayed at a given moment.
Working with MovieClip objects
When you publish a SWF file, Flash converts all movie clip symbol instances on the Stage to MovieClip objects. You
can make a movie clip symbol available to ActionScript by giving it an instance name in the Instance Name field of
the Property inspector. When the SWF file is created, Flash generates the code that creates the MovieClip instance
on the Stage and declares a variable using the instance name. If you have named movie clips that are nested inside
other named movie clips, those child movie clips are treated like properties of the parent movie clip—you can access
the child movie clip using dot syntax. For example, if a movie clip with the instance name
childClip is nested within
another clip with the instance name
parentClip, you can make the child clips timeline animation play by calling
this code:;
Note: : Children instances placed on the Stage in the Flash authoring tool cannot be accessed by code from within the
constructor of a parent instance since they have not been created at that point in code execution. Before accessing the
child, the parent must instead either create the child instance by code or delay access to a callback function that listens
for the child to dispatch its
Event.ADDED_TO_STAGE event.
While some legacy methods and properties of the ActionScript 2.0 MovieClip class remain the same, others have
changed. All properties prefixed with an underscore have been renamed. For example,
_width and _height
properties are now accessed as width and height, while _xscale and _yscale are now accessed as scaleX and
scaleY. For a complete list of the properties and methods of the MovieClip class, consult the ActionScript 3.0
Language and Components Reference.

Get ADOBE® FLEX® 3: PROGRAMMING ACTIONSCRIPT™ 3.0 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.