Taking this previous example one step further, let us apply the
Load Movie command to a button, so we can choose when to load the
animation. So, in this example, the movie waits until the user clicks
the Load button to load the animation.
To add the Load Movie action to a button, select the button and
view the Actions window. Under
"Basic Actions", select "On MouseEvent". I have chosen On Release,
meaning that this action is executed on mouse up. Then, select the
Load Movie command in the same Basic Actions list and fill in the
appropriate information at the bottom of the Actions window.
Once
the user clicks the "Load" button, the Flash player runs the Load
Movie command and then proceeds to the frame "unload" as indicated
by the ActionScript. Now, the button changes to "Unload" and now
has an "Unload Movie Clip" command. The Unload Movie command is
directly beneath the Load Movie command in the Basic Actions list.
All you have to do is enter the target. Click the "Unload" button
in the SWF, and you will notice the animation disappear.
Loading
Multiple SWFs Button
Action -- Load Multiple SWFs into Multiple Movie Clips
Building directly on top of the previous example, let's say that
we have six different movies to load. And, we need to be able to
view all six simultaneously. This
means that we need to create 6 copies of that "load/unload" button
and 6 empty movie clip instances (just drag the movie clip from
the library on to your stage six times - you do not need to create
6 separate movie clips in your library), with 6 different instance
names ("empty1", "empty2", etc). Each load button loads an animation
into the corresponding empty movie clip. And, as in the previous
example, when the "load" button is clicked, it becomes an "unload"
button, which empties the appropriate movie clip and returns the
button to its default "load" state.