Este es mi codigo
Código :
var obj:XML = new XML (); obj.ignoreWhite = true; obj.load("menu_flash-es.xml"); indice=0; obj.onLoad = function() { cargarDatos(indice); }; peru.onRelease = function(){ paix="Perú"; cargarDatos(paix); } argentina.onRelease = function(){ paix="Argentina"; cargarDatos(paix); }//cierra argentina chile.onRelease = function(){ paix="Chile"; cargarDatos(paix); } function cargarDatos(_pais:String) { m=obj.firstChild.childNodes; for(var _indice=0; _indice<m.length;_indice++){ if(m[_indice].firstChild.firstChild=_pais){ if(m[_indice].firstChild.firstChild==null){pais.text="";} else {pais.text=m[_indice].firstChild.firstChild;} if(m[_indice].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.firstChild !=null) { nompais=_l1[_indice].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.firstChild;} if(m[_indice].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild !=null) { idioma=m[_indice].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild;} if(m[_indice].firstChild.nextSibling.firstChild==null){contacto.htmlText="";flecha1._alpha=0;} else {contacto.htmlText="<a href=\""+m[_indice].firstChild.nextSibling.attributes.url+"?idioma="+idioma+"&pais="+nompais+"\" target=\"_blank\">"+m[_indice].firstChild.nextSibling.firstChild+"</a>"; flecha1._alpha=100;} if(m[_indice].firstChild.nextSibling.nextSibling.firstChild==null){experiencia.text="";flecha2._alpha=0;} else{experiencia.htmlText="<a href=\""+m[_indice].firstChild.nextSibling.nextSibling.attributes.url+"?idioma="+idioma+"&pais="+nompais+"\" target=\"_blank\">"+m[_indice].firstChild.nextSibling.nextSibling.firstChild+"</a>"; flecha2._alpha=100;} if(m[_indice].firstChild.nextSibling.nextSibling.nextSibling.firstChild==null){organizacion.text="";flecha3._alpha=0;} else{organizacion.htmlText="<a href=\""+m[_indice].firstChild.nextSibling.nextSibling.nextSibling.attributes.url+"?idioma="+idioma+"&pais="+nompais+"\" target=\"_blank\">"+m[_indice].firstChild.nextSibling.nextSibling.nextSibling.firstChild+"</a>"; flecha3._alpha=100;} } } }
Lo que hace es lo siguiente, cuando se presiona el boton del pais, la variable paix toma el valor que le corresponde y lo manda al metodo cargarDatos....al ingresar al metodo un for recorre todos los nodos y pregunta si alguno de ellos se llama como el nombre de la variable paix...si es asi entonces entra a la condicion e imprime en cajas de texto los datos.
El problema es que cuando le hago trace al indice me bota el numero del primer nodo, entonces no me esta recorriendo todos????? no pasa la condicion???? que puede estar pasando