If you have any suggestions or comments, and would prefer using email, please contact me at:
gngabriel29[REMOVETHISANDREPLACEWITHYOU-KNOW-WHAT]ymail.com

October 23, 2008

Flash Actions Make Play button for Movie

Filed under: Flash/Flash Actions


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

Select Insert New Layer

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)

Select Actions Panel window

5. select Window > Actions, to open Actions panel

Click plus button of actions panel

Select stop action

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

Select play action

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.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>. I unfortunately do not have a spoiler-code, so be sure mark spoilers well.



Anti-spam measure: please retype the above text into the box provided.