setColor(mc, 0xFF0000); //Changes the color of the movieclip to red
function setColor(mc, color):void {
var colorTransform:ColorTransform = mc.transform.colorTransform;
colorTransform.color = color;
mc.transform.colorTransform = colorTransform;
}
Welcome to my actionscript snippet library!
Actionscript Snips is a small repository of actionscript code that aims to save developers and designers time when developing a website.
Showing posts with label MovieClip. Show all posts
Showing posts with label MovieClip. Show all posts
Change The Color Of A Movie Clip
Create Empty MovieClip
Here is a snippet that creates an empty movieclip. This is useful when you want to load external images or swfs into it.
var emptyMovieClip:MovieClip = new MovieClip();
emptyMovieClip.name = "emptymc";
addChild(emptyMovieClip);