You can also remove a listener from an object using the __q_click array of
the object the listener is on.
Add a listener like this:
cancel_btn.addEventListener("click", Delegate.create(this, this.somefunction));
And remove that listener like this:
cancel_btn.removeEventListener("click", cancel_btn.__q_click[0]);
If you had multiple listeners, you might be able to loop over the __q_click
array and do a comparison but I'm not sure how.
Brookd
At 12:43 PM 2/6/2006, you wrote:
What I've figured out with removeEventListener and Delegate is you can
remove the listener on dispatchEvent like so:
private function someEventHandler (e:Object) {
var target = e.target;
if (removeHandler) target.removeEventListener("event",
arguments.caller);
}
Of course this only works after removeHandler is set to true and the
event is dispatched once again. Yet, is some instances its enough.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders