# Combo box bully

**URL:** https://forum.kirupa.com/t/combo-box-bully/267042
**Category:** flash
**Created:** [July 28, 2008, 1:09am UTC](https://forum.kirupa.com/t/combo-box-bully/267042 "2008-07-28T01:09:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Narpko](https://avatars.discourse-cdn.com/v4/letter/n/f1d935/32.png) [@Narpko](https://forum.kirupa.com/u/Narpko)
#### Post date: [July 28, 2008, 1:09am UTC](https://forum.kirupa.com/t/combo-box-bully/267042/1 "2008-07-28T01:09:13Z")

</div>

hi there!  
I have a problem with my xml dropdown combo box…  
It perfectly loads the content from the xml. But if you try to pick a label from it, it neither does appear in the output window, nor in the textfield. The problems started when I exported the file to a higher flash version than flash 6. I hope someone can help me with this!!  
//the name of my combobox is dropDown,  
/  
function convertXML () {  
mainTag = new XML();  
elementTag = new XML();  
dataList = new Array();  
elementList = new Array();  
mainTag = this.firstChild;  
if (dataXML.loaded) {  
if (mainTag.nodeName == “dataSet”) {  
dataList = mainTag.childNodes;  
for (i=0; i\<=dataList.length; i++) {  
if (dataList\*.nodeName == “data”) {  
elementList = dataList\*.childNodes;  
for (j=0; j\<=elementList.length; j++) {  
elementTag = elementList[j];  
elementType = elementTag.nodeName;  
if (elementType == “name”) {  
Name = elementTag.firstChild.nodeValue;  
}  
if (elementType == “dataRow”) {  
URL = elementTag.firstChild.nodeValue;  
}  
}  
// Adds the label and data to the URL.  
dropDown.addItem(Name, URL);  
trace(dropDown);  
//all this works!  
}  
}  
}  
}  
}  
}

dropDown.dropdown.addEventListener (event.change, onComboChange);

function onComboChange (event:Object):Void  
{

var label = event.target.selectedItem.label;  
var data = event.target.selectedItem.data;

trace ("label : " + label);  
trace ("data : " + data);

getURL (data, “\_self”);  
}  
//this is the second way I tried:

dropDownListener = new Object();  
dropDownListener.change = function(eventObj)  
{  
var eventSource = eventObj.target;

```
var theSelectedItem = eventSource.selectedItem;
var theSelectedItemLabel = theSelectedItem.label;
       
trace ( "You selected "+theSelectedItemLabel+".");

```

}  
dropDown.addEventListener (“change”, dropDownListener);
