Few Problems

I have two separate issues with this code. There should be a preloader for every thumbnail and I’m getting an error on removing the preloader.

import flash.events.*;
var myImages:XMLList;
var myTotal:Number;
var image:String;
var src:XMLList;
var columns:Number;
var myX:Number;
var myY:Number;
var containerMC:MovieClip;
var preloaderMC:MovieClip;
var pc:LoadIndicator;

var fullMC:MovieClip;
var myThumbWidth:Number = 97;
var myThumbHeight:Number = 97;
var xCounter:Number = 0;
var yCounter:Number = 0;

// load the xml
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("thumbs.xml"));
xmlLoader.addEventListener(Event.COMPLETE, processXML);

function processXML(e:Event):void {
    var xml:XML = new XML(e.target.data);
    image = xml. @ image;
    myImages = xml.image;
    src = myImages. @ src;
    columns = xml. @ columns;
    myX = xml. @ xposition;
    myY = xml. @ yposition;
    myThumbWidth = xml. @ WIDTH;
    myThumbHeight = xml. @ HEIGHT;
    myTotal = myImages.length();
    // For garbage collection
    xmlLoader.removeEventListener(Event.COMPLETE, processXML);
    xmlLoader = null;
    // Load the images and place them on the clips
    makeContainer();
    placeThumb();


}
function makeContainer():void {
    containerMC = new MovieClip();
    containerMC.x = myX;
    containerMC.y = myY;
    addChild(containerMC);

    // containerMC.addEventListener(MouseEvent.CLICK, callFull);
    containerMC.addEventListener(MouseEvent.MOUSE_OVER, clipOver);
    containerMC.addEventListener(MouseEvent.MOUSE_OUT, clipOut);
    containerMC.buttonMode = true;
    preloaderMC = new MovieClip();
    preloaderMC.x = containerMC.x;
    preloaderMC.y = containerMC.y;
    addChild(preloaderMC);
    // trace(preloaderMC + "preloader Movie Clip is on the stage now");
}
// Put the images onto the clips
function placeThumb():void {
    for (var i:int = 0; i < myTotal; i++) {
        var thumbURL = myImages*. @ src;
        var thumbLoader = new Loader();
        thumbLoader.load(new URLRequest(thumbURL));
        thumbLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded);
        thumbLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
        thumbLoader.name = i;
        // Space out thumbs
        thumbLoader.x = (myThumbWidth+15) * xCounter;
        thumbLoader.y = (myThumbHeight+15) * yCounter;
        thumbLoader.alpha = .65;
        if (xCounter + 1 < columns) {
            xCounter++;
        } else {
            xCounter = 0;
            yCounter++;
        }
        thumbLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, donePB);
    }
}
function thumbLoaded(e:Event):void {
    var myThumb:Loader = Loader(e.target.loader);
    containerMC.addChild(myThumb);
    
    myThumb.contentLoaderInfo.removeEventListener(Event.COMPLETE, thumbLoaded);
    
    
}
function loop(e:ProgressEvent):void {
    var l:Loader = Loader(e.currentTarget.loader);
    var pc:LoadIndicator = new LoadIndicator();
    preloaderMC.addChild(pc);
    var perc:Number = e.bytesLoaded / e.bytesTotal;// calculate bytesloaded divided by bytestotal
    pc.percent.text = Math.ceil(perc * 100).toString() + "%";
    percent.text = Math.ceil(perc * 100).toString() + "%";
}
function donePB(e:Event):void {
    var myPB:Loader = Loader(e.currentTarget.loader);
    percent.text = "";
    removeChild(preloaderMC);
    // For garbage collection
    myPB.removeEventListener(Event.COMPLETE, donePB);
}

function clipOver(e:MouseEvent):void {
    var myThumb:Loader = Loader(e.target);
    var thumbAlpha:Number = myThumb.alpha;
    if (myThumb.alpha == thumbAlpha) {
        myThumb.alpha = 1;
    } else {
        myThumb.alpha = .65;
    }
    removeEventListener(MouseEvent.MOUSE_OVER, clipOver);

}
function clipOut(e:MouseEvent):void {
    var myThumb:Loader = Loader(e.target);
    var thumbAlpha:Number = myThumb.alpha;
    if (myThumb.alpha == thumbAlpha) {
        myThumb.alpha = .65;
    }
    removeEventListener(MouseEvent.MOUSE_OUT, clipOut);
}

Even with the error, the code works.