Hi there,

I'm very much a newbie to the actionscript side of things, so please bear with me.

I've been following a computer arts tutorial to design a dynamic portfolio.

Its a good tutorial, I've been able to adapt it fully and am really happy with the results, bar one problem.
When I try and load more than one page the dynamic menus from the first scene wont go away.
I want to put several portfolios onto the one site and possibly use the xml technique to load other stuff too.

I'm guessing the coding for each new scene needs a line in it to to stop the other xml movie from running - could any of you kind souls please help me out with a clue as to what that line might be?

here is the as I've been using for it :

// Setup some initial variables

// Hide the button that will display a web link
_root.theUrl._visible = 0;

// Hide the image icons in the project loader
// The image icons are simply there to make it easier for you to
// select the movieClip from the main timeline.
_root.img_project.photo_icon._visible = 0;
_root.img_project.img_holder.photo_icon2._visible = 0;

// name of the folder for all thumbs and swf files
_root.imageFolder = "project_files/";

// Create arrays ready for the xml data
namesArray = new Array();
linksArray = new Array();
descriptionsArray = new Array();
filesArray = new Array();

// Load XML doc
objXML = new XML();
objXML.onLoad = loadXML;
objXML.ignoreWhite = true;
// The name of your XML file
objXML.load("ss_flash_newhome.xml");

/////////////////////////////////////////////////////////////////////////////////////////

// onLoad XML function
function loadXML(success) {
if (success) {
// If the XML loads successfully, count how many projects there are in the file.
_root.projectCount = this.firstChild.childNodes.length; // PROJECT node in XML file
// Then run a function that builds arrays out of the XML data.
SS_Arrays();
} else {
// If the xml data did not load, show message on stage by populating the description field.
_root.description = "Error: Could not load XML";
}
}

/////////////////////////////////////////////////////////////////////////////////////////

function SS_Arrays() {
for (var count = 0; count < _root.projectCount; count++) {
var nodeObj = objXML.firstChild.childNodes[count];
namesArray[count] = nodeObj.attributes.name;
descriptionsArray[count] = nodeObj.attributes.description;
linksArray[count] = nodeObj.attributes.link;
filesArray[count] = nodeObj.attributes.file;
}
// run the function to create the thumbnail and list view buttons
SS_createButtons();
}

/////////////////////////////////////////////////////////////////////////////////////////

function SS_createButtons() {
// First of all we want to hide the master button on the stage (btn_projects_main)
// because we'll be making duplicates of it in the next part of the function
_root.btn_projects_main._visible = 0;

// Work out the X and Y positions of the main button so our new buttons start in the same place
// (Which means where ever you position the main button is where the navigation will start).
btn_xPos = _root.btn_projects_main._x;
btn_yPos = _root.btn_projects_main._y;

// Set the distances between your buttons and the number of rows
btn_xDistance = 140;
btn_yDistance = 19;
btn_numOfRows = 5;
// This figure is used to work out when to start a new column of buttons
btn_yMax = btn_yPos + ((btn_numOfRows - 1) * btn_yDistance);

// Loop through the projects array and create a button for each one by duplicating the original.
for (count = 0; count < _root.projectCount; count++) {
duplicateMovieClip(_root.btn_projects_main, "btn_projects" + count, count);
// As the button is created, set it's X, Y & text properties
_root["btn_projects" + count]._x = btn_xPos;
_root["btn_projects" + count]._y = btn_yPos;
_root["btn_projects" + count].text = namesArray[count];

// set the X position for the next button
if(btn_yPos == btn_yMax){
// if the last buttons was the last row in the column (based on it's Y position) then start a new column
// by resetting the Y position and adding 140px (btn_xDistance) to the the X position.
btn_xPos = btn_xPos + btn_xDistance;
btn_yPos = _root.btn_projects_main._y;
} else {
// if it's not the last one in a row, simply move it along the Y axis.
btn_yPos = btn_yPos + btn_yDistance;
}
}

// Load the first project (number 0) to avoid an empty screen
SS_load_project(0);

// Make the first project button highlighted
tellTarget(_root.btn_projects0){
gotoAndPlay(3);
}
// Set the current button variable so we know which button to switch off when another one is pressed
_root.curButton = "0";
}

/////////////////////////////////////////////////////////////////////////////////////////

function SS_load_project(arrayNumber){

/////////////////////////////////////////////////////////////////////////////////////////

// Progress bar stuff: This creates a new movie clip on the stage
// and shows the progress of the image or file being loaded

_root.createEmptyMovieClip("progressBar_mc", 1000);
progressBar_mc.createEmptyMovieClip("bar_mc", 1001);
// Using the flash drawing method, draw a box 550px wide by 2px deep
// with a fill of red (FF0000)
with (progressBar_mc.bar_mc) {
beginFill(0xFF0000, 100);
moveTo(0, 0);
lineTo(660, 0);
lineTo(660, 2);
lineTo(0, 2);
lineTo(0, 0);
endFill();
_xscale = 0;
}

// set the X & Y positions of the progress bar manually
//progressBar_mc._x = 160;
//progressBar_mc._y = 218;

// Or set them to be the same X & Y as the project file/image.
progressBar_mc._x = img_project._x;
progressBar_mc._y = img_project._y;

// set the initial width of the bar to zero
var mclListener:Object = new Object();
mclListener.onLoadStart = function(target_mc:MovieClip) {
progressBar_mc.bar_mc._xscale = 0;
}

// increase the width (xscale) of the bar as the file loads
mclListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
progressBar_mc.bar_mc._xscale = Math.round(bytesLoaded/bytesTotal*100);
// Make sure the clip being loaded doesn't play until it is fully loaded.
// If you want content to stream as it loads remove the following 3 lines
tellTarget(_root.img_project.img_holder){
stop();
}
}

// once the file has loaded, remove the progress bar from the stage
mclListener.onLoadComplete = function(target_mc:MovieClip) {
progressBar_mc.removeMovieClip();
// Plays the loaded clip once it's fully loaded.
// If you want content to stream as it loads remove the following 3 lines
tellTarget(_root.img_project.img_holder){
play();
}
}

/////////////////////////////////////////////////////////////////////////////////////////

// Load the project file onto the stage by loading it into a movieClip (which in this case
// is inside another one img_project > img_holder.

var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);

// load the clip onto the stage into a movieClip
image_mcl.loadClip(_root.imageFolder + _root.filesArray[arrayNumber], img_project.img_holder);

// Populate the dynamic text fields on the main stage with the project title & description
_root.prj_name = _root.namesArray[arrayNumber];
_root.prj_description = _root.descriptionsArray[arrayNumber];

// if the URL is present for this project, populate & show the link
if(_root.linksArray[arrayNumber] != "") {
_root.btn_link.webAddress = _root.linksArray[arrayNumber];
_root.btn_link._visible = 1;
} else {
_root.btn_link._visible = 0;
}

// Reset the last button
tellTarget("_root.btn_projects" + _root.curButton){
gotoAndPlay(1);
}

// Replace the current button variable with this projects id/number
_root.curButton = arrayNumber;
}


stop();


I;d be massively greatful for any help, kind regards and fingers crossed!