Nieuw lid |
|
slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("slides.xml");
slides_xml.ignoreWhite = true;
//
// Show the first slide and intialize variables
function startSlideShow(success) {
if (success == true) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
currentIndex = 1;
updateSlide(firstSlideNode);
}
}
//
// Updates the current slide with new image and text
function updateSlide(newSlideNode) {
imagePath = newSlideNode.attributes.jpegURL;
slideText = newSlideNode.firstChild.nodeValue;
loadMovie(imagePath, targetClip);
}
//
// Event handler for 'Next slide' button
next_btn.onRelease = function() {
nextSlideNode = currentSlideNode.nextSibling;
if (nextSlideNode == null) {
break;
} else {
currentIndex++;
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
};
//
// Event handler for 'Previous slide' button
back_btn.onRelease = function() {
previousSlideNode = currentSlideNode.previousSibling;
if (previousSlideNode == null) {
break;
} else {
currentIndex--;
currentSlideNode = previousSlideNode;
updateSlide(previousSlideNode);
}
};
slides_xml = new XML(); slides_xml.onLoad = startSlideShow; slides_xml.load("slides.xml"); slides_xml.ignoreWhite = true; // // Show the first slide and intialize variables function startSlideShow(success) { if (success == true) { rootNode = slides_xml.firstChild; totalSlides = rootNode.childNodes.length; firstSlideNode = rootNode.firstChild; currentSlideNode = firstSlideNode; currentIndex = 1; updateSlide(firstSlideNode); } } // // Updates the current slide with new image and text function updateSlide(newSlideNode) { imagePath = newSlideNode.attributes.jpegURL; slideText = newSlideNode.firstChild.nodeValue; loadMovie(imagePath, targetClip); } // // Event handler for 'Next slide' button next_btn.onRelease = function() { nextSlideNode = currentSlideNode.nextSibling; if (nextSlideNode == null) { break; } else { currentIndex++; updateSlide(nextSlideNode); currentSlideNode = nextSlideNode; } }; // // Event handler for 'Previous slide' button back_btn.onRelease = function() { previousSlideNode = currentSlideNode.previousSibling; if (previousSlideNode == null) { break; } else { currentIndex--; currentSlideNode = previousSlideNode; updateSlide(previousSlideNode); } };
<Slides>
<slideNode jpegURL="images/image1.jpg" width="770" height="372">A sea horse</slideNode>
<slideNode jpegURL="images/image2.jpg" width="770" height="372">Sea anemone</slideNode>
</Slides>
<Slides> <slideNode jpegURL="images/image1.jpg" width="770" height="372">A sea horse</slideNode> <slideNode jpegURL="images/image2.jpg" width="770" height="372">Sea anemone</slideNode> </Slides>
|