I'm having some issues with EventDispatcher, specifically removeEventListener
and delegates. The problem arises when I want to remove an existing event
listener but the target function no longer exists, is there any way to remove an
event listener without specifying the callback function?
On a
yup, check out gDispatcher by Mr. Skinner. You can google it.
On 2/6/06, Simen Brekken [EMAIL PROTECTED] wrote:
I'm having some issues with EventDispatcher, specifically removeEventListener
and delegates. The problem arises when I want to remove an existing event
listener but the target
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,
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
4 matches
Mail list logo