Just one more question to that. Although I don't think it's specifically related to the Tweening. How can I set the ChildIndex of the square so that the entire grid is behind the other objects on the stage? I tried to put the stage.setChildIndex(mr_square_fade,0); in there, but keep getting the error message: ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. Sorry to reopen the topic.
///Mr. Square
function mrSquare():void{
var rows:int = 10;
var cols:int = 30;
var delay:Number = 0;
for (var py:int = 0; py for (var px:int = 0; px var mr_square_fade:mr_square = new mr_square();
//container.setChildIndex(mr_square_fade, numChildren – 1);
mr_square_fade.x = 0 + mr_square_fade.width * px;
mr_square_fade.y = 150 + mr_square_fade.height * py;
addChild(mr_square_fade);
stage.setChildIndex(mr_square_fade,0);
mr_square_fade.alpha = 0;
TweenMax.fromTo(mr_square_fade, 4, {autoAlpha:0, scaleX:0.1, scaleY:0.1, tint:0x063773/*, y:-300*/}, {autoAlpha:1, scaleX:1, scaleY:1, tint:0x0B1E3B, /*y:mr_square_fade.height * py + 150, */delay:delay});
delay += .01;
}
}
}