3.0 Lesson Eight: Controlling
Movie Clips 2
In actionscript 3.0 if you want to edit how the movie
clip reacts inside a Movie Clip you can add functions
to your document. I will provide an example and you
can place the code in any actionscript 3.0 document's
frame. Some Actions are gotoAndStop, gotoAndPlay, stop
actions and next frame actions, previous frame actions,
and play actions. I will provide examples in the code
below. You can place the code inside the movie clip
or outside the movieClip. If you place the code out
side of the movieClip you need to tell what movie clip
you want the action to run in. In this example I will
name the movieClip "myMovieClip", without quotes.
Here is the code.
//on Frame 1...
//outside on a frame
The Breakdown. In the first code you are placing the
code on a frame, and when the frame reaches that frame
it will execute the code. In this example the movie
clip will stop on frame 1. OutSide of the variable you
need to tell the program what you are going to modify
(a movie clip), and it will be on the root timeline,
and ofcourse we are editing inside of myMovieClip, and
it will execute the action of stopping at frame 5 inside
of that movieClip.