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 <[email protected]>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
>> [email protected]
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to