August 15, 2003
Stop listening. Now listen.
I found a bug in the Flash6 player that does not properly unload all listeners contained within a loaded movie. If a loaded movie creates listeners, they should be removed when the movie is unloaded. They are not. If your project loads and unloads movies repeatedly, these listeners can pile up and really slow things down.
I had a project that loaded/unloaded the same movie clip repeatedly, and there were listeners in one of the components within the clip (a text editor).
The movie became very slow, as these listeners accumulated. I worked around this by editing the component to look for a global pointer to the listener, and remove the listener before adding a new one. That way, if one exists already, it would be removed before creating a new one.
This worked around my problem, and my project 's performance improved greatly.
I got a tip from Moock that you can use the _listeners array to access all of the listeners currently running.
For example: Key._listeners.length would give you the number of listeners currently being handled by the Key object.
Posted by andy at August 15, 2003 05:15 PM