# Loading xml data into dynamic text fields

**URL:** <https://forum.kirupa.com/t/loading-xml-data-into-dynamic-text-fields/282803>\
**Category:** flash\
**Created:** [February 26, 2009, 5:06pm UTC](https://forum.kirupa.com/t/loading-xml-data-into-dynamic-text-fields/282803 "2009-02-26T17:06:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skarab](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@Skarab](https://forum.kirupa.com/u/Skarab)\
**Post date:** [February 26, 2009, 5:06pm UTC](https://forum.kirupa.com/t/loading-xml-data-into-dynamic-text-fields/282803/1 "2009-02-26T17:06:15Z")

</div>

Hi-  
I’m trying to load text from an xml file to populate the labels of a column of buttons loaded with a for loop, but for some reason the text won’t load. Here’s my code thus far:

```auto
patents_xml = new XML();
patents_xml.ignoreWhite = true;
patents_xml.load("text/patents.xml");
patents_xml.onLoad = loadXML

//initializes the xml nodes so they can be used in the movie
function loadXML(loaded) {
    if (loaded) {
        xmlNode = this.firstChild;
        patentnumber = [];
        //claim = [];
        //claimnumber = [];
        total = xmlNode.firstChild.childNodes.length;
        for(i=0; i<total; i++){
    attachMovie("patentBtn", "patentBtn"+i, i, {_x:xPos, _y:yPos});
    //increase the y position for each button in array
    yPos += this["patentBtn"+i]._height+3;
    //populates the button labels with pat. numbers from xml file
    patentnumber* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
    this["patentBtn"+i].buttonLabel_mc.labelText_txt.text = patentnumber*;
    
};
    }
}    

```

Been puzzling over this for several hours and can’t see where the problem is. Any suggestions welcome.
