Ciao raga!!
Guardate questo script:
-----------------------------------------------------------------
var lineaXML:XML = new XML();
lineaXML.ignoreWhite = true;
lineaXML.onLoad = function() {
var posX:Number = 577.4;
var posY:Number = 174.4;
var catArray = new Array();
for (var i = 0; i<this.childNodes.length; i++) {
catArray[i] = new Object();
catArray[i].data = this.childNodes[i].attributes.id;
catArray[i].label = this.childNodes[i].attributes.valore.toUpperCase();
var subcatArray = new Array();
for (var j = 0; j<this.childNodes[i].childNodes.length; j++) {
subcatArray[j] = new Object();
subcatArray[j].data = this.childNodes[i].childNodes[j].attributes.id;
subcatArray[j].label = this.childNodes[i].childNodes[j].attributes.valore.toUpperCase();
subcatdata += subcatArray[j].data+"|";
subcatlabel += subcatArray[j].label+"|";
}
subcatdata += "^";
subcatlabel += "^";
subcatArraydat = subcatdata.split("^");
subcatArraylab = subcatlabel.split("^");
_root.attachMovie("ComboBox", ["ComboBox"+i], i);
_root["ComboBox"+i].dataProvider = subcatArray;
_root["ComboBox"+i]._x = posX;
_root["ComboBox"+i]._y = posY += (_root["ComboBox"+i]._height)+10;
var listcatObj = new Object();
listcatObj.change = function() {
idcat = _root["ComboBox"+i].selectedItem.data;
trace(idcat);
};
_root["ComboBox"+i].addEventListener("change", listcatObj);
}
};
lineaXML.load("xml/ricerca.xml");
-----------------------------------------------------------------
Come mai il trace mi da undefined