Muzak, I've got that already.

function timerHandler(event:TimerEvent):void {
        trace(this.removeChildAt(0)); // remove loaded swf from display list
        mLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, 
onCompleteHandler);
        mLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, 
onProgressHandler);       
        mLoader.unloadAndStop();
        mLoader = null;
        mLoader =  new Loader(); // clear from memory
        startLoad();
        trace("timerHandler: " + event);
}

Thanks, T

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Muzak
Sent: Friday, October 02, 2009 5:38 AM
To: Flash Coders List
Subject: Re: [Flashcoders] [MEMORY LEAK]

I'd say, keep the loader instance (instead of creating a new one each time) and 
unload the loader "content" (the swf) using 
Loader.unloadAndStop.
http://kb2.adobe.com/cps/403/kb403670.html

http://www.gskinner.com/blog/archives/2008/07/additional_info.html

regards,
Muzak

----- Original Message ----- 
From: "Gregory Boland" <[email protected]>
To: "Flash Coders List" <[email protected]>
Sent: Friday, October 02, 2009 5:57 AM
Subject: Re: [Flashcoders] [MEMORY LEAK]


> All I can say is that you aren't releasing all of the references to this
> material that you are trying to release from memory.
>
> So after you make this call
>
> addChild(loadEvent.currentTarget.content);
>
> make that = to null as well as any other time that you are referring to this
> content you are trying to rid.
>
> I know if you run your program in Flex Builder and choose the profiler, you
> can actually purge the garbage manually and see if the object you want to be
> deleted gets purged.  If it hasn't then there is still something that is
> referencing it.  However, after looking at your code it seems that you are
> writing it on the timeline and i'm not sure how you would go about putting
> that into Flex Builder.
>
> best of luck
>
> greg

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to