Skip to content

Instantly share code, notes, and snippets.

@myobie
Created April 21, 2009 18:47
Show Gist options
  • Save myobie/99312 to your computer and use it in GitHub Desktop.
Save myobie/99312 to your computer and use it in GitHub Desktop.
public static function dispatchEvent(p_event:Event):void {
if (disp == null) { return; }
disp.dispatchEvent(p_event);
}
public static function addEventListener(p_type:String, p_listener:Function, p_useCapture:Boolean=false, p_priority:int=0, p_useWeakReference:Boolean=false):void {
if (disp == null) { disp = new EventDispatcher(); }
disp.addEventListener(p_type, p_listener, p_useCapture, p_priority, p_useWeakReference);
}
public static function removeEventListener(p_type:String, p_listener:Function, p_useCapture:Boolean=false):void {
if (disp == null) { return; }
disp.removeEventListener(p_type, p_listener, p_useCapture);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment