aditkohli
asked on
Flash as 3.0 Loader Memory extending
Hi, I have a main file with a loader+ 2 buttons in it which loads & unloads 2 external ".swf" files and a trace to monitor the System.totalMemory. PROBLEM IS after my unload command the memory dosnot get's free and even increasing on every load then unload command.
var loaderObj:Loader
var sp:Sprite= new Sprite()
function mcLoad(e:MouseEvent){
loaderObj= new Loader();
loaderObj.name='tension';
var str:String="i.jpeg";
loaderObj.load(new URLRequest(str));
sp.addChild(loaderObj);
stage.addChild(sp)
}
function mcUnload(e:MouseEvent){
loaderObj.unload();
sp.removeChild(loaderObj);
stage.removeChild(sp)
trace(System.totalMemory);
}
b0.addEventListener(MouseEvent.CLICK,mcLoad);
b1.addEventListener(MouseEvent.CLICK,mcUnload);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try using Loader.unloadAndStop(). This is allow help clear all references to the Loader and make it accessible for garbage collection.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.