
|
<p>It does not seem to be possible to unload the data currently.</p>
<p>it would be nice to be able to unload data you do not need anymore
</p>
|
 Matan Uberstein
|
What do you mean exactly? All loaders have a destroy function which closes all streams and removes any internal listeners. Are you referring to loader.unload() as in the native Loader’s unload function?
Native unload()
Or are you referring to disposing of bitmap data?
I can confirm that if you destroy a loader and null your reference to it, the flash player will GC it.
I’ll have a closer look into the GC process, there might be nice additions to be made in this regard.
PS: AssetLoader v3 is in the making.
Thanks for posting!
|

|
I am referring to both loader unload and content.
But I am especially referring to unloading of classes loaded through swf. By default classes contained inside loaded swf are added to the main application domain and since there is always a reference to the main application domain, the classes are kept in memory.
By specifying other application domain to the loaders, it is then possible to completely unload these classes. But as we use them we also need to keep track of the application domain (and use applicationDomain.getDefinition.
Currently your swfloader give you the main swf entry point as a Sprite and thus is probably intended to use the a animation in itself. In games there is need sometimes to load swf that contain classes that you instantiate when needed. Then when these classes are no more necessary, you unload them by both unloadign the loader and getting rid of the applicationdomain in whcih their definitions was stored.
I don’t know whether this usage shoudl be part of your api but it woudl be nice to have a unlaod function that could uinload both loader and content.
Just a proposition
Thanks for your great work by the way, I have started using it for some project and it is very useful
|
 Matan Uberstein
|
Ok, great, I’ll have a deeper looking into unloading of the applicationDomain. I might need to pick your brains when it comes to it, if you are willing to lend a hand.
Thanks again for your contribution and the kind words. Do you have more ideas/opinions? Please have a look at AssetLoader v3 – Ideas/Roadmap[/url] to see what new API changes I have in mind, maybe leave a suggestion/idea of your own.
|