Hi i am trying to load random xml based quotes in to my design. Heres the coding i have, it basically loads text in to the defined area,but, i want it to be randomised so i can have a few different quotes. At the minute i am limited to only one!
can anyone solve this??
function loadXML(loaded) {
if (loaded) {
_root.inventor = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
_root.comments = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
name_txt.text = _root.inventor;
comment_txt.text = _root.comments;
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("inventors.xml");
THE CODING ABOVE USES MY XML FILE AND LOADS IT IN TO TWO BOXES I CREATED. One named name_txt and the other called comment_txt. I want it to generate a few random quotes with the two fields.
cheers! :thumb2: