FrameDelay

Kind of class:public class
Package:org.casalib.time
Inherits from:none
Implements:
Version:09/06/09
Author:Aaron Clinger
Classpath:org.casalib.time.FrameDelay
File last modified:Sunday, 06 September 2009, 08:46:07
Creates a callback after one or more frames. The class helps prevent race conditions by allowing recently created MovieClips, Classes, etc. a frame to initialize before proceeding.
Example:
  • package {
        import org.casalib.display.CasaMovieClip;
        import org.casalib.time.FrameDelay;
    
    
        public class MyExample extends CasaMovieClip {
            protected var _frameDelay:FrameDelay;
    
    
            public function MyExample() {
                super();
    
                this._frameDelay = new FrameDelay(this._onInitComplete);
                this._frameDelay.start();
            }
    
            protected function _onInitComplete():void{
                trace("Ready!");
            }
        }
    }

Summary


Constructor
  • FrameDelay (closure:Function, frames:uint = 1, arguments)
    • Runs a function at a specified periodic interval.
Instance methods
  • start : void
    • Starts or restarts the delay.
  • stop : void
    • Stops the delay from completing.

Constructor

FrameDelay

public function FrameDelay (
closure:Function, frames:uint = 1, arguments)

Runs a function at a specified periodic interval.
Parameters:
closure :
The function to execute.
frames :
The amount of frames to delay.
arguments:
Arguments to be passed to the function when executed.

Instance methods

start

public function start (
) : void

Starts or restarts the delay.
Specified by:

stop

public function stop (
) : void

Stops the delay from completing.
Specified by: