import flash.display.Sprite;
import flash.utils.*;
var duration:Number = 1000;
var intervalId:uint;
var counter:uint = 0;
var endCount:uint = 10;
intervalId = setInterval(myFunction, duration, "start");
function myFunction():void {
trace(arguments[0]);
counter++;
if(counter == endCount) {
trace("end");
clearInterval(intervalId);
}
}
Welcome to my actionscript snippet library!
Actionscript Snips is a small repository of actionscript code that aims to save developers and designers time when developing a website.
setInterval
Posted by
admin
on Monday, July 27, 2009
Labels:
Time
Code snippet that calls a function after one second intervals and stops when the counter limit is reached.
0 comments:
Post a Comment