Re: [Flashcoders] removing all listeners from a dpo

2008-07-22 Thread Juan Pablo Califano
No worries. Personally, I think in most cases using this approach would not save you much work (in case it works in the first place). But I agree that it would be useful that the EventDispatcher class exposed a method to remove all listeners and probably a method to query any EventDispatcher

Re: [Flashcoders] removing all listeners from a dpo

2008-07-21 Thread Fabio Pinatti
On Sun, Jul 20, 2008 at 7:40 PM, Juan Pablo Califano [EMAIL PROTECTED] wrote: PD2: this line should be removed from the unregisterEventListener() _dispatcher.removeEventListener(type, listener, useCapture); since it will cause an infinite loop and the eventListener has already been

Re: [Flashcoders] removing all listeners from a dpo

2008-07-20 Thread Juan Pablo Califano
Hi, You could try to do your own bookkeeping, so you know what listeners are registered to an EventDispatcher object. You can have one class to hold that info in a list and write a method that loops through that list and remove all registered listeners. You'd still have to override the

Re: [Flashcoders] removing all listeners from a dpo

2008-07-20 Thread Juan Pablo Califano
PD: I forgot to actually remove the eventListenerData from the list in the unregisterEventListener method of the Bookkeeper class. Looping backwards and adding _eventsList.splice(i, 1); should do it. Cheers Juan Pablo Califano 2008/7/20, Juan Pablo Califano [EMAIL PROTECTED]: Hi, You

Re: [Flashcoders] removing all listeners from a dpo

2008-07-20 Thread Juan Pablo Califano
PD2: this line should be removed from the unregisterEventListener() _dispatcher.removeEventListener(type, listener, useCapture); since it will cause an infinite loop and the eventListener has already been removed in the caller anyway. So, to sum up: public function