Hi,
I've got a scrollpane, and outside that I have a few buttons working as a nav bar. I want these buttons to load a different movieclip (which isn't in the stage, it's in the library) to the scrollpane.
Using the tutorial on this site (the one where you add or remove a blue movieclip to the scrollpane) I got as far as adding the movieclip to the scrollpane. Problem is, I need the buttons to unload the current movieclip before loading the new one.
(So for example, if the movieclip called "home" is loaded in the scrollpane and I click on the button "Patterns & Textures" I want that button to unload "home" from the scrollpane and load the movieclip "patterns")
My code so far looks like this:
Taken from the kirupa tutorial.
I'm pretty sure I don't need the + i part because I won't have more than one mc in the scrollpane at once, but I don't know how to remove it without screwing it up.
I'm using CS3 and AS2.
I'd greatly appreciate any help!
I've got a scrollpane, and outside that I have a few buttons working as a nav bar. I want these buttons to load a different movieclip (which isn't in the stage, it's in the library) to the scrollpane.
Using the tutorial on this site (the one where you add or remove a blue movieclip to the scrollpane) I got as far as adding the movieclip to the scrollpane. Problem is, I need the buttons to unload the current movieclip before loading the new one.
(So for example, if the movieclip called "home" is loaded in the scrollpane and I click on the button "Patterns & Textures" I want that button to unload "home" from the scrollpane and load the movieclip "patterns")
My code so far looks like this:
Code:
scrollPane.setStyle("borderStyle", "none");
var i:Number=0;
var mcMain:MovieClip;
function init() {
scrollPane.contentPath = "home";
mcMain = scrollPane.content;
trace(mcMain);
}
init();
brushes_btn.onRelease = function() {
mcMain.attachMovie("brushes", "brushes"+i, mcMain.getNextHighestDepth(), {_y:50*i+5, _x:5});
i++;
scrollPane.invalidate();
};
Taken from the kirupa tutorial.
I'm pretty sure I don't need the + i part because I won't have more than one mc in the scrollpane at once, but I don't know how to remove it without screwing it up.
I'm using CS3 and AS2.
I'd greatly appreciate any help!