Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Feb 26th, 2012  |  syntax: None  |  size: 0.56 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }