Código :
for (var i:Number = 1;i<6; i++)
this["obj_xml_"+i]= new XML();
function asig_text(file:Number,c_texto:String){
this["obj_xml_"+file].ignoreWhite = true;
this["obj_xml_"+file].onLoad = function(exito) {
if (exito) {
texto = obj_xml_1.firstChild.childNodes[0].firstChild.nodeValue;
mc_txts["txt_"+c_texto].html = true;
mc_txts["txt_"+c_texto].htmlText = texto;
mc_txts["txt_"+c_texto].autoSize = true;
trace ("Alt"+mc_txts["txt_"+c_texto].textHeight);
if (mc_txts["txt_"+c_texto].textHeight>138) {
mc_txts["btn_ad"+file]._alpha = 100;
mc_txts["btn_at"+file]._alpha = 100;
mc_txts["btn_ad"+file].enabled = 100;
mc_txts["btn_at"+file].enabled = 100;
}
} else {
texto = "Error";
}
}
}
function cargarXML(id:Number) {
if (id == 1) {
obj_xml_1.load("musica/conciertos.xml");
asig_text(id,"conciertos");
}
}
cargarXML(1);El problema es en la linea 7 en
Código :
texto = obj_xml_1.firstChild.childNodes[0].firstChild.nodeValue;
Lo que quiero hacer es generar dinamicamente "obj_xml_1" utilizando las variables que tengo arriba, ya probe de varias formas pero no da ningun resultado.Quiero poner algo mas o menos asi:
Código :
texto = this["obj_xml_"+id].firstChild.childNodes[0].firstChild.nodeValue
Pero como estoy en "onLoad" pues me toma el "this" como si me refiriera al "onLoad" y no puedo utilizar "_root" porque este movieclip va a ir adjuntado en otro.
De antemano gracias. Sepan que ya investigue, pero no encontre solucion, sino no los molestaria.
