# For(); How do I add a timer function?

**URL:** <https://forum.kirupa.com/t/for-how-do-i-add-a-timer-function/198175>\
**Category:** Uncategorized\
**Created:** [August 22, 2006, 10:47pm UTC](https://forum.kirupa.com/t/for-how-do-i-add-a-timer-function/198175 "2006-08-22T22:47:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxdd](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@maxdd](https://forum.kirupa.com/u/maxdd)\
**Post date:** [August 22, 2006, 10:47pm UTC](https://forum.kirupa.com/t/for-how-do-i-add-a-timer-function/198175/1 "2006-08-22T22:47:28Z")

</div>

Hi everyone - this is my first post!

I have a for() statement performing a loop that attaches a movieclip each time it’s executed. The variable “maximumBloodBurst” defines how many times the loop cycles (the amount of movieclips to produce).

Here’s the script:

```auto
createBloodCells = function () {
	var g:Number;
	for (g=0; g<maximumBloodBurst; g++) {
		this.attachMovie("redBloodCell_mc", "blood"+g+"_mc", g, {_x:-200, _y:randRange(200, 400)});
	}
};

```

Right now the function is attaching all the movieclips to the stage at the same time…or at the fps. Is there a way to add a timer or a function that slows down the time before each instance that the for() loop is executed?

Thanks in advance for any help.

maxdd
