Preloader for external swf?

Hi All-

I’m a flash newbie, and I’d greatly appreciate any help!! I’m working on an image gallery with a set of nine buttons on the left side of my main .fla file, each linked to an external .swf. I was given some code that works wonderfully to accomplish this. However, since the external .swfs are rather large, I tried to add a preloader to each external .swf (the same one I used for my main .fla file). When I test the external swf by itself, the preloader works great! When I test it within the main movie the preloader for the external .swf’s loops continuously, and the movie never plays (same thing happens when you publish the main movie).

So, my questions are:
1. Does anyone know what could be causing the preloader to loop??
2. OR, Is there a way to create a preloader that would work for all of the external swf’s?

The following is the code I am using to make my buttons in the main timeline link to my external swf’s:

//register the loadImage function to fire when the buttons are pressed
BTN1.addEventListener(MouseEvent.CLICK,loadImage);
BTN2.addEventListener(MouseEvent.CLICK,loadImage)
BTN3.addEventListener(MouseEvent.CLICK,loadImage)
//...add the other buttons here

function loadImage(e:MouseEvent){
       //set a variable to hold the path of the images
    var IMGPath:URLRequest;
    
       //this sets the path of the image/swf depending on what button was pressed
    switch(e.target){
        case BTN1: IMGPath = new URLRequest("IMG1.jpg");
                   break;
        case BTN2: IMGPath = new URLRequest("IMG2.jpg");
                   break;
        case BTN3: IMGPath = new URLRequest("IMG3.jpg");
                   break;
          default: trace("Error: loadImage called by unknown button");
                     break;
    }

   //create a loader and load the image    
   var IMGLoader:Loader = new Loader();
   IMGLoader.load(IMGPath)

   //you can position the swf wherever you want before you display it
   IMGLoader.x = 166
   IMGLoader.y = 46

   //add the swf to the stage
   addChild(IMGLoader)
   
}