/// STATIC DISPATCHER ///
private static var
_dispatcher:EventDispatcher;
public static function
addEventListener(p_type:String, p_listener:Function, p_useCapture:Boolean=false, p_priority:int=0, p_useWeakReference:Boolean=false):void {
if (_dispatcher == null) { _dispatcher = new EventDispatcher(); }
_dispatcher.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 (_dispatcher == null) { return; }
_dispatcher.removeEventListener(p_type, p_listener, p_useCapture);
}
public static function
dispatchEvent(p_event:MovieEvent):void {
if (_dispatcher == null) { return; }
_dispatcher.dispatchEvent(p_event);
}
0 Responses to “Static Event Dispatcher”