# Loop that creates multiple Timers

**URL:** <https://forum.kirupa.com/t/loop-that-creates-multiple-timers/324219>\
**Category:** flash\
**Created:** [August 9, 2011, 8:46am UTC](https://forum.kirupa.com/t/loop-that-creates-multiple-timers/324219 "2011-08-09T08:46:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flash27](https://avatars.discourse-cdn.com/v4/letter/f/ba8739/32.png) [@flash27](https://forum.kirupa.com/u/flash27)\
**Post date:** [August 9, 2011, 8:46am UTC](https://forum.kirupa.com/t/loop-that-creates-multiple-timers/324219/1 "2011-08-09T08:46:18Z")

</div>

Hi I am trying to get this simple logic to work correctly. Right now, the trace is:  
int 0  
int 0  
int 0  
int 0

I am trying to get this to trace:  
int 0  
int 1  
int 0  
int 1

I am trying to set timers to go off back to back shortly after each other while passing through a parameter from an array.

function testFunc(e:Event,numb:int)  
{  
trace("int " + numb);  
}

var newset:Array = [0,1,0,1];  
for( var i:int = 0 ; i \<= newset.length - 1 ; i++ )  
{  
if(i \> 0)  
{  
timing = timing + 1000;  
}

var timer = new Timer(timing, 1);

timer.addEventListener(TimerEvent.TIMER, function(e:Event){ testFunc(e, newset\*) });

timer.start();  
}
