# Timer in a loop

**URL:** https://forum.kirupa.com/t/timer-in-a-loop/318796
**Category:** Uncategorized
**Created:** [January 30, 2011, 8:47pm UTC](https://forum.kirupa.com/t/timer-in-a-loop/318796 "2011-01-30T20:47:02Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![entharas](https://avatars.discourse-cdn.com/v4/letter/e/ecae2f/32.png) [@entharas](https://forum.kirupa.com/u/entharas)
#### Post date: [January 30, 2011, 8:47pm UTC](https://forum.kirupa.com/t/timer-in-a-loop/318796/1 "2011-01-30T20:47:02Z")

</div>

Hey,  
firstly, i would like welcome all users, it’s my first post 🙂  
I want to make animation like in Matrix(falling ‘1’ and ‘0’), i write this code:

```auto

import flash.display.MovieClip;
 
var movie:MovieClip;
var myTimer:Timer;
 
 
for (var i:int=1; i*26<stage.stageHeight; i++)
{
	if (Math.ceil(Math.random() * 2) == 1)
	{
		movie = new zero ;
	}
	else
	{
		movie = new jeden ;
	}
	movie.y=26*(i-1);
	myTimer = new Timer(200 * i,1);
	myTimer.addEventListener(TimerEvent.TIMER, runOnce);
	myTimer.start();

}
	function runOnce(event:TimerEvent):void
	{
		addChild(movie);
		trace('s');
	}

```

but it doesn’t working correctly, can someone show me where i made mistake?  
sorry for my bad english  
Thanks in advance 🙂
