Hi !
i’m doing a dynamic background stripes effect like this :
but i want, when resizing the swf window, to change the width and height dynamically.
i have a problem when erasing my childs in the for, because i want to erase/create the childs everytime the user resize the window.
Could someone help me, please?
this is my code until now:
[AS]
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.addEventListener(Event.RESIZE, resizeHandler);
stage.dispatchEvent(new Event(Event.RESIZE));
function resizeHandler(e:Event):void
{
drawing(stage.stageWidth, stage.stageHeight);
}
function drawing(widthX:int, heightY:int){
for (var iX= 0; iX <= widthX ; iX+= 5){
for (var iY= 0; iY <= heightY; iY+= 5){
var stripe:Stripe = new Stripe();
addChildAt(stripe,0);
stripe.x = iX;
stripe.y = iY;
//trace(stripe.numChildren)
}
}
}
[/AS]
thanks,
Rodrigo