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.
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.
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!