Código :
function cargarXML() { // xml="proyectos.xml"; obj_xml.load("agenda.xml"); trace("cargando xml") } News = new Array(); Noticias = new Array(); Enlaces = new Array(); Fotos = new Array(); Pdfs = new Array(); var obj_xml:XML = new XML(); obj_xml.ignoreWhite = true; cargarXML(); obj_xml.onLoad = function(exito) { if (exito) { trace("xml cargado") agenda = this.firstChild.childNodes; vTotal = agenda.length; for (var i=0; i<vTotal; i++) { //---------------- cargamos variables del xml News[i] = obj_xml.firstChild.childNodes[i].attributes.cabecera; Noticias[i] = obj_xml.firstChild.childNodes[i].attributes.texto; Enlaces[i] = obj_xml.firstChild.childNodes[i].attributes.enlace; Fotos[i] = obj_xml.firstChild.childNodes[i].attributes.foto; Pdfs[i] = obj_xml.firstChild.childNodes[i].attributes.pdf; } } };
El boton enlaces debe de leer la direccion guardada, para luego que cada boton envie a un enlace, pero no consigo crear un for para que asigne a cada boton.
Código :
for(n=0; n < News.length; n++) { url[n]="http://" + link["btn_enlaces"+n].txt.text; this.link["btn_enlaces"+n].onRelease = function (){ getURL(url[n],"_blank"); trace (url[n]); } }
Dando como resultado undefined.
Sin embargo poniendolo manualmente si que me enlaza coorectamente.
Código :
url1="http://" + link["btn_enlaces"+0].txt.text; this.link["btn_enlaces"+0].onRelease = function (){ getURL(url1,"_blank"); trace (url1); }
Alguna ayuda