Control main.swf through loaded.swf

I’m trying to control my main.swf through a loaded .swf.

My goals are.

  1. load the external swf into main.swf and have a movieclip in the external swf play.
    (the movie clip in the external swf should play without any code, however, when the external swf loads, the movie clip goes to the last frame of itself for some reason)

  2. I have an “X” button on the loaded.swf itself that should dismiss the loaded swf and cause my navigation on my main.swf to reappear.

Here is my loader code in main.swf:

var _urlx:Loader = new Loader();
_urlx.load(new URLRequest("loadBlank.swf"));

var _url1:Loader = new Loader();
_url1.load(new URLRequest("loadBio.swf"));

var _url2:Loader = new Loader();
_url2.load(new URLRequest("loadMedia.swf"));

function loadBlank(e:MouseEvent):void{
	addChild(_urlx);
	
}

function loadBio(e:MouseEvent):void{
	addChild(_url1);
		
}

function loadMedia(e:MouseEvent):void{
	addChild(_url2);
	
}

Here is my code on the loaded.swf:

stop();
btnBack.buttonMode=true;
btnBack.addEventListener(MouseEvent.CLICK, clickHandler);

function clickHandler(event:MouseEvent) {
	MovieClip(parent.parent).navAnimIn(null);
	
}

As of now, my navigation in main.swf does reappear when the “X” in the loaded.swf is clicked, but I need a way to unload the currently loaded swf when the “X” button is clicked…

I’ve tried remove child, checking to see if the loaded child is not null, but that didn’t work either…

Any help would be greatly appreciated…

-Damon