UPDATE, see post 2
Hello again,
[ Praise LoaderMax here ]
I have a question concerning Loadermax.dispose(false).
Same LoaderItem in 2 queues.
When i call queue1.dispose it doesnt matter if i pass true or false.
The LoaderItem/content is deleted anyway.
Why is this ?
Code:
// just some normal XML, nothing nested in XML, no LoaderMax-nodes inside.
var loader1:XMLLoader = new XMLLoader("assets/xml/appConfig.xml", { name:"loader1" } );
var queue1:LoaderMax = new LoaderMax( { name:"queue1", onComplete:handleQueue1} );
var queue2:LoaderMax = new LoaderMax( { name:"queue2", onComplete:handleQueue2} );
queue1.append(loader1); // same Loader
queue2.append(loader1); // same Loader
queue1.load();
queue2.load();
private function handleQueue2(e:LoaderEvent):void
{
trace("There IS content before: " + LoaderMax(LoaderMax.getLoader("queue2")).content );
trace("calling queue1.dispose(false) now");
LoaderMax(LoaderMax.getLoader("queue1")).dispose(false);
//null
trace("NO content in Q2 after q1.dispose: " + LoaderMax(LoaderMax.getLoader("queue2")).content );
//error, loader1 rip
trace("Same as: " + XMLLoader(LoaderMax.getLoader("loader1")).content );
}
In other words: How do i destroy a queue, but still keep the children if they are referenced by another queue ?
Im thinking about using LoaderMax as a kind of "RemoteResource-Manager" because it already offers so much of the functionality i need.
The same Resource might be used in different Modules/Classes each having its own queue with exclusive and commonly used Resources. When i destroy a module, i also want its queue destroyed (but not the LoaderItems/Content).
Is this possible ?