I have been running into a problem that no matter what I do,
I cannot get an SWF to fully unload, ever. After alot of
contemplation and fooling around, I figured out what was happening,
When loading an SWF as child domain to
Application.CurrentDomain, the swf's document class is referenced
in the system Domain, so even after unloading the SWF, all the
classes that were internal to it maintain references in the system
Domain. I even used the hack (calling a netConnection twice) to
force a garbage collection pass, still the swf would not unload.
You can't remove an ApplicationDomain Object, or a class
definition, so if you load an SWF it will be immortal, even if you
unload it. In AS 2.0 you could call unloadMovieClip, and then with
the parent SWF still open, you could republish the previously
loaded swf. This doesn't appear to be possible in AS 3.0.
Is this a bug, or am I completely missing something?