# Creating dynamic buttons-xml/php

**URL:** <https://forum.kirupa.com/t/creating-dynamic-buttons-xml-php/97446>\
**Category:** Uncategorized\
**Created:** [December 22, 2003, 4:03pm UTC](https://forum.kirupa.com/t/creating-dynamic-buttons-xml-php/97446 "2003-12-22T16:03:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fernandez](https://avatars.discourse-cdn.com/v4/letter/f/58f4c7/32.png) [@Fernandez](https://forum.kirupa.com/u/Fernandez)\
**Post date:** [December 22, 2003, 4:03pm UTC](https://forum.kirupa.com/t/creating-dynamic-buttons-xml-php/97446/1 "2003-12-22T16:03:19Z")

</div>

I hope somebody can help me out;

I ve got a code which takes info (text and images out of a xml file that worls proper! Now what i want is this; There are multiple buttons which should me created automaticly when adding items. Also each button needs the same script to pull the (different) information out of the xml file. A php programmer takes care of the dynamicly created xml files.

Please help me out of this one…

My code sofar which works; (without buttons)

slides\_xml = new XML();  
slides\_xml.onLoad = startSlideShow;  
slides\_xml.load(“reports/paris.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;  
loadMovie(imagePath, targetClip);  
slideText = newSlideNode.firstChild.nodeValue;  
}  
//  
// Event handler for ‘Next slide’ button  
next\_btn.onRelease = function() {  
nextSlideNode = currentSlideNode.nextSibling;  
if (nextSlideNode == null) {  
rootNode = slides\_xml.firstChild;  
totalSlides = rootNode.childNodes.length;  
firstSlideNode = rootNode.firstChild;  
currentSlideNode = firstSlideNode;  
currentIndex = 1;  
updateSlide(firstSlideNode);  
} else {  
currentIndex++;  
updateSlide(nextSlideNode);  
currentSlideNode = nextSlideNode;  
}  
}  
//  
// Event handler for ‘Previous slide’ button  
prev\_btn.onRelease = function() {  
previousSlideNode = currentSlideNode.previousSibling;  
if (previousSlideNode == null) {  
rootNode = slides\_xml.firstChild;  
totalSlides = rootNode.childNodes.length;  
firstSlideNode = rootNode.firstChild;  
currentSlideNode = firstSlideNode;  
currentIndex = 1;  
} else {  
currentIndex–;  
currentSlideNode = previousSlideNode;  
updateSlide(previousSlideNode);  
}  
}

stop();
