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

Get Flash 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.