The issue I have after I change the image, the setInterval timer does not reset itself. 5 second delay starts, but when a new image is loaded, the 5 second delay does not reset.
Code
----------------------------------------------
slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("slides.xml");
slides_xml.ignoreWhite = true;
function startSlideShow(success) {
if (success == true) {
rootNode = slides_xml.firstChild;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
updateSlide(firstSlideNode);
setInterval(timer,5000);
}
}
function timer(){
nextSlideNode = currentSlideNode.nextSibling;
if (nextSlideNode == null) {
updateSlide(rootNode.firstChild);
currentSlideNode = rootNode.firstChild;
} else {
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
}
function updateSlide(newSlideNode) {
imagePath = newSlideNode.attributes.jpegURL;
loadMovie(imagePath, targetClip);
}
next_btn.onRelease = function() {
nextSlideNode = currentSlideNode.nextSibling;
if (nextSlideNode == null) {
updateSlide(rootNode.firstChild);
currentSlideNode = rootNode.firstChild;
} else {
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
};
back_btn.onRelease = function() {
previousSlideNode = currentSlideNode.previousSibling;
if (previousSlideNode == null) {
currentSlideNode = rootNode.lastChild;
updateSlide(rootNode.lastChild);
} else {
currentSlideNode = previousSlideNode;
updateSlide(previousSlideNode);
}
};
Code
----------------------------------------------
slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("slides.xml");
slides_xml.ignoreWhite = true;
function startSlideShow(success) {
if (success == true) {
rootNode = slides_xml.firstChild;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
updateSlide(firstSlideNode);
setInterval(timer,5000);
}
}
function timer(){
nextSlideNode = currentSlideNode.nextSibling;
if (nextSlideNode == null) {
updateSlide(rootNode.firstChild);
currentSlideNode = rootNode.firstChild;
} else {
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
}
function updateSlide(newSlideNode) {
imagePath = newSlideNode.attributes.jpegURL;
loadMovie(imagePath, targetClip);
}
next_btn.onRelease = function() {
nextSlideNode = currentSlideNode.nextSibling;
if (nextSlideNode == null) {
updateSlide(rootNode.firstChild);
currentSlideNode = rootNode.firstChild;
} else {
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
};
back_btn.onRelease = function() {
previousSlideNode = currentSlideNode.previousSibling;
if (previousSlideNode == null) {
currentSlideNode = rootNode.lastChild;
updateSlide(rootNode.lastChild);
} else {
currentSlideNode = previousSlideNode;
updateSlide(previousSlideNode);
}
};