Memory Leak

Sorry, I’m a newb and posted this previously in the wrong section…

Hey, I know there are other posts on here about this problem, but I can’t seem to figure out why this isn’t working. This is a test code I wrote that is suppose to imitate a slideshow. The problem is each cycle of the code uses more memory and I don’t understand how to remove my object from memory.

import fl.transitions.*;
import fl.transitions.easing.*;
var swfLoader:Loader = new Loader;

var curPic:MovieClip = null;
var picTimer:Timer = new Timer(3000);


function slideshow ():void
    var mem:String = 'Before ' + Number( System.totalMemory / 1024 / 1024 ).toFixed( 2 ) + 'Mb';
    trace( mem );
    swfLoader = new Loader;
    swfLoader.load(new URLRequest("christianPic1.swf"));
    swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, picLoaded, false, 0, true)

function picLoaded (E:Event):void
    swfLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, picLoaded);
    curPic =;
    picTimer.addEventListener(TimerEvent.TIMER, nextPic, false, 0, true);    

function nextPic (TE:TimerEvent):void
    picTimer.removeEventListener(TimerEvent.TIMER, nextPic);
    curPic = null;    
    var mem:String = 'After '  + Number( System.totalMemory / 1024 / 1024 ).toFixed( 2 ) + 'Mb';
    trace( mem );