I have a portfolio gallery on my website at:
http://www.abbiecrumrine.net
On my portfolio page I have a scrolling menu. Everything works fine until I click on another window. When I go back to the window with my portfolio site, the scrolling menu disappears. Below is the code for the menu. Any ideas why this might be happening?
Thank you.
Code:
stop();
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
intro = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
intro[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
}
portIntro();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
menu1.onRelease = function() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[1], 1);
desc_txt.text = description[1];
intro_txt.text = intro[null];
}
};
menu2.onRelease = function() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[2], 1);
desc_txt.text = description[2];
intro_txt.text = intro[null];
}
};
menu3.onRelease = function() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[3], 1);
desc_txt.text = description[3];
intro_txt.text = intro[null];
}
};
menu4.onRelease = function() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[4], 1);
desc_txt.text = description[4];
intro_txt.text = intro[null];
}
};
menu5.onRelease = function() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[5], 1);
desc_txt.text = description[5];
intro_txt.text = intro[null];
}
};
menu6.onRelease = function() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[6], 1);
desc_txt.text = description[6];
intro_txt.text = intro[null];
}
};
menu7.onRelease = function() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[7], 1);
desc_txt.text = description[7];
intro_txt.text = intro[null];
}
};
menu8.onRelease = function() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[8], 1);
desc_txt.text = description[8];
intro_txt.text = intro[null];
}
};
menu9.onRelease = function() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[9], 1);
desc_txt.text = description[9];
intro_txt.text = intro[null];
}
};
menu10.onRelease = function() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[10], 1);
desc_txt.text = description[10];
intro_txt.text = intro[null];
}
};
/////////////////////////////////////
this.onEnterFrame = function() {
currentMousex = Math.floor(this._xmouse)-75;
if(maxSpeed != false) currentMousex = (currentMousex >= maxSpeed)? maxSpeed : -maxSpeed;
//-----------------------------------------
if(!holdPosition){
for(j=0;j <= totalClips; j++){
var tmpObj = this[clipBaseName + j];
tmpObj._x = Math.floor(tmpObj._x-(currentMousex*slideSpeed));
if(tmpObj._x <= maxleft){tmpObj._x += totalWidth;}
if(tmpObj._x >= maxright){tmpObj._x -= totalWidth;}
}
}
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader2._visible = true;
if (loaded != filesize) {
preloader2.preload_bar2._xscale = 100*loaded/filesize;
} else {
preloader2._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function portIntro() {
desc_txt.text = description[null];
intro_txt.text = intro[0];
}
//Setup////////////////////////////////////////
//totalclips on stage - make sure in the properties panel they are named imgbox1,imgbox2,imgbox3,etc...
var totalClips = 10;
//to stop the clips from moving change to true;
var holdPosition = false;
//applies a max speed for the movie clips (false if no max speed)
var maxSpeed = false;
///////////////////////////////////////////////////
//Defaults
var slideSpeed = 0.05;
var currentMousex = 0;
var clipBaseName = 'menu';
var w_clips = this[clipBaseName + '1']._width+2;
var totalWidth = (totalClips * w_clips);
var maxleft = (menu1._x)+75;
var maxright = (totalWidth/2)+75;
//--