MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 612

Actionscript language reference
Table of Contents

Advertisement

Example
The following example logs the reference to a movie clip and its relationship to the main
Timeline. Create a movie clip with the instance name
Add the following 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 writes to the log file.
You clicked the movie clip: _level0.my_mc
The parent of my_mc is: _level0
See also
_root, targetPath(),
MovieClip.play()
Availability
Flash Player 5.
Usage
my_mc.play() : Void
Parameters
None.
Returns
Nothing.
Description
Method; 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.
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();
};
612
Chapter 7: ActionScript for Flash
TextField._parent
on the main Timeline:
my_mc
on the main Timeline that plays a movie clip called
my_btn
, and add it to the main Timeline.
my_mc

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex

Table of Contents