Thank you both for the reply.

Hilary, your example has been very helpful. Correct me if I'm wrong (very likely) but even though you unload the swfContent wouldn't it still be in memory? From my very brief read up of garbage collection wouldn't it still exist unless you removed myLoader references, probably with myLoader = null, then removed it from the application with this.removeChild('myLoader')?

I'll keep on eye on that blog for future tips.

Cheers
Angus

On 07/07/06, Jeremy Lu < [EMAIL PROTECTED]> wrote:


Resource management and garbage collection is a lot different then it used to be, here's a great post on it (from Grant Skinner's blog):

http://www.gskinner.com/blog/archives/2006/07/as3_resource_ma_1.html

The point is, you should stop all playing sound, remove all listeners from EventDispatcher and nullified the Display Object or loaded swfs.

I believe in the years to come, this issue will be brought up again and again :-)

Jeremy.



On 7/6/06, Angus Johnson < [EMAIL PROTECTED]> wrote:

Hi,

I have a canvas called parentView into which I add SWF child objects via...

parentView.addChild(mySWF);
mySWF.load();

No problems loading. When I want to change the contents of parentView and swap out the loaded SWF I run...

parentView.removeAllChildren();
// get new mySWF
parentView.addChild(mySWF);
mySWF.load();

Now I have noticed that the previous SWF's don't seem to unload. I have an example that runs a sound clip and I can still hear that playing even if I have replaced mySWF content in the parent several times. I also noticed that flash memory usage continues to increase with each load so something is wrong. Debug correctly shows only one child loaded.

SWFLoader class does't have an unload() method. removeAllChildren() should work right?

Cheers
Angus




__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





YAHOO! GROUPS LINKS




__,_._,___

Reply via email to