Created
August 10, 2010 18:31
-
-
Save RandomEtc/517743 to your computer and use it in GitHub Desktop.
implements IEventDispatcher, for when you can't subclass EventDispatcher directly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///// IN IMPORTS | |
import flash.events.IEventDispatcher; | |
import flash.events.EventDispatcher; | |
///// | |
///// IN CLASS DECLARATION: | |
implements IEventDispatcher | |
///// | |
///// IN CONSTRUCTOR: | |
this.dispatcher = new EventDispatcher(this); | |
///// | |
private var dispatcher:EventDispatcher; | |
public function willTrigger(type:String):Boolean | |
{ | |
return dispatcher.willTrigger(type); | |
} | |
public function dispatchEvent(event:Event):Boolean | |
{ | |
return dispatcher.dispatchEvent(event); | |
} | |
public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void | |
{ | |
dispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference); | |
} | |
public function hasEventListener(type:String):Boolean | |
{ | |
return dispatcher.hasEventListener(type); | |
} | |
public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void | |
{ | |
dispatcher.removeEventListener(type, listener, useCapture); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment