# Populating combobox via XML

**URL:** <https://forum.kirupa.com/t/populating-combobox-via-xml/267736>\
**Category:** Uncategorized\
**Created:** [August 5, 2008, 9:07am UTC](https://forum.kirupa.com/t/populating-combobox-via-xml/267736 "2008-08-05T09:07:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeffGrafix\_nl](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@JeffGrafix\_nl](https://forum.kirupa.com/u/JeffGrafix_nl)\
**Post date:** [August 5, 2008, 9:07am UTC](https://forum.kirupa.com/t/populating-combobox-via-xml/267736/1 "2008-08-05T09:07:32Z")

</div>

Hi all,

I’m trying to populate a combobox via an external XML file. Now I can get it to work when I make my XML like this

```auto

<?xml version="1.0" encoding="utf-8"?>

<data>
<item label="bla" data="bla.html"/>
</data>

```

… and my flash 8 actionscript looks like this …

```auto

comboXML = new XML();
comboXML.ignoreWhite = true;
comboXML.onLoad=function() {
    var props=this.childNodes[0].attributes;
    var info = this.childNodes[0].childNodes;    
    for (var i=0; i<info.length; i++) {
        myComboBox.addItem( {label:info*.attributes.label, data:info*.attributes.data} );
    }
}
comboXML.load("myxml.xml");

```

No I’ve got a second XML, made like so…

```auto

<?xml version="1.0" encoding="utf-8">

<data>
<items>
<spotX>123</spotX>
<spotY>321</spotY>
<spotName>name</spotName>
</items>
</data>

```

Now what I would like to achieve is that my combobox gets populated with the childNode **spotName** , but everytime I try this, I get undefined stated in the combobox.

Someone here that can put me on the right path?
