Making the Movie Clip Button Work

The movie clip button was built and then animated in the previous couple of lessons. You were even introduced to stop actions while building map.fla, so the animation did not continuously loop. In this exercise you will complete the movie clip buttons by adding some simple actions that make them animate properly when you click on the buttons themselves. You are still using bookstore10.fla for this example.


Open the library and find the movie clip buttons. Double-click the mcSampleChapter button so you can edit the movie clip.

The buttons you created say sample chapter and table of contents on the front of the buttons, and you will be able to find them in the library. Double-click the sample chapter button in the library so it opens in symbol-editing mode and then refamiliarize yourself with how you structured the button earlier.


Select Frame 1 in the actions layer and add a stop(); action. Continue by adding the stop(); actions on Frames 14 and 25.

Select Frame 1 and then maximize or open the Actions panel (F9). Turn off Script Assist by pressing the Script Assist button, and type stop(); into the Script pane. Select Frame 14 on the Timeline, press F6 to insert a keyframe, and then type stop(); into the Script pane.

Press F6 on Frame 25 to insert a new keyframe on the actions layer and then type stop(); into the Script pane.


Type in play(); for the _over state on the actions layer.

Enter new keyframes on the actions layer above the _over and _down states. Select the keyframe for _over and type play(); into the Action panel's Script pane. This action tells the playhead to continue and play the next frame(s).

The reason you need to add play(); on the _over frame is because Flash is programmed to stop on each frame label when you create a movie clip button. If you were to allow Flash to just stop, the brightness tween animation would not play as a result. Therefore, you need to tell Flash to play the animation instead, which is why you add the play(); action on the frame.


Move the playhead to the _down frame and add the play(); action on the actions layer.

When the user clicks the button, you want another brightness tween to occur. Therefore, you need another play(); action so the button does not stop at this frame label.

Add a blank keyframe on Frame 15 of the actions player by selecting it and pressing F6. Open the Actions panel and type play(); into the Script pane.


Return to the main Stage by pressing Scene 1 on the edit bar. Repeat Steps 1 through 4 for the mcToc button.

Repeat the exact same steps from Steps 1 through 4 for the other movie clip button. When you are finished, return to the main Stage again using the edit bar.


Save the changes you made to the FLA.

After you are at the main Stage, choose File > Save to save the changes to your file. Make sure that you save the file in the TechBookstore folder. In Lesson 9, you will learn more about events that will be triggered when users roll the cursor on and off of the button.

Macromedia Flash 8. Training from the Source
Macromedia Flash 8: Training from the Source
ISBN: 0321336291
EAN: 2147483647
Year: 2004
Pages: 230
Authors: James English © 2008-2017.
If you may any questions please contact us: