Preloader not working with External Multiple swf loading! Need Help

My preloader works fine only for the first time, then after it not works ?
I got 3 buttons on the stage which are calling 3 external swfs.
I am getting this Error ?

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display:: DisplayObjectContainer/removeChild()
at Design_fla::MainTimeline/finishLoading()

Here is my code:

import fl.controls.ProgressBar;
var myLoader:Loader = new Loader();
var my_pb:ProgressBar = new ProgressBar();
my_pb.source = myLoader.contentLoaderInfo;
my_pb.x = 100;
my_pb.y = 200;

myLoader.contentLoaderInfo.addEventListener(Event. COMPLETE, finishLoading);
function finishLoading(e:Event):void{
addChild(myLoader);
removeChild(my_pb);
my_pb = null;
}

my_btn1.addEventListener(MouseEvent.CLICK, startLoading);
function startLoading(e:MouseEvent):void{
myLoader.load(new URLRequest(“a1.swf”));
addChild(my_pb);
}

my_btn2.addEventListener(MouseEvent.CLICK, startLoading);
function startLoading(e:MouseEvent):void{
myLoader.load(new URLRequest(“a2.swf”));
addChild(my_pb);
}

my_btn3.addEventListener(MouseEvent.CLICK, startLoading);
function startLoading(e:MouseEvent):void{
myLoader.load(new URLRequest(“a3.swf”));
addChild(my_pb);
}

What Tibetan_Tiger said :stuck_out_tongue: Also…

I suggest only adding your progress bar once and toggling it’s visibilty rather than constantly adding and removing it from the stage.

I think you have to change the function startloading(…) to function startloading1(…),function startloading2(…),function startloading3(…)