para declarar un tipo de dato como fecha_texto ,String se hace asi
fecha_texto:String
ahora debes cargar tu xml en alguna parte , en alguna funcion, lo que te recomiendo es que no trates de hacer todo con una linea de codigo, pues que simplemente no se puede, eso creo yo mira: asi es como yo suelo cargar mi xml, y pues lo resolvi porque hac unnos dias postie por aqui este mismo codigo
var array:Array; function LeeXML(cargador, textos) { text_txt = cargador; datos = textos; trace("te instancie"); } function mostrarDatos() { text_txt.html = true; var largo = array.length; var msg = ""; for (var i = 0; i<largo; i++) { msg += array[i].name+"\n"; } text_txt.text = msg; }
function cargarDatos() { var owner = this; array = new Array(); var my_xml = new XML(); my_xml.ignoreWhite = true; my_xml.load(datos); my_xml.onLoad = function() { //trace(this); var largo = this.firstChild.childNodes.length; trace(largo); for (var i = 0; i<largo; i++) { var obj = new Object(); obj.address = this.firstChild.attributes.ADDRESS; obj.port = this.firstChild.attributes.PORT; obj.name=this.firstChild.childNodes[i].attributes.NAME;
// array.push(obj); //eso es para ir aplilando los datos trace(obj.name); } mostrarDatos(); }; } System.useCodepage = true; limon = text_txt; xml = new LeeXML(limon, "test.xml"); cargarDatos();
trata de adaptar esto para tu xml espero haber sido de ayuda