i have problem with memory usage in flash, I successfully unload and remove loaded SWF's from the stage but i can't remove loaded memory and also the fps is dropping down from 30 to 18.
How i load the SWF in to memory
- I have swfUrlArray Array where i keep the SWF names (addreses ex. "intro.swf").
- I have swfModules Dictonary where i keep the loaded SWF's.
I loading them like this:
mLoader = new Loader(); var mRequest:URLRequest = new URLRequest(url); mLoader.load(mRequest); mLoader.x = pozX; mLoader.y = pozY; swfModules[url] = mLoader; swfUrlArray.push(url); currentLoaded = url; addChild(mLoader);Removing the SWF's in the loop
for(var i=0; i < swfUrlArray.length; i++) { if(swfModules[swfUrlArray[i]] != null) { swfModules[swfUrlArray[i]].unloadAndStop(); removeChild(swfModules[swfUrlArray[i]]); } swfUrlArray=[]; }What i suspect here is that loop is too fast to flash to unload the SWF's memory for all files at same time. Please any suggestions or ides for this problem.