Hi Alistair, That worked perfectly, cheers! From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alistair McLeod Hi Michael, I imagine its because your event listener is an anonymous
function, so the removeEventListener must be passed a reference to the same
function. Try this (untested) myHandler : Function = Delegate.create( this,
handleEvent ); pane.addEventListener("contentCreated", myHandler ); ... pane.removeEventListener("contentCreated", myHandler ); myHandler may have to be stored asan
instance variable if (as I suspect) the add and remove are in different scope. Please let us know if that works. Ali -- Alistair McLeod iteration::two Office: +44 (0)131 338 6108 This e-mail and any associated attachments
transmitted with it may contain confidential information and must not be
copied, or disclosed, or used by anyone other than the intended recipient(s).
If you are not the intended recipient(s) please destroy this e-mail, and any
copies of it, immediately. From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Michael Herron All, I am having a problem with removing event listeners on a
panel. I am adding the event listener like so:
pane.addEventListener("contentCreated", Delegate.create(this, handleEvent) ); But trying to remove the event listener
using removeEventListener does not seem to work. I have tried several variants:
pane.removeEventListener("contentCreated", Delegate.create(this, handleEvent) );
pane.removeEventListener("contentCreated", Delegate.create(this) );
pane.removeEventListener("contentCreated", this.handleEvent );
pane.removeEventListener("contentCreated", this ); and none seem to work. I’ve
been struggling with this for a good few hours and its driving me crazy, any
help would be appreciated…. Ta Mike Herron Yahoo! Groups Links
|