Har ju försökt, men det händer ingenting.... Stapel mc är det linkage på. Det ska ju bara visas när det behövs...
slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("pictures.xml");
slides_xml.ignoreWhite = true;
clickSound = new Sound(this);
clickSound.attachSound("klick");
//
// 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 {
//NYA
var totalSize; // den totala filmstorleken
var amountLoaded; // hur mycket som laddats ner
var hej; // procent av den totala filmstorleken
totalSize=_root.getBytesTotal();
trace (totalSize);
amountLoaded=_root.getBytesLoaded();
hej=(amountLoaded/totalSize)*100;
stapel._xscale=hej;
if (hej==100) {
currentIndex++;
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
//SLUT NYA
/* ORGINAL!
clickSound.start(0, 1);
clickSound.stop(klick);
currentIndex++;
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
*/
}
};
//
// Event handler for 'Previous slide' button
back_btn.onRelease = function() {
previousSlideNode = currentSlideNode.previousSibling;
if (previousSlideNode == null) {
break;
} else {
clickSound.start(0, 1);
clickSound.stop(klick);
currentIndex--;
currentSlideNode = previousSlideNode;
updateSlide(previousSlideNode);
}
};
Please?
