Or perhaps a bit simpler and safer:
var myFunction:Function=Delegate.create(this,somefunction);
cancel_btn.addEventListener("click",myFunction);
and later:
cancel_btn.removeEventListener("click",myFunction);
You could always store myFunction as a property...
Ian
On 2/6/06, blists <[EMAIL PROTECTED]> wrote:
>
> 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
>
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders