- Home
- Tutorials
- Flash
- Intermediate
- Shape Hints and Motion Paths

Page 4 of 4
Natalie Ebenreuter
This user is yet to take control of their account and provide a biography. If you are the author of this article, please contact us via support AT actionscript DOT org.
View all articles by Natalie EbenreuterAs a final step we will add a play button so that our flower doesn't freak out on us and loop forever. Create two new layers and call them actions and buttons. Move these two layers so that the actions layer is the very top layer and the buttons layer is underneath it.
On the buttons layer use the text tool to type "play". Select "play" and hit F8 to convert it to a button. Make sure you have button selected and call it play_btn and hit okay.

Double click on play_btn to edit the button in place. Hit F6 to create keyframes for the over, down and hitstates. Make sure you draw a square shape on the hit state frame to cover the height and width of the text. Simple text isn't always recognised as a true hit area in flash so it is always a good idea to add a shape to the hit area when using text buttons.

![]()

We must add an instance to our button so that our actionscript can tell it what to do. Select play_btn and in the property inspector where you see <instance> type play_btn.

Time to add some actions to our buttons.
Select on the actions layer and hit F9 to open the actions window.
Cut and paste the text below into the actions window
//this stops the main timeline
stop();
//when we click the play button start playing the main tileline
play_btn.onRelease=function(){
play();
}

Select frame 45 on the actions layer and hit F7 to insert a blank keyframe. Select the blank key frame and cut and past the following into the actions window.
//this stops the main timeline
stop();
//when we click the play button go to frame 2 and play the main timeline
play_btn.onRelease=function(){
gotoAndPlay(2);
}

All that is left to do is to test your movie. Go to Control/Test Movie at the menu above to test your movie. Click on the play button to watch your animation. Click here to download fla
Should you find any errors in this exercise or some of the instructions difficult to understand please send me an email at enatalie@unite.com.au

