On a previous page, we saw how to add playhead control commands to the movie's main timeline and to add a button on that same timeline. This allows a person interacting with the movie to start and stop its playhead, or even to send the playhead to a particular frame in the movie. But it doesn't allow control of individual elements within a Flash movie, such as the flying airplane or bleating sheep. To control those items individually (independently of each other and independently of some fixed place along a timeline), we need to make them into movieclips.
A movieclip is like a Flash mini-movie -- it has its own timeline and so can be addressed and controlled independently of the main timeline and independently of other movieclips. It is a type of symbol, like the graphic symbol we used when making motion tweens.
A movieclip will begin to play as soon as the playhead encounters it, and will continue to loop, unless actionscript within the movieclip or elsewhere in the movie tells it to do otherwise, or unless the playhead goes to a frame where the movieclip no longer exists.
There are three ways to create a movieclip:
Let's look at an example of the 3rd way of creating a movieclip -- from an existing sequence of frames, such as we already have in our sheep movie. Open sheepscene2.fla (link at right under Files) and let's look at changing the existing animations to movieclips:




The steps to create the bleating sheep are exactly the same as the airplane, except that all of the relevant frames in 4 different layers have to be copied and pasted. Make sure you include the frame before the bleating sequence begins in the sequence of copied frames.

Then proceed as above, creating a new movieclip (bleatingsheep), Pasting the Frames you copied into frame 1 of the new movieclip, and adding an actions layer with a stop() in frame 1.
Now that we've made movieclips of all the animated parts of the timeline, the main timeline itself can be collapsed to just one frame, and the movieclips placed in that frame. They'll be stopped because of the stop actions we put into their first frames, but we'll add buttons in the next step to make them play.
First, select all the frames except frame 1, in all layers, and remove them (Edit, Timeline, Remove Frames or right-click and choose Remove Frames):

Then find the airplane layer, which now has an empty keyframe (because its content all started farther down the timeline). Open the library and drag a copy of the flyingplane movieclip onto the stage.

With the plane movieclip selected on stage, type this instance name into the box in the Properties panel which says <instance name>: plane_mc. A symbol in the library always has a symbol name associated with it (flyingplane, eg). When instances of the symbol are dragged onto the stage, each instance can have its own instance name, and in fact, must have an instance name if the instance is to be addressed with actionscript.
Delete all the sheep2 layers and the baa layer. Add a new sheep2 layer and drag an instance of bleatingsheep from the library into frame 1 of the new layer. Give it instance name sheep_mc.
Make a new buttons layer somewhere above the foreground hill layer. Choose File, Import, Open External Library and find buttons_forscene.fla (as you did to get the Replay button on this page). Drag a copy of do_airplane and do_sheepbleat out of the library (of buttons_forscene.fla) and onto the stage (of sheepscene2.fla). Select do_airplane, open the Actions panel and type in
on (release) {
plane_mc.gotoAndPlay(2);
}
Then select do_sheepbleat and type in
on (release) {
sheep_mc.gotoAndPlay(2);
}
Save the new movie as sheepscene3.fla. Press cmd-Enter (pc:ctrl-Enter) to test the movie.
Discussed on this page:
3 ways to make a movieclip, including from existing content, stop a movieclip, use a button to control a movieclip, give movieclip an instance name to make it addressable
Files:
sheepscene2.fla
buttons_forscene.fla
In sheepscene.zip, password required
Subscription:
A password may be obtained by subscription
An access password will be emailed to the address you specify within 24 hours of receipt of payment, and will remain active for 30 days thereafter. A list of all files currently available at the site may be viewed here.