[RESOLVED] Flash Action Script 3 - Unload swfs
Hi,
I have written this code to unload the swf that is the splash page for my flash site:
Quote:
function homeHandler(event:MouseEvent) {
txtwelcome.visible = false;
var swfURLReq:URLRequest = new URLRequest(homeURL);
holder.load(swfURLReq);
btnEnter.visible = false;
}
As you can see I have just hidden the objects on the stage from the user so they don't appear on the new page.
Also, on the home page since the pages are being stored in a loader object I have used the following method:
Quote:
function homeHandler(event:MouseEvent) {
holder.unload()
var swfURLReq:URLRequest = new URLRequest(homeURL);
holder.load(swfURLReq);
}
Is it acceptable to use the one urlrequest and just assign new values to it or should I create a new urlrequest each time and use case statement to determine which urlrequest was triggered and just select that particular object to close?
Thanks,
Nightwalker
Re: Flash Action Script 3 - Unload swfs
I found the answer I was looking for:
http://forums.adobe.com/thread/457854
Quote:
it's better to use a different loader for each object loaded. and when a loaded object is no longer needed the loader should be readied for gc (and gc' if you're publishing for fp 10).