ColorTransform

This is an example of a ColorTransform. #FF0000 stands for the hexadecimal color code for red.

http://dreamsyntax.org/patterns/swf/colortransform_01.swf

// i created a listener for two buttons which BOTH call colorFunction when it is clicked stage.addEventListener(MouseEvent.CLICK, colorFunction);

// colorFunction will change the colour of both buttons, if they are clicked function colorFunction(evt:MouseEvent){ var myColor:ColorTransform = this.transform.colorTransform; myColor.color = 0xFF0000;

// i use a switch to evaluate which is clicked and only change that color switch (evt.target.name){ case "button_mc": button_mc.transform.colorTransform = myColor; break; case "button2_mc": button2_mc.transform.colorTransform = myColor; break; } }