Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionslides_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; totalSlides = rootNode.childNodes.length; firstSlideNode = rootNode.firstChild; currentSlideNode = firstSlideNode; currentIndex = 1; updateSlide(firstSlideNode); } } function updateSlide(newSlideNode) { imagePath = newSlideNode.attributes.jpegURL; slideText = newSlideNode.attributes.desc; img_L = newSlideNode.attributes.largeur; img_H = newSlideNode.attributes.hauteur; img_X = newSlideNode.attributes.x; img_Y = newSlideNode.attributes.y; setProperty("_root.cadre", _width, img_L); setProperty("_root.cadre", _height, img_H); x = getProperty(_root.targetClip, _x); y = getProperty(_root.targetClip, _y); setProperty("_root.cadre", _x, x); setProperty("_root.cadre", _y, y); loadMovie(imagePath, targetClip); } next_btn.onRelease = function() { nextSlideNode = currentSlideNode.nextSibling; if (nextSlideNode == null) { break; } else { currentIndex++; updateSlide(nextSlideNode); currentSlideNode = nextSlideNode; } }; back_btn.onRelease = function() { previousSlideNode = currentSlideNode.previousSibling; if (previousSlideNode == null) { break; } else { currentIndex--; currentSlideNode = previousSlideNode; updateSlide(previousSlideNode); } };
<Slides> <slideNode jpegURL="images/image1.jpg" desc="Image 1" largeur="250" hauteur="182" /> <slideNode jpegURL="images/image2.jpg" desc="Image 2" largeur="300" hauteur="219" /> <slideNode jpegURL="images/image3.jpg" desc="Image 3" largeur="180" hauteur="131" /> <slideNode jpegURL="images/image4.jpg" desc="Image 4" largeur="200" hauteur="146" /> <slideNode jpegURL="images/image5.jpg" desc="Image 5" largeur="350" hauteur="255" /> </Slides>