# Help with comboBox

**URL:** <https://forum.kirupa.com/t/help-with-combobox/82883>\
**Category:** Uncategorized\
**Created:** [March 14, 2005, 2:01pm UTC](https://forum.kirupa.com/t/help-with-combobox/82883 "2005-03-14T14:01:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![egoldy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/egoldy/32/385_2.png) [@egoldy](https://forum.kirupa.com/u/egoldy)\
**Post date:** [March 14, 2005, 2:01pm UTC](https://forum.kirupa.com/t/help-with-combobox/82883/1 "2005-03-14T14:01:34Z")

</div>

hi everyone

I use comboBox make a links.the code like this:

```auto
stop();
import mx.controls.ComboBox;
import mx.transitions.Tween;
import mx.transitions.easing.*;
Stage.scaleMode = "noscale";
createClassObject(ComboBox,"my_combo",this.getNextHighestDepth(),{_x:90,_y:30});
my_combo.setSize(200);
my_combo.setStyle("openEasing",Elastic.easeOut);
my_combo.setStyle("openDuration",800);
//loadxml
myXML = new XML();
myXML.ignoreWhite = true;
myXML.load("http://www.webstudio.com.cn/wsswf/c...nks/example.xml");
myXML.onLoad =function(success){
// --
if(success){
 links = new Array();
 // --
 for (var i = 0; i<myXML.firstChild.childNodes.length; i++) {
   links.addItem({label:myXML.firstChild.childNodes*.childNodes, data:myXML.firstChild.childNodes*.attributes.url});
  }
}else{
 trace("cannot load xml");
}
   
 // --
 //add listenerobject
 listenerObject = new Object();
 listenerObject.change = function(event) {
  //
  //getURL(links[my_combo.selectedIndex].data,"_blank");
  getURL(event.target.getValue(),"_blank");
  trace(event.target.getValue());
 };
 // --
 my_combo.addEventListener("change", listenerObject);
 my_combo.dataProvider = links;
}

```

the demo is here:  
[http://www.webstudio.com.cn/wsswf/combolinks/combxml.swf](http://www.webstudio.com.cn/wsswf/combolinks/combxml.swf)  
the xml file is here:  
[http://www.webstudio.com.cn/wsswf/combolinks/example.xml](http://www.webstudio.com.cn/wsswf/combolinks/example.xml)

but why the first link is not work?and when you first click another links then click the first link ,It is work why?

thanks a lot.
