You want to control the color of a movie clip dynamically (at runtime, rather than during authoring).
Color object that targets
the desired movie clip, and then use the
Color.setRGB( ) method.
You can’t change the color of a movie clip directly.
Instead, you must first create a
that targets the movie clip of interest, as follows:
my_color = new Color(myMovieClip);
You can alternatively specify the movie clip name as a string:
my_color = new Color("myMovieClip");
The target movie clip, as specified when creating a
Color object, must correspond to the name of a
movie clip instance on the Stage, not the name of the Library symbol
from which the clip is derived. Therefore, you must set the target
clip’s instance name using the Property inspector
before you can target it using a
Color object can target a movie
on any timeline using an absolute or relative reference, such as:
my_color = new Color(_root.myMovieClip); my_color = new Color(_parent.myMovieClip);
Once you have created a
Color object, you can
use it to control the color of the targeted movie clip instance.
Color.setRGB( ) method applies a single
color value to the movie clip targeted by the
Color object (as specified when the
Color object was created), filling the entire
movie clip shape with a single color. The color value can be of any
valid ActionScript numeric format.
The following examples both apply a solid blue color ...