3
votes

If I understand this correctly, most timer examples I've seen in AS3 are limited by a certain number of occurrences. Such as:

var timer:Timer = new Timer(1000, 2);
    timer.addEventListener(TimerEvent.TIMER, blah);
    timer.start();

function blah(e:TimerEvent):void{
    trace("Times Fired: " + e.currentTarget.currentCount);
     trace("Time Delayed: " + e.currentTarget.delay);
} 

Where it would fire twice (again, if I interpreted this correctly)

So if what I assumed is true, is there a way to make a timer where it would continuously keep track of time?

1

1 Answers

6
votes

Omitting the 2nd argument in the Timer constructor (or setting it to 0) will make the timer event fire infinitely:

var timer:Timer = new Timer(1000);