con questo codice riempi un array con un oggetto per ogni nodo, che contiene al suo interno i due attributi che ti interessano e il contenuto dei nodi, usi l'array a tuo piacimento dentro la funzione "useArray", io ho fatto un semplice trace...
Codice PHP:
var a:Array = new Array();
var x:XML = new XML();
x.ignoreWhite = true;
x.onLoad = function(ok) {
if (ok) {
var temp:Array = this.firstChild.childNodes;
for (var i:Number = 0; i<temp.length; i++) {
a.push({content:temp[i].firstChild.toString(), jpegURL:temp[i].attributes.jpegURL, jpegText:temp[i].attributes.jpegText});
if (i>=temp.length-1) {
useArray(a);
}
}
}
};
x.load('test.xml');
function useArray(a:Array) {
for (var j:Number = 0; j<a.length; j++) {
trace('content: '+a[j].content);
trace('jpegURL: '+a[j].jpegURL);
trace('jpegText: '+a[j].jpegText);
}
}