Have you seen Grant Skinner's Janitor class? http://gskinner.com/talks/resource-management/ - slide 32 talks about it click download source at the bottom to get the code.
even this looks interesting: http://blog.open-design.be/2009/01/29/events-manager-as3-classes/ I just googled AS3 event listener manager and got a few hits. Ktu On Wed, Jan 6, 2010 at 4:58 PM, ktt <kestuti...@yahoo.com> wrote: > Thank you all for answers. > Method with array recording really works nicely :-) > BTW - while searching for this method I've found other useful listener tips > too: > > http://www.almogdesign.net/blog/actionscript-3-event-listeners-tips-tricks/ > > --- On Wed, 1/6/10, Taka Kojima <t...@gigafied.com> wrote: > > > From: Taka Kojima <t...@gigafied.com> > > Subject: Re: [Flashcoders] detect and remove listeners > > To: "Flash Coders List" <flashcoders@chattyfig.figleaf.com> > > Date: Wednesday, January 6, 2010, 9:02 PM > > Yeah, that is the best way... that > > way you can also properly make sure you > > handle removing all of them when you no longer need an > > object. > > > > You can either create a helper class, with static methods > > or extend > > MovieClip or Sprite and have all of your classes extend > > from the new class. > > > > Store everything in a multidimensional array and you're > > good to go, then you > > can create a removeAllListeners() method that saves a lot > > of time and > > headaches for garbage collection purposes. > > > > This is how I handle event listeners for major application > > components and it > > has worked very well thus far. > > > > - Taka > > > > On Wed, Jan 6, 2010 at 3:35 AM, Karl DeSaulniers <k...@designdrumm.com > >wrote: > > > > > Maybe create a class or function that applies and > > removes the listeners? > > > > > > Karl > > > > > > > > > > > > On Jan 6, 2010, at 5:21 AM, Henrik Andersson wrote: > > > > > > ktt wrote: > > >> > > >>> Hello, > > >>> > > >>> What is the best method to iterate through > > MovieClip children, check if > > >>> they have listeners and if they have - remove > > them? > > >>> > > >>> It is not possible to get a list of the > > listeners. This means that you > > >> can not remove them. You can however detect if > > there is any at all for a > > >> given event. > > >> _______________________________________________ > > >> Flashcoders mailing list > > >> Flashcoders@chattyfig.figleaf.com > > >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > >> > > > > > > Karl DeSaulniers > > > Design Drumm > > > http://designdrumm.com > > > > > > > > > _______________________________________________ > > > Flashcoders mailing list > > > Flashcoders@chattyfig.figleaf.com > > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > _______________________________________________ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > > > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders