Problems removing SWF when loaded

I am trying to load an external .SWF into my current .SWF. I have managed to get it loading onto my application, but then once the animation has finished and i click onto another button, i.e. ‘gallery’ or ‘contact’ i want the swf to be removed, i know i need to add a remove child somewhere but i dont know how. can anyone help. this is my code.

import fl.controls.ProgressBar;
import flash.events.Event;
/*
You must keep the variables and functions you can write
additional ones but you must not start from scratch.
on scene home - delete the layer with named animation and create the animation this size
*/

galleryBT.addEventListener(MouseEvent.CLICK, galleryDisplay);
// used to navigate to the gallery page
function galleryDisplay(event:Event):void{
gotoAndStop(“gallery”);
}
homeBT.addEventListener(MouseEvent.CLICK, homeDisplay);
// used to navigate to the gallery page
function homeDisplay(event:Event):void{
gotoAndStop(“home”);
}
contactBT.addEventListener(MouseEvent.CLICK, contactDisplay);
// used to navigate to the gallery page
function contactDisplay(event:Event):void{
gotoAndStop(“contact”);
}
//loading the animation
var swfRequest:URLRequest = new URLRequest(“assignmentfinal.swf”);
var swfLoader:Loader = new Loader();
var my_pb:ProgressBar = new ProgressBar();
var swfOnStage:Boolean=false;

my_pb.source = swfLoader.contentLoaderInfo;
my_pb.x = 200;
my_pb.y = 600;

function loadFile():void{
addChild(my_pb);
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded, false, 0, true);
swfLoader.load(swfRequest);
swfOnStage=true;
}
loadFile();
function swfLoaded(event:Event):void{
swfLoader.x=40;
swfLoader.y=155;
addChild(swfLoader);
removeChild(my_pb);
swfOnStage=false;
}

stop();