ti faccio un esempio:
supponiamo che hai sulla root tre pulsanti
chiamati "pulsante0", "pulsante1", "pulsante2"
e un campo di testo dimanico chiamato "campoTesto"
sufficientemente alto da contenere la lista che vuoi rappresentare.
Prova ad usare questo codice:
codice:
mio_xml = new XML();
mio_xml.ignoreWhite = true;
mio_xml.onLoad = function(success) {
if (success) {
var childs = this.firstChild.childNodes;
for (var i = 0; i<childs.length; i++) {
_root["pulsante"+i]["list"] = new Array();
for (var j = 0; j<childs[i].childNodes.length; j++) {
_root["pulsante"+i]["list"].push(childs[i].childNodes[j].firstChild.toString());
}
_root["pulsante"+i].onRelease = function() {
_root["campoTesto"].text = "";
for (var k = 0; k<this["list"].length; k++) {
_root["campoTesto"].text += this["list"][k]+"\r";
}
};
}
}
};
mio_xml.load("file.xml");