Can't remove all loaded children in a gallery because can't close() a loader!

0 down vote favorite
This is the code i used in a gallery that loads images sequentally. My problems comes in when you have to open a different image album and have to eliminate all the previously loaded children in the movieclip. The problem is that sometimes the user leaves the album page before ALL the pics laod so when they click on a new album to open it a new image is placed somewhere else cause the loader has already been launched. I’ve tryd to close() the loader but it doesn’t seem to work. I’d appreciate it inmensly if you can give me a hand. Thanks in advanced. Here you can see the working site www.barbarabritvin.com (to see what im talking about you have to click on an album, leave before all the pictures load and open up another one. Cheers from Argentina!

getImage(dataList[0].file)

function getImage(href:String):void {

var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageReady);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, showProgress);
loader.x=xCounter
loader.load(new URLRequest(href));

}

function imageReady(e:Event):void {
var bitmap:Bitmap=e.target.content;
if (bitmap!=null) {
bitmap.smoothing=true;
}

displayLarge2.thumb_loader.thumbHolderInside.addChildAt(e.target.loader,0)
yaCargo=true

trace(“NUMCHILDREN”+displayLarge2.thumb_loader.thumbHolderInside.numChildren)

collection.push(e.target.content);
xCounter=xCounter+e.target.loader.width+3
imagecounter++;
if(imagecounter < dataList.length() && loadingPics==true) {
getImage(dataList[imagecounter].file);
}

}

function clearThumbs():void
{
while(displayLarge2.thumb_loader.thumbHolderInside.numChildren > 0)
{
//Remove the first child until there are none.
displayLarge2.thumb_loader.thumbHolderInside.removeChildAt(0);
}
}

displayLarge2.close.addEventListener(MouseEvent.CLICK, closeAlbum)

function closeAlbum(e:MouseEvent):void{
displayLarge2.thumb_loader.thumbHolderInside.enabled=false
loadingPics=false

        while(displayLarge2.thumb_loader.thumbHolderInside.numChildren&gt;0) 
{ 
      displayLarge2.thumb_loader.thumbHolderInside.removeChildAt(0)
} 


    trace("NUMCHILDREN"+displayLarge2.thumb_loader.thumbHolderInside.numChildren)

imagecounter=0
xCounter=0

displayLarge2.enabled=false
displayLarge2.mouseChildren=false

var scrollerTween=TweenManager.create(displayLarge2,“alpha”,Regular.easeIn,1,0,0.5,true);
scrollerTween.addEventListener(TweenEvent.MOTION_FINISH, doNextTween)
function doNextTween(e:TweenEvent):void{

sectionThumbs.enabled=true
sectionThumbs.mouseChildren=true
displayLarge2.visible=false

var          thumbsTween=TweenManager.create(sectionThumbs,"alpha",Regular.easeIn,0,1,0.5,true);
scrollerTween.removeEventListener(TweenEvent.MOTION_FINISH, doNextTween)

}

}