Posted By

publicbroadcast on 04/02/09


Tagged

actionscript3


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

nreliu


Ticking Clock


 / Published in: ActionScript 3
 

make a new date object every tick, probably want to do some GC on it, though

  1. var myTimer:Timer = new Timer(1000);
  2.  
  3. myTimer.start();
  4. myTimer.addEventListener(TimerEvent.TIMER, timerHandler);
  5. myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, completeHandler);
  6.  
  7. function timerHandler(e:TimerEvent):void{
  8.  
  9. var current:Date = new Date();
  10.  
  11. trace(current);
  12. }
  13.  
  14. function completeHandler(e:TimerEvent):void {
  15.  
  16. }

Report this snippet  

You need to login to post a comment.