2 Replies Latest reply on Jul 20, 2008 4:06 AM by glenfx

    Fast Forward images from XML file

    glenfx
      Hi

      Im making a dynamic slideshow webcomic to flip trough a number of pages i update frequently, so im using a XML file and I have everything working quite great but i have a question.

      I need to have a button that sends the viewer to the very last (or latest page) or the very first page instead of flipping trough the entyre ammount of pages (it would get annoying if there are like 90 pages)

      But i dont know how to set those two buttons.


      Here is the actionscript im working with



      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);
      }
      };