[Flashcoders] EventDispatcher.removeEventListener

2006-02-06 Thread Simen Brekken
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

Re: [Flashcoders] EventDispatcher.removeEventListener

2006-02-06 Thread Ramon Tayag
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

Re: [Flashcoders] EventDispatcher.removeEventListener

2006-02-06 Thread blists
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,

Re: [Flashcoders] EventDispatcher.removeEventListener

2006-02-06 Thread Ian Thomas
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