AS2: Removing MovieClips with Event Listeners

Posted on August 12, 2008

0


In ActionScript 2 (Flash), movies that are still referenced by – for instance – an event listener, can not be removed by {movieClip}.removeMovieClip().

When removing a movieclip, it would be logical to assume that everything will be deposed of. It is more important to destroy something because you do not need it than keep it alive, because something else MIGHT need it.

The creators of the Flash Engine decided apparently that keeping it alive because something MIGHT need it is more important than just tossing it away because the programmer / developer / designer thinks it to be obsolete at that point in time.

DESTROYED-event

I rather have an event dispatcher telling me that the object I was listening to has been destroyed, so that I can deal with any possible problems out of that myself.

Apparently Flash 9 still has the same issue and hopefully Flash 10 will have it resolved. It sucks. Especially when the project you are working on is not your own making.

Advertisements
Posted in: Uncategorized