FrameDelay
| Kind of class: | public class |
|---|---|
| Package: | org.casalib.time |
| Inherits from: | none |
| Implements: | |
| Version: | 03/19/08 |
| Author: | Aaron Clinger |
| Classpath: | org.casalib.time.FrameDelay |
| File last modified: | Monday, 01 December 2008, 11:16:36 |
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 flash.display.MovieClip; import org.casalib.time.FrameDelay; public class MyExample extends MovieClip { 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.
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.