How to make an animation only move when clicked in Adobe Flash

In my first flash animation project, I have a little crab who does a flip when you click on him. Today I’m going to show you how easy it is to make this happen. For the purposes of this animation, I made all motions nested tweens. This was so I could make each part interactive on its own. To learn about nested tweens, see my previous blog post.

Okay so this is what my project looks like on the main timeline:

My crab is already a symbol, so I double click on him to view the timeline nested inside him. Right click on him to create another symbol. (I named this one crabFlipping to show the motion he will be doing.) In the timeline, create a new layer and name it actions. Then right-click on the frame 1 of the Crab layer and and chose “Insert Key Frame.”

Creating a key frame before you create the motion tween will allow you to make it so the crab does not flip until your click on it. Then go the frame 2 in your timeline, right click on your symbol and Create Motion Tween. Adjust the symbols location within the timeline in the motion tween to make it move where you want.

If you test your movie, your symbol will move as you directed in your motion tween in a continuous loop. Making your symbol stand still until your click it is really quite simple. First, on the top of your screen, under the Window bar, choose Action.

The Actions pop-up will appear and then click Code Snippets so that the Code Snippets pop-up appears.

Then click on frame 1 in your actions layer and under Timeline Navigation folder in your code snippets, choose Stop at this Frame.

While still in the Actions window, click on your symbol (my crab) and then double click on “Click to Go to Frame and Play.” Your actions window should look something like this:

However, this code will send your symbol to frame 5 when clicked on. Change the number in to 2 (circled in image above) and delete the gray writing. (These are just helpful instructions for each code snippet.) Then when you test your movie, your object should remain still until clicked on!



~ by maireadlynn on December 13, 2011.

One Response to “How to make an animation only move when clicked in Adobe Flash”

  1. great tips, thanks!

Comments are closed.

%d bloggers like this: