In Closure, 'addEventListener' is deprecated. Use 'goog.events.listen' instead. The latter takes an 'opt_handler' as 5th argument, making the use of 'goog.bind' unnecessary. It also returns a 'key', which you can use with 'unlistenByKey'. If you don't want to do that, just use 'unlisten' with the same arguments as you used with 'listen'.
EdB On Fri, Jan 2, 2015 at 9:37 PM, Alex Harui <aha...@adobe.com> wrote: > Erik (and others). > > Do we know for sure whether removeEventListener works for FlexJS with > goog.bind()? I think I just stepped into it and it didn’t work because > for code like this: > > e.addEventListener(“foo", goog.bind(this.handler, this)); > <more code> > e.removeEventListener(“foo", goog.bind(this.handler, this)); > > goog.bind() will return a different “closure” on the second call to > goog.bind() so it won’t be found as a listener. > > > > Thanks, > -Alex > -- Ix Multimedia Software Jan Luykenstraat 27 3521 VB Utrecht T. 06-51952295 I. www.ixsoftware.nl