I have been trying for a long time now to change the colour of a object exclusively with action script instead of going to the timeline and making two different colours of it. Also it is inside of a if statement
if (<whatever you need in here> { var my_color:ColorTransform = new ColorTransform(); my_color.blueOffset = <number>; my_color.greenOffset = <number>; my_color.redOffset = <number>; my_square.transform.colorTransform = my_color; }
Just insert the RGB color code of the color you want to change the object to for the 3 values inside the if statement.