Load SWF at enterFrame

I have this page that I want to auto load the “HOME” mc.
From there I want the buttons to navigate the page.
I have got the buttons to work properly so far, but cannot for the life of me figure out how to load the HOME swf, then unload it with the same removeChild as the rest of the buttons do…
Here is what works…

 
var thisLoader:Loader = new Loader();
thisLoader.contentLoaderInfo.addEventListener(Event.INIT, doneLoading);
var thisMC:MovieClip = new MovieClip();
stage.addChild(thisMC);// Add empty MC initially so the nextClip function can be generic
// Tell AS that the loaded file is a movie clip and add it to the stage.
function doneLoading(e:Event):void {
    stage.removeChild(thisMC);
    thisMC = MovieClip(thisLoader.content);
    thisLoader.unload();
    stage.addChild(thisMC);
 thisMC.x = 60;    
    thisMC.y = 300;
    thisMC.play();
}
// "BTN_#" just calls a function that goes to the next file name
btnHome.addEventListener(MouseEvent.CLICK, play1);
function play1(e:MouseEvent):void {
    thisLoader.load(new URLRequest("./mcClips/mc1.swf"));
}
btnAbout.addEventListener(MouseEvent.CLICK, play2);
function play2(e:MouseEvent):void {
    thisLoader.load(new URLRequest("./mcClips/mc2.swf"));
}
 
btnFAQ.addEventListener(MouseEvent.CLICK, play3);
function play3(e:MouseEvent):void {
    thisLoader.load(new URLRequest("./mcClips/mc3.swf"));
}
btnPolicies.addEventListener(MouseEvent.CLICK, play4);
function play4(e:MouseEvent):void {
    thisLoader.load(new URLRequest("./mcClips/mc4.swf"));
}
 

Can someone please assist me on this, once I get past this point I have got the rest figured out.
Thanks
-SlimP

The code you posted shows an empty MC initially. Your problem is that if you were to load a ‘home.swf,’ doneLoading callback wouldn’t correctly start the home MC?

How are you loading the home MC initially? Because it should work as the rest of your pages.

Here is the basic movie…Please take a look and see what you think.
I want clip1.swf (HOME) to automatically load upon start, you say I should just replace the empty clip with this one then?
http://www.downeydesign.com/docs/external_swf.zip

thanks!
-SlimP

It should just be


var thisLoader:Loader = new Loader();
thisLoader.contentLoaderInfo.addEventListener(Event.INIT, doneLoading);
var thisMC:MovieClip = new MovieClip();
stage.addChild(thisMC);// Add empty MC initially so the nextClip function can be generic
// load home
thisLoader.load(new URLRequest("./clip1.swf"));

That did it!
I tried several variations before, but as I sometimes do, I make it more complicated than I should.
Thanks again!
-SlimP

:bounce: