Play (Movieclip.play Method) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

Example
The following example traces the reference to a movie clip and its parent timeline. Create a
movie clip with the instance name
ActionScript to your FLA or AS file:
my_mc.onRelease = function() {
trace("You clicked the movie clip: "+this);
trace("The parent of "+this._name+" is: "+this._parent);
}
When you click the movie clip, the following information appears in the Output panel:
You clicked the movie clip: _level0.my_mc
The parent of my_mc is: _level0
See also
_parent (Button._parent property)
_parent (TextField._parent property)

play (MovieClip.play method)

public play() : Void
Moves the playhead in the timeline of the movie clip.
You can extend the methods and event handlers of the MovieClip class by creating a subclass.
Availability: ActionScript 1.0; Flash Player 5
Example
Use the following ActionScript to play the main timeline of a SWF file. This ActionScript is
for a movie clip button called
stop();
my_mc.onRelease = function() {
this._parent.play();
};
Use the following ActionScript to play the timeline of a movie clip in a SWF file. This
ActionScript is for a button called
:
animation_mc
animation_mc.stop();
my_btn.onRelease = function(){
animation_mc.play();
};
, and add it to the main timeline. Add the following
my_mc
,
_root property
on the main Timeline:
my_mc
on the main Timeline that plays a movie clip called
my_btn
,
targetPath function
MovieClip
,
913

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF