
Untitled
By: a guest on
Feb 26th, 2012 | syntax:
None | size: 0.56 KB | hits: 14 | expires: Never
private var _callLater : Dictionary = new Dictionary(true);
public function callLater(method : Function, args : Array = null) : void {
_callLater[method] = args;
// If app supposes to use graphics, change it to ENTER_FRAME
this.addEventListener(Event.EXIT_FRAME, onCallLater);
}
private function onCallLater(event : Event) : void {
// If app supposes to use graphics, change it to ENTER_FRAME
this.removeEventListener(Event.EXIT_FRAME, onCallLater);
for ( var f : Object in _callLater ) {
( f as Function ).apply(undefined, _callLater[f]);
delete _callLater[f];
}
}