Posted By

chrisaiv on 01/15/10


Tagged

as3


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

tspitzr


AS3: Minutes to Milliseconds Helper


 / Published in: ActionScript 3
 

Quick little helper method that allows you to no longer think in Milliseconds

  1. var fifteenMinutes:Number = minutesToMilliSecs( 15 );
  2.  
  3. var timer = new Timer( fifteenMinutes );
  4. timer.addEventListener(TimerEvent.TIMER, timerHandler, false, 0, true );
  5. timer.start();
  6.  
  7. private function minutesToMilliSecs( mins:Number ):Number
  8. {
  9. var milliSecs:Number = mins * 60 * 1000;
  10. return milliSecs;
  11. }
  12.  
  13. private function timerHandler( e:TimerEvent ):void
  14. {
  15. trace( "timerHandler:" )
  16. }

Report this snippet  

You need to login to post a comment.