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.
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.