Search tutorials
Step 1: Create XML Object photos_xml = new XML(); Step 2: Load the slides.xml photos_xml.load("photos.xml"); step 3: onLoad just goto startSlideShow() photos_xml.onLoad = startSlideShow; Step 4:Read the records of the data of the XML and send the output to flash text Tool box function startSlideShow(success) { if (success == true) { rootNode = photos_xml.firstChild; totalSlides = rootNode.childNodes.length; firstSlideNode = rootNode.firstChild; currentSlideNode = firstSlideNode; currentIndex = 1; updateSlide(firstSlideNode); } } // Hear updating the Node value or name to the flash file. function updateSlide(newSlideNode) { slideText = newSlideNode.firstChild.nodeValue; } // on click the next button it read the next child node of the XML file. next_btn.onRelease = function() { nextSlideNode = currentSlideNode.nextSibling; if (nextSlideNode == null) { break; } else { currentIndex++; updateSlide(nextSlideNode); currentSlideNode = nextSlideNode; } }; //on click the back button it read the previous record and display it in the flash text tool box. back_btn.onRelease = function() { previousSlideNode = currentSlideNode.previousSibling; if (previousSlideNode == null) { break; } else { currentIndex--; currentSlideNode = previousSlideNode; updateSlide(previousSlideNode); } };
» Level Basic |
Added: 2007-02-23 Rating: 8.2 Votes: 5 |
» Author |
Flash Developer |
» Download |
Download the files used in this tutorial. |
Download (10 kb) |
» Forums |
More help? Search our boards for quick answers! |