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