Key
Points about Flash MX Movie Clip Actions.
- Point one
- Point two
- Point three
- Point four
|
Flash MX Movie Clip Actions...
Action
Parameters
Button
Actions
Pr 1
You've just placed Actions in keyframes, now let's see how they work with Movie
Clips.
Actions on Movie Clips are powerful, you'll have to fully study this feature to really learn it, but you can get a taste of it in a practice session on this page. There are books written only for ActionScripts, so you can expect to spend some time learning how to use them in the future.
Place Actions On A Movie Clip Instance
Place Actions On A Movie Clip Instance
- Choose Window > Scene (Shift F12), and add a new scene, rename
this scene MyAnimation. Create a Movie Clip inside the new
scene that contains several frames and some kind of animation
inside the clip (so we can see whether it's playing).
Scene 1 should remain empty for now.

- Click on Scene One, there should only be one keyframe in this scene. Open
the Library to find your Movie Clip.
- Drag this Movie Clip onstage and test the movie (to verify it's
animating). Remember your main timeline should have only one frame.
- Back in Flash, select the instance of the Movie Clip onstage
and open the Actions panel. notice that almost all the Actions in
the Toolbox List are available (that is, they're not grayed out).
- From the plus button select Actions > Movie Control > Stop.
Notice that Actions attached to Movie Clip instance have to be wrapped inside
an onClipEvent.
The default clip event
is load,
so you should see something like the following image.

- Test the movie now and, when the Movie Clip loads, it stops.
Another way to create the same effect is to put a stop
Action on the first keyframe inside the master Movie Clip.
There is nothing really wrong with the above technique,
but a stop inside the master Movie Clip means every instance will exhibit
this behavior. Placing the Action on one instance, affects just that one
instance.
You will add two more Actions that respond to the mouse down and
mouse up events. When the user clicks (mouse down), the Movie
Clip should start to play. When he stops clicking (mouse up), the
Movie Clip should stop.
TIP: If the line currently selected in your script is
within the curly braces, you won't be adding another clip event, because
you can't put an event inside an event. Remember: Every time you add an
Action, Flash will try to put the Action right below the line currently
selected in your script.
- Drag the onClipEvent
script (from the Toolbox section under Actions, Movie Clip Control)
below the ending curly brace.
(Note: You could have selected the last line and then
select the plus button, Actions, Movie Control, onClipEvent as well, it's
your choice on how to add these Action.)
- Before you add more clip
events, drag a stop
Action to appear right underneath the first line in the clip
event you added in the last step. To add more clip events, drag a play Action
(from the Toolbox section) below the last line in your script. It
will automatically be wrapped inside an onClipEvent
load script.
- The way your script is written now doesn't make a whole lot of sense because
you have three versions of onClipEvent
(load). Leave the first one you created alone. Click the first
line of the second event (the one with stop inside). With this line
selected, you can change the parameters of the clip event to respond to
mouse up
instead of load.
The last event should start with a clip event of mouse
down. (Check your script against the image below.)
- Test the movie. It's actually pretty sophisticated, despite the simplicity
of the script. Go back and re-read the script to see for yourself.
Hide Practice Session
1
There are a few important things to note about this session. First, the clip
events mouse down and mouse up respond to any mouse clicknot
just clicks on the clip itself. If you want something that responds to clicks
right on a graphic, using a regular button is easiest. (That's the topic
of the next page.)
The basic things to remember are that just like buttons, Actions on clip instances
are wrapped inside events. Buttons respond to the on
event while Movie Clips respond to the onClipEvent.
Finally, Actions attached to clip instances affect only the particular instance
to which they're attached.
Action Parameters
Back to Contents
Button Actions
Top
Page Updated on
March 2, 2003