Previous Page
Next Page

Tripod >> 3pod Tips & Learning and manuals for educations

Recipe 11.5. Animating Color Changes

Problem

You want to animate changes in a movie clip instance's tint over time.

Solution

Create two instances of the movie clip on two keyframes on the same layer. Modify the color settings in the first one to reflect how you want the movie clip to appear when the color animation begins. Modify the color settings in the second one to reflect how you want the movie clip to appear when the color animation ends. Create a motion tween between the two keyframes.

Discussion

As with just about any other properties of a movie clip, you can animate changes in color/tint over time. You can achieve a smooth gradation over time from one color/ tint to another by using a motion tween:

  1. Create a new layer for the movie clip instance, and create a new keyframe beginning on the first frame in which you want the animation to begin. If you want the movie clip to appear and begin animating its color starting at frame 1, you don't need to create an additional keyframe in this step.

  2. Create an instance of the movie clip on the stage and place it into the keyframe you created in step 1.

  3. Determine the number of frames over which you want the animation to take place, and create a new keyframe on the same layer at the appropriate frame. For example, if your first keyframe is at frame 15, and you want the animation to last for 30 frames, create a new keyframe on the same layer at frame 45. The new keyframe should be a duplicate of the first. You can do this by selecting the frame in the timeline and then choosing Insert Keyframe or by pressing F6.

  4. Adjust the Tint or Advanced color settings for the two instances. Set the first instance's color to what you want it to be when the animation begins. And set the second instance's color to what you want it to be when the animation ends.

  5. Create a motion tween between the two keyframes.

The result of this process is that the movie clip instance will gradually shift from the initial tint to the final tint. And, of course, you can combine this kind of tween animation with any other tweenable properties. For example, you can also change the position of the movie clip instance at the same time as the color is changing.

Although it is possible to programmatically tween color changes, it is a complex process that is not discussed in this book.

Tripod >> 3pod Botom Tips & Learning and manuals for educations

Previous Page
Next Page

 

bluedot bluedots greydots pinkdots

Tripod >> 3pod Tips & Learning and manuals for educations