Like many beginner problems, this is painfully simple and obvious to the experienced Flash user, but it hangs up many new users for hours or even days. This problem hung me up for a day and a half.
I had a continuous loop animation that served as the background of my page. I also had several menu animations that I wanted to animate once and then stop. The problem was that when the movie looped, the stopped animations would go off again. I needed a way to make the background animation loop continuously while the menu elements animated once and then stopped. I asked questions on the FlashKit Newbie Forum and someone answered my question. I did an example flash movie using the information and this is the result. I hope it helps you too. Animationd and Loops First, I created my continuous loop animation in the form of a Red Box that moved across the screen: The key to this the placing the animation in it's own movie clip (MC). This will allow it to run independantly of the main timeline which means if the main timeline is stopped, the movie clip can keep playing. So let's build it! Rename the layer to contain the MC "Red Box". Draw a red square on stage, select it and press F8 (or choose Insert> Convert to Symbol.. to convert it to a symbol. When the Dialog box appears give the symbol a name and select the Movie Clip option. Once you click OK the MC's timeline will appear (this is different to the Main Timeline) and you will have a red box on the stage. What we want to do now is animate the box, but before we can do that we need to turn the box into a graphic symbol. To do this, select the box and press F8 like before, but this time select the Graphic Symbol. Once you click OK, the red square before you will now be a graphic symbol. This conversion process will enable to you "Motion Tween" the object. Now let's look at the timeline of the Movie Clip. Currently you will only have one active frame (in frame 1). To animate the red square, click on frame 30 and press F6 (or choose Insert> Key Frame). Now while frame 30 is selected, move your Red Square the finishing point of your animation. In this example it's simply on the other side of the stage. Your timeline should now look something like this.  When the movie clip plays the playhead will reach frame 30 and in the absence of any stop action, the MC will automatically loop back to frame 1. That's it for the looping, now let's look at the main timeline.
Object Animation On the main timeline we need to ensure the Red Box movie clip is on the stage. If it's not you can do this by opening the Library (Ctrl+L) and draging the symbol onto the stage. Once it is on the stage we can move on to the other symbols. You already now how to animate one symbol from the last page. All we are going to do here is replicated the animation process for the yellow and blue boxes as well. But instead of creating a movie clip to house the animation, you can simply create it on the main timeline. The reason for this is both the blue and yellow boxes won't be looping. In the red box animation we simply animated from point A to point C. For the animation for the blue box and the yellow box it uses the same principle except we have added a point B (a keyframe in the middle). All we are doing here is animating the object from point A to B then from B to C. Once you have created and animated the boxes, your main timeline should look something like this. Notice how the blue and yellow boxes are animated in the same way but the go to frame 31 instead of frame 30. This is to give the MC "Red box" enough frames to play. If there wasn't enough frames your aniation wouldn't work properly. Stop Command Finally, I added a final layer with the "Stop" command on frame 33. This will stop the movie (the main timeline) however the MC Red Box will continue to loop. To add and action to a frame double click on frame 33. Then select the actions tab. For more information on adding actions to frames see check out the tutorial. Once again, this is an example Flash animation to show you the functionality. Hope it helps you.
Download the file used in this tutorial.
|