EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Page 353

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
About controlling movie clips with ActionScript 353
In the first statement, play() moves the playhead in the myMovieClip instance. In the
second statement,
gotoAndPlay() sends the playhead in childClip (which is a child of the
instance
parentClip) to Frame 3 and continues to move the playhead.
Global functions that control a timeline have a
target parameter that let you specify the
target path to the instance that you want to control. For example, in the following script
startDrag() targets the instance the code is placed on and makes it draggable:
my_mc.onPress = function() {
startDrag(this);
};
my_mc.onRelease = function() {
stopDrag();
};
The following functions target movie clips: loadMovie(), unloadMovie(),
loadVariables(), setProperty(), startDrag(), duplicateMovieClip(), and
removeMovieClip(). To use these functions, you must enter a target path for the functions
target parameter to indicate the target of the function.
The following MovieClip methods can control movie clips or loaded levels and do not have
equivalent functions:
MovieClip.attachMovie(), MovieClip.createEmptyMovieClip(),
MovieClip.createTextField(), MovieClip.getBounds(),
MovieClip.getBytesLoaded(), MovieClip.getBytesTotal(), MovieClip.getDepth(),
MovieClip.getInstanceAtDepth(), MovieClip.getNextHighestDepth(),
MovieClip.globalToLocal(), MovieClip.localToGlobal(), MovieClip.hitTest(),
MovieClip.setMask(), MovieClip.swapDepths().
For more information about these functions and methods, see their entries in the ActionScript
2.0 Language Reference.
For an example of scripted animation in Flash, you can find a sample source file,
animation.fla, in the Samples folder on your hard disk.
In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript\Animation.
On the Macintosh, browse to Macintosh HD/Applications/Macromedia Flash 8/Samples
and Tutorials/Samples/ActionScript/Animation.

Table of Contents

Related product manuals