setInterval inside a loop?

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).


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