Use code in each Square.
changeColor();
var myTimer:Timer = new Timer(1000, 0);
myTimer.addEventListener(TimerEvent.TIMER, timerHandler);
myTimer.start();
function timerHandler(event:TimerEvent):void {
changeColor();
}
function changeColor(){
var myColor:ColorTransform =square.transform.colorTransform;
var r:uint=Math.random()*256;
var g:uint=Math.random()*256;
var b:uint=Math.random()*256;
myColor.color =r*256*256+g*256+b;
square.transform.colorTransform = myColor;
}
留言