Guest User

Untitled

a guest
Feb 26th, 2012
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. private var _callLater : Dictionary = new Dictionary(true);
  2.  
  3. public function callLater(method : Function, args : Array = null) : void {
  4. _callLater[method] = args;
  5. // If app supposes to use graphics, change it to ENTER_FRAME
  6. this.addEventListener(Event.EXIT_FRAME, onCallLater);
  7. }
  8.  
  9. private function onCallLater(event : Event) : void {
  10. // If app supposes to use graphics, change it to ENTER_FRAME
  11. this.removeEventListener(Event.EXIT_FRAME, onCallLater);
  12. for ( var f : Object in _callLater ) {
  13. ( f as Function ).apply(undefined, _callLater[f]);
  14. delete _callLater[f];
  15. }
  16. }
Add Comment
Please, Sign In to add comment