Not only is it better, but definitely best practice. The most basic
method is to include a listener destroyer function within the class so
that it can deactivate itself before being removed, eg:

SomeMovieClip.destroyMe();
removeChild(SomeMovieClip);
SomeMovieClip = null;

there are fancier ways to handle this of course but thats the basic concept.

http://www.almogdesign.net/blog/actionscript-3-event-listeners-tips-tricks/

.m

On Wed, Jan 6, 2010 at 5:19 PM, ktt <[email protected]> wrote:
> Hello,
>
> After
>
> removeChild(SomeMovieClip);
> SomeMovieClip = null;
>
> it will removed and will wait for garbage collector.
> But maybe it is better to remove most unwanted listeners before nullifying 
> the MovieClip and not wait for garbage collector?
> It should save some memory space and time for actually "working" MovieClips 
> and Events.
> What do you think?
>
> Ktt
>
>
>
> _______________________________________________
> 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