A couple months ago, Mike Chambers released an EventProxy class, which served to make delegating EventDispatcher events simpler. At the time, I meant to release my own EventProxy class with some extra functionality, but it slipped my mind until today when Phil reminded me of it.

My EventDispatcher works almost exactly the same as Mike's, with 2 differences:
  1. It calls handleEvent on its target, as well as the specified function.
  2. It has an enabled property, that lets you temporarily disable the proxy
Nothing too major, but I find these capabilities handy, and thought others might as well.

You can download EventProxy by clicking here. It should be placed in the com.gskinner.events package.

You can see a brief usage example below. For a full description of how to use EventProxy, please see Mike's post on the subject.
// import the EventProxy so we can refer to it by name:
import com.gskinner.events.EventProxy;

// create an instance of EventProxy, and tell it to call
// doStuff in this scope when triggered:
clickEventProxy:EventProxy = new EventProxy(this,"doStuff");

// register the EventProxy to listen for click events
// from the button:
myPushButton.addEventListener("click",clickEventProxy);

// this function will be called when the button is clicked.
function doStuff(p_evtObj:Object):Void {
   trace("button clicked");
 
   // stop it from firing again for now:
   clickEventProxy.enabled = false;
}