I’m creating my portfolio in Flash CS3. I have five buttons in website.swf. I also have five external swf files.
If you click a button, it loads an external swf. If you click another button, it unloads the first swf and loads the next one. Is there anyway to unload it and load the next? thanks in advance.
stop();
function loadMain(e:MouseEvent):void{
var loadMain:Loader = new Loader();
loadMain.load(new URLRequest(“main.swf”));
stage.addChild(loadMain);
}
main_btn.addEventListener(MouseEvent.CLICK, loadMain);
function loadAbout(e:MouseEvent):void{
var loadAbout:Loader = new Loader();
loadAbout.load(new URLRequest(“about.swf”));
stage.addChild(loadAbout);
}
about_btn.addEventListener(MouseEvent.CLICK, loadAbout);
function goMain(e:MouseEvent):void{
gotoAndStop(“Main”);
}
main_btn.addEventListener(MouseEvent.CLICK, goMain);
function goAbout(e:MouseEvent):void{
gotoAndStop(“About”);
}
about_btn.addEventListener(MouseEvent.CLICK, goAbout);