Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual page 183

Programming actionscript 3.0
Table of Contents

Advertisement

Controlling ActionScript 3.0 movie clips
Each MovieClip object has a timeline, and also includes properties and methods for
controlling the playhead and working with frames and scenes.
Many properties and methods of the ActionScript 1.0 and 2.0 MovieClip class are present as
properties or methods of the ActionScript 3.0 MovieClip class. Some are inherited from a
superclass. For example, the
name a few, are valid for the MovieClip class because it extends the DisplayObject class.
However, some properties that had names that begin with the underscore character, such as
,
,
, have been renamed without the underscore in ActionScript 3.0. Also, the
_x
_y
_root
,
,
_xmouse
_xscale
_ymouse
, and
.
mouseY
scaleY
The MovieClip class includes methods and properties for controlling the movie clip. The
following properties let you monitor the total number of frames and scenes in a movie clip
and monitor information about the frame and scene at the current playhead position:
,
currentFrame
currentLabel
The following methods let you control the playhead for the movie clip:
,
gotoAndStop()
nextFrame()
.
stop()
For example, the following code moves the playhead to the first frame of the current scene of
the
MovieClip object:
myMovie
myMovie.gotoAndPlay(0);
For more information on these and other properties and methods, see the MovieClip section
of the ActionScript 3.0 Language Reference.
You can set the frame rate for all movie clips in an application using the
of the Stage object.
In contrast to ActionScript 1.0 and 2.0, a loaded SWF file in ActionScript 3.0 can be a
MovieClip object, an AVM1Movie object, or a Sprite object. However, in ActionScript 3.0
you can control the timeline only of a MovieClip object. Sprite and AVM1Movie objects do
not include timeline-related methods and properties.
,
, and
x
y
blendMode
, and
properties have been renamed
_yscale
,
,
currentLabels
,
,
nextScene()
play()
Basics for working with the core display classes
properties of the DisplayObject class, to
,
currentScene
scenes
,
,
prevFrame()
,
,
mouseX
scaleX
, and
totalFrames
,
gotoAndPlay()
, and
prevScene()
property
frameRate
183
.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents