# Doing a dynamic background stripe

**URL:** <https://forum.kirupa.com/t/doing-a-dynamic-background-stripe/318181>\
**Category:** flash\
**Created:** [January 12, 2011, 12:01pm UTC](https://forum.kirupa.com/t/doing-a-dynamic-background-stripe/318181 "2011-01-12T12:01:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rboyart](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@rboyart](https://forum.kirupa.com/u/rboyart)\
**Post date:** [January 12, 2011, 12:01pm UTC](https://forum.kirupa.com/t/doing-a-dynamic-background-stripe/318181/1 "2011-01-12T12:01:46Z")

</div>

Hi !

i’m doing a dynamic background stripes effect like this :

> **[Stock Flash Templates, Web Templates, Banner Rotators | ActiveDen](https://activeden.net/)**
>
> With thousands of Flash Components, Files and Templates, ActiveDen is the largest library of stock Flash online. Starting at just $2 and by a huge community of authors!

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
