if () {
var my_color:ColorTransform = new ColorTransform();
my_color.blueOffset = ;
my_color.greenOffset = ;
my_color.redOffset = ;
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.