Hey all, I got part of the way with help from this forum, and I’m sure it’s just a small tweak, but I can’t seem to figure out where it is. Here’s my code:
var p = 0, delay = 3000, r = 0;
//-----------------------
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
link = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
link* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("upcoming.xml?cachebuster=" + new Date().getTime());
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
picture.onRelease = function() {
getURL(link[p], "_blank");
};
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
slideshow();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
slideshow();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
p = 0;
firstImage();
} else {
nextImage();
}
}
function loadXML2(loaded2) {
if (loaded2) {
xmlNode2 = this.firstChild;
image2 = [];
link2 = [];
totalRight = xmlNode2.childNodes.length;
for (i=0; i<totalRight; i++) {
image2* = xmlNode2.childNodes*.childNodes[0].firstChild.nodeValue;
link2* = xmlNode2.childNodes*.childNodes[1].firstChild.nodeValue;
}
firstImage2();
} else {
content = "file not loaded!";
}
}
xmlData2 = new XML();
xmlData2.ignoreWhite = true;
xmlData2.onLoad = loadXML2;
xmlData2.load("sponsors.xml?cachebuster=" + new Date().getTime());
/////////////////////////////////////
listen2 = new Object();
listen2.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage2();
} else if (Key.getCode() == Key.RIGHT) {
nextImage2();
}
};
Key.addListener(listen2);
previous_btn2.onRelease = function() {
prevImage2();
};
next_btn2.onRelease = function() {
nextImage2();
};
/////////////////////////////////////
this.onEnterFrame = function() {
filesize2 = picture2.getBytesTotal();
loaded2 = picture2.getBytesLoaded();
preloader2._visible = true;
if (loaded2 != filesize2) {
preloader2.preload_bar2._xscale = 100*loaded2/filesize2;
} else {
preloader2._visible = false;
picture2.onRelease = function() {
getURL(link2[p2], "_blank");
};
if (picture2._alpha<100) {
picture2._alpha += 10;
}
}
};
function nextImage2() {
if (p2<(total-1)) {
p2++;
if (loaded2 == filesize2) {
picture2._alpha = 0;
picture2.loadMovie(image2[p], 1);
desc_txt2.text = description2[p];
picture_num2();
slideshow2();
}
}
}
function prevImage2() {
if (p2>0) {
p2--;
picture2._alpha = 0;
picture2.loadMovie(image2[p2], 1);
desc_txt2.text = description2[p2];
picture_num2();
}
}
function firstImage2() {
if (loaded2 == filesize2) {
picture2._alpha = 0;
picture2.loadMovie(image2[0], 1);
desc_txt2.text = description2[0];
picture_num2();
slideshow2();
}
}
function picture_num2() {
current_pos2 = p+1;
pos_txt2.text = current_pos2+" / "+total;
}
function slideshow2() {
myInterval2 = setInterval(pause_slideshow2, delay2);
function pause_slideshow2() {
clearInterval(myInterval2);
if (p2 == (total-1)) {
p2 = 0;
firstImage2();
} else {
nextImage2();
}
}
}
}
Any help you guys could give would be greatly appreciated! Thanks in advance!
< m >