Assuming the following pattern:
someObjectInstance.addEventListener(MyDisplayObject.EVENT_CONSTANT, _handleMyEvent);
private function _handleMyEvent( event:Eve
There is a way of passing custom data to the handler method without creating a custom event.
private function test() {
var data : SomeObject = new SomeObject;
var a:SomeEventDispatcher = new SomeEventDispatcher();
a.addEventListener(Event.COMPLETE, handle(data));
a.dispatchCompleteEvent();
}
private function handle(data : SomeObject) : Function {
return function(e : Event) : void {
IEventDispatcher(e.target).removeEventListener(Event.COMPLETE, arguments.callee);
trace(e + ", " + data);
};
}