hi everyone
I use comboBox make a links.the code like this:
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
the xml file is here:
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.