non è così che ti ho suggerito io
non puoi richiamare un'azione che usi il tuo array, fuori dall'onLoad, ma puoi fare ad esempio una cosa del genere
codice:var gallery_xml:XML = new XML(); gallery_xml.ignoreWhite = true; gallery_xml.onLoad = function(success:Boolean) { try { if (success) { var images:Array = this.firstChild.childNodes; var titolo_array:Array = new Array(); for (var i = 0; i<images.length; i++) { titolo_array.push({src:images[i].attributes.tit}); traccia(titolo_array, i); } } else { throw new Error("Unable to parse XML"); } } catch (e_err:Error) { trace(e_err.message); } finally { delete this; } }; gallery_xml.load("gallery.xml"); var traccia:Function = function(images:Array, index:Number){ trace(images[index].src); }


Rispondi quotando