Hi T,

No solution here, but this might relate to your current problem:
http://www.gskinner.com/blog/archives/2008/04/failure_to_unlo.html


C:
 

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of TS
Sent: Thursday, 1 October 2009 10:53 AM
To: 'Flash Coders List'
Subject: [Flashcoders] [MEMORY LEAK]

Hello, this issue is killing me. I had a swf that loaded an xml file
then loaded images from the xml file and then killed the display list,
xml, images etc... then restarted based on a timer. Every time it
reloads however, I watch firefox take away memory consistently and when
I refresh that page memory use drops back to normal. So, I said screw
this, I'm going to create an empty swf and load the swf with all the
magic in it and add it to the empty swf. I figured if I add the swf to
the main stage and kill that one reference to the swf when I was done
with it, I should have fixed my problem. Here's my code. Can someone
please tell me what is going on? 


stop();

var mLoader:Loader = new Loader();
function startLoad()
{
        var mRequest:URLRequest = new
URLRequest("hasch_flash/currently_watched_videos.swf");
        //var mRequest:URLRequest = new
URLRequest("currently_watched_videos.swf");
        mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
onCompleteHandler, false, 0, true);
        
mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,
onProgressHandler, false, 0, true);
        mLoader.load(mRequest);
}

function onCompleteHandler(loadEvent:Event)
{
        trace("load " + loadEvent.currentTarget.content);
        trace("loadTarget " + loadEvent.target);
        addChild(loadEvent.currentTarget.content);
}
function onProgressHandler(mProgress:ProgressEvent)
{
        var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
        trace(percent);
}
startLoad();


TimerExample();

// Set off timer to kill carousel and restart movie function
TimerExample() {
        var myTimer:Timer = new Timer(30000, 0);
        myTimer.addEventListener("timer", timerHandler);
        myTimer.start();
}

function timerHandler(event:TimerEvent):void {
        trace(this.removeChildAt(0)); // remove from display list
        mLoader = null;
        mLoader =  new Loader(); // clear from memory
        startLoad();
        trace("timerHandler: " + event);
}


Thanks for any advice. T

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
This e-mail, including any attached files, may contain confidential and 
privileged information for the sole use of the intended recipient.  Any review, 
use, distribution, or disclosure by others is strictly prohibited.  If you are 
not the intended recipient (or authorized to receive information for the 
intended recipient), please contact the sender by reply e-mail and delete all 
copies of this message.

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

Reply via email to