Flash Actions Make Play button for Movie
Hi folks, today, we’ll learn how to create play and stop buttons for a flash movie.
Create animation and stop animation
1. Create motion tween
2. Right-click on a layer, and select Insert Layer, to insert new layer
3. double-click the name of the new layer, and enter actions
4. select frame#1 of the actions layer (a keyframe should already exist in frame#1 of this new layer)

5. select Window > Actions, to open Actions panel
6. click + button of Actions panel, and select Global Functions > Timeline Control > stop, to add stop action to current keyframe
note: action script for frame#1 (a keyframe is created by default in frame#1, when new layer is created) of the actions panel should look like this:
stop();
Create play and stop buttons
1. Select oval tool
2. select red fill
3. click and drag oval on stage
4. right-click oval shape, and select Convert to Symbol, and select type of Button, and enter name of btnMisc, and click OK, to create button symbol and its instance (the red button instance will be the stop button)
5. press Ctrl+C, to copy current button instance
6. press Ctrl+V, to paste new button instance
7. single-click new button instance, and select Tint from Color dropdown box, and select green color, and tint amount should be set to 100% (the green button will be the play button)
Assign actions to buttons
1. Select red stop button
2. select Window > Actions panel, to open Actions panel
3. click + button of Actions panel, and select Global Functions > Movie Clip Control > on, and double-click press for parameter, to add script to react to event when mouse press on the button
script should now look like this:
on(press){
}
4. click after opening bracket, and press enter
5. click + button of Actions panel, and select Global Functions > Timeline Control > stop
script should now look like this:
on(press){
stop();
}
6. select green play button
7. repeat steps 3 to 4 for green play button
8. click + button of Actions panel, and select Global Functions > Timeline Control > play
script should now look like this:
on(press){
play();
}
9. press Ctrl+Enter to test movie
note: click green play button for animation to play, and click red stop button for animation to stop

Comments »
No comments yet.
RSS feed for comments on this post.