Help. Some of my SWFs refuse to stop playing and I can’t figure out why.
Quick background: My SWF player brings a series of AS3 SWFs onto the stage and later unloads them using the UnloadAndStop function. While some of my SWFs unload correctly (and are collected by the garbage collector), other SWFs continue running in the background, using up memory and processing power.
Here is what I am doing to get the SWF to stop.
- I delete the SWF from the Display List. When I do so, the SWF disappears from the screen but its audio continues to play.
- I then issue the unloadAndStop function. When I do so, it seems to have no effect and the audio continues to play.
Like I said, some of my SWFs stop correctly, but SWFs that create data on the fly (such as creating images of snowflakes), refuse to unloadAndStop.
It is interesting that that I CAN unloadAndStop one of these stubborn SWFs BEFORE it enters the stage. However, once it enters the stage, I am completely unable to stop it.
Also, note that I set the Listener’s useWeakReference to TRUE and I am confident that there are no other references to these SWFs.
I would appreciate any advice on how to stop these AS3 SWFs. I have checked around the internet and cannot find a solution.