• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Color Objects

You can use ActionScript to change the color of a movie clip. The easiest way to do this is to use the setRGB command. However, you cannot apply this directly to the movie clip instance. Instead, you first ask Flash for a reference to the movie clip's Color object. Do this with a new Color() function. Then you can use setRGB to set the color.

Here is a simple example. A reference to the color of the movie clip circle is placed in the variable circleColor. Then, the setRGB command changes this color to 0xFF0000, which is the hexidecimal value for red.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint