# setInterval inside a loop?

**URL:** https://forum.kirupa.com/t/setinterval-inside-a-loop/250427
**Category:** flash
**Created:** [January 29, 2008, 2:57pm UTC](https://forum.kirupa.com/t/setinterval-inside-a-loop/250427 "2008-01-29T14:57:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![JSTAR](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@JSTAR](https://forum.kirupa.com/u/JSTAR)
#### Post date: [January 29, 2008, 2:57pm UTC](https://forum.kirupa.com/t/setinterval-inside-a-loop/250427/1 "2008-01-29T14:57:31Z")

</div>

Hello Y’all,

Simple question.

Can someone whack a tiny example of how to call a function via setInterval a limited number of times (e.g. 20 times).

```auto

function CallMe(Me){
trace(Me);
}
for(var i:Number = 0; i<=20;i++){
setInterval(CallMe(i),3000);
}

```

My intention for the above simple code would be to have ‘i’ get traced every 3 seconds. But it doesn’t. ‘i’ just gets dopped out into the output pane all in one go. Do steady release!

Stumped!

Cheers for any replies
