By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,456 Members | 1,742 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,456 IT Pros & Developers. It's quick & easy.

Action script in a photo slide show using XML

P: 2
How do I change my script to automatically play, rather than clicking through individual slides?

What is the action script to skip to a specific slide in the show via a button? (Right now I have a next an previous buttons.)

Here is my script:
Expand|Select|Wrap|Line Numbers
  1. slides_xml = new XML();
  2. slides_xml.onLoad = startSlideShow;
  3. slides_xml.load("conferencephotos.xml");
  4. slides_xml.ignoreWhite = true;
  5.  
  6. function startSlideShow(success) {
  7.     if (success == true) {
  8.             rootNode = slides_xml.firstChild;
  9.             totalSlides = rootNode.childNodes.length;
  10.             firstSlideNode = rootNode.firstChild;
  11.             currentSlideNode = firstSlideNode;
  12.             currentIndex = 1;
  13.             updateSlide(firstSlideNode);
  14.  
  15.     }
  16. }
  17.  
  18. function updateSlide(newSlideNode) {
  19.     imagePath = newSlideNode.attributes.jpegURL;
  20.     slideText = newSlideNode.firstChild.nodeValue;
  21.     loadMovie(imagePath, targetClip);
  22. }
  23.  
  24. next_btn.onRelease = function() {
  25.     nextSlideNode = currentSlideNode.nextSibling;
  26.     if (nextSlideNode == null) {
  27.         break;
  28.     } else {
  29.         currentIndex++;
  30.         updateSlide(nextSlideNode);
  31.         currentSlideNode = nextSlideNode;
  32.     }
  33. };
  34.  
  35. back_btn.onRelease = function() {
  36.     previousSlideNode = currentSlideNode.previousSibling;
  37.     if (previousSlideNode == null) {
  38.         break;
  39.     } else {
  40.         currentIndex--;
  41.         currentSlideNode = previousSlideNode;
  42.         updateSlide(previousSlideNode);
  43.     }
  44. };
  45.  
Mar 9 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.