/ Published in: ActionScript 3
Quick little helper method that allows you to no longer think in Milliseconds
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var fifteenMinutes:Number = minutesToMilliSecs( 15 ); var timer = new Timer( fifteenMinutes ); timer.addEventListener(TimerEvent.TIMER, timerHandler, false, 0, true ); timer.start(); private function minutesToMilliSecs( mins:Number ):Number { var milliSecs:Number = mins * 60 * 1000; return milliSecs; } private function timerHandler( e:TimerEvent ):void { trace( "timerHandler:" ) }