[Flashcoders] removeEventListener not working?

2005-10-27 Thread Martin Klasson
Hi People. I am using the EventDispatcher, and it works well with dispatching events and all. But I cant remove them. This is the line in which I add a listener fntController.addEventListener('onFinished', Delegate.create(this, fontsLoaded)); this is the line to remove

RE: [Flashcoders] removeEventListener not working?

2005-10-27 Thread Martin Klasson
- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martin Klasson Sent: den 27 oktober 2005 14:53 To: Flashcoders mailing list Subject: [Flashcoders] removeEventListener not working? Hi People. I am using the EventDispatcher, and it works well with dispatching events and all

Re: [Flashcoders] removeEventListener not working?

2005-10-27 Thread Helen Triolo
You have to store a reference to the delegate to be able to remove it. A modification of a post by Till S: function clearListeners():Void { fntController.removeEventListener('onFinished', fdelegate); } var fdelegate = Delegate.create(this, fontsLoaded);

Re: [Flashcoders] removeEventListener not working?

2005-10-27 Thread Ian Thomas
The trouble is that Delegate.create _creates a new Function object_ - so the Delegate object in your removeEventListener call is actually a different object from in your addEventListener call. To get around this, simply store the delegate - e.g.: var

RE: [Flashcoders] removeEventListener not working?

2005-10-27 Thread Martin Klasson
Sent: den 27 oktober 2005 15:20 To: Flashcoders mailing list Subject: Re: [Flashcoders] removeEventListener not working? You have to store a reference to the delegate to be able to remove it. A modification of a post by Till S: function clearListeners():Void

RE: [Flashcoders] removeEventListener not working?

2005-10-27 Thread Geoffrey Williams
PROTECTED] On Behalf Of Martin Klasson Sent: Thursday, October 27, 2005 9:09 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] removeEventListener not working? I pasted in wrong line at the bottom, should be like this: // ADD fntController.addEventListener('onFinished', Delegate.create

RE: [Flashcoders] removeEventListener not working?

2005-10-27 Thread Josh Tynjala
for you, but I've switched to it in my projects without a hitch. Josh Tynjala Zeus Design -- Date: Thu, 27 Oct 2005 15:39:17 +0200 From: Martin Klasson [EMAIL PROTECTED] Subject: RE: [Flashcoders] removeEventListener not working? To: Flashcoders mailing list