addChild minor issue

Alright, I have a class assignment I am almost through with, but I have one single issue. I have a main swf file with this code:



var photo:MovieClip=new MovieClip();
var request:URLRequest=new URLRequest("php/flash/myPhotos.php");
request.method=URLRequestMethod.GET;
var loader:URLLoader=new URLLoader();
loader.dataFormat=URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, completePhotoLoad);
loader.load(request); 
function completePhotoLoad(e:Event){

    var numPhotoContainers=e.target.data.numPhotoContainers;
    if(numPhotos!=0){

        for(var i=1;i<=numPhotoContainers;i++){

            var myPhotoContainer = e.target.data['myPhotoContainer_'+i];
            var myPhoto_x = e.target.data['x_'+i];
            var myPhoto_y = e.target.data['y_'+i];
            var containerCap = e.target.data['capTxt'+i];
            var photoLoader:Loader=new Loader();
            var itemReq:URLRequest=new URLRequest(myPhotoContainer);
            photoLoader.load(itemReq);
            photoLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
        }
        function onComplete(e:Event){
                photo=e.currentTarget.content as MovieClip;
            photo.x=0;
            photo.y=0;
            photo.randPhoto.x=myPhoto_x;
            photo.randPhoto.y=myPhoto_y;
            photo.randphoto.capTxt.text=containerCap;
            photoHolder.addChild(e.currentTarget.content);
        }
    }
}


The code loads the selected containers but stacks them on top of each other in the location of the last loaded. I know its a problem with the onComplete function, I just don’t know what to do to sort this out, it has been frustrating me all day :hang: I have tried all the tricks in my arsenal and almost drop kicked my computer. If anyone would like to help me out a bit and save my computers life, go for it, any help is appreciated. I just want to finish this. :ninja: