# \*\*xml random loading of quotes\*\*

**URL:** <https://forum.kirupa.com/t/xml-random-loading-of-quotes/251665>\
**Category:** flash\
**Created:** [February 11, 2008, 3:56pm UTC](https://forum.kirupa.com/t/xml-random-loading-of-quotes/251665 "2008-02-11T15:56:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fault151](https://avatars.discourse-cdn.com/v4/letter/f/67e7ee/32.png) [@fault151](https://forum.kirupa.com/u/fault151)\
**Post date:** [February 11, 2008, 3:56pm UTC](https://forum.kirupa.com/t/xml-random-loading-of-quotes/251665/1 "2008-02-11T15:56:46Z")

</div>

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??

```auto
 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:
