AS3 Tint MovieClip

Here is how to tint a MovieClip in Flash via AS3.

var c:Color = new Color();                   //Create a color object
c.setTint(Math.random() * 0xffffff, 1);      //Set tint to a random color
mcObject.transform.colorTransform = c;      //Apply tint to your MovieClip

Below is an example of randomly changing a MovieClip's tint with ActionScript 3




Source Code

 

What did you think of this article?




Trackbacks
  • No trackbacks exist for this post.
Comments

  • 4/19/2010 11:59 PM Mike wrote:
    I get this error along with two others:
    Warning: 1060: Migration issue: The method Color is no longer supported. The Color class has been removed. Use the flash.geom.ColorTransform class for equivalent functionality..
    Reply to this
Leave a comment

Submitted comments are subject to moderation before being displayed.

 Enter the above security code (required)

 Name

 Email (will not be published)

 Website

Your comment is 0 characters limited to 3000 characters.