Posted By

jpa1999 on 07/08/11


Tagged

timers


Versions (?)

Timer


 / Published in: ActionScript 3
 

  1. import flash.utils.Timer;
  2. import flash.events.TimerEvent;
  3.  
  4. var delay:uint = 30000;
  5. var repeat:uint = 3;
  6. var timer:Timer = new Timer(delay, repeat);
  7.  
  8. timer.start();
  9. timer.addEventListener(TimerEvent.TIMER, timerHandler);
  10. timer.addEventListener(TimerEvent.TIMER_COMPLETE, completeHandler);
  11.  
  12. private function timerHandler(e:TimerEvent):void{
  13. //Timer event
  14. }
  15.  
  16. private function completeHandler(e:TimerEvent):void {
  17. //Timer complete
  18. }

Report this snippet  

You need to login to post a comment.