Posted By

flashinit on 12/29/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

chus


Timeline Wait


 / Published in: ActionScript 3
 

  1. var delayTimer:Timer;
  2.  
  3. function wait(timeToHold:Number)
  4. {
  5. stop();
  6. delayTimer = new Timer(timeToHold,0);
  7. delayTimer.addEventListener(TimerEvent.TIMER, continuePlayahead);
  8. delayTimer.start();
  9. }
  10.  
  11. function continuePlayahead(e:Event):void
  12. {
  13. play();
  14. delayTimer.stop();
  15. delayTimer.reset();
  16. delayTimer.removeEventListener(TimerEvent.TIMER, continuePlayahead);
  17. }

Report this snippet  

You need to login to post a comment.