A
A
axtyt2014-02-26 00:41:48
Time Management
axtyt, 2014-02-26 00:41:48

How to delay frames in AS3?

How to delay frames in AS3? Preferably a script.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander N++, 2014-04-12
@sanchezzzhak

Delay what until the code is executed or during the show?
Everything is done through intervals or Timer.

public function waitToRun(delay:Number, callback:Function )
{
  var Timer = new Timer(delay, 1);
  function onCompliteTimer(event:Event)
  {
    timer.removeEventListener(TimerEvent.TIMER_COMPLETE, onCompliteTimer);
    callback.call();
  }
  timer.addEventListener(TimerEvent.TIMER_COMPLETE, onCompliteTimer);
  timer.start();	
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question