Foros del Web » Creando para Internet » Flash y Actionscript »

Carga de XML

Estas en el tema de Carga de XML en el foro de Flash y Actionscript en Foros del Web. Tengo esto: Código: stop(); function ini() { trace("cargado"); trace(obj_xml.firstChild.childNodes[0].firstChild.nodeValue); nextFrame(); } var obj_xml:XML = new XML(); obj_xml.load("menu.xml"); obj_xml.onLoad = ini; obj_xml.ignoreWhite = true; asunto_txt.text = ...
  #1 (permalink)  
Antiguo 13/03/2007, 12:15
Avatar de gagarin  
Fecha de Ingreso: enero-2002
Ubicación: Madrid
Mensajes: 550
Antigüedad: 22 años, 3 meses
Puntos: 4
Carga de XML

Tengo esto:
Código:
stop();

function ini() {
	trace("cargado");
	trace(obj_xml.firstChild.childNodes[0].firstChild.nodeValue);
	nextFrame();
}
var obj_xml:XML = new XML();
obj_xml.load("menu.xml");
obj_xml.onLoad = ini;
obj_xml.ignoreWhite = true;


asunto_txt.text = obj_xml.firstChild.childNodes[0].firstChild.nodeValue;

destino_txt.text = obj_xml.firstChild.childNodes[1].firstChild.nodeValue;

cuerpo_txt.text = obj_xml.firstChild.childNodes[2].firstChild.nodeValue;

remitente_txt.text = obj_xml.firstChild.childNodes[3].firstChild.nodeValue;
Y en mi escenario tengo los campos de texto dinámico con los nombres y todo en orden, el trace me avienta los datos que tengo en mi XML pero al asignarlos a los campos de texto me aparece como undifened, POR QUÉ?
  #2 (permalink)  
Antiguo 13/03/2007, 13:41
Avatar de TMeister
Crazy Coder
 
Fecha de Ingreso: enero-2002
Ubicación: En la Oficina
Mensajes: 2.880
Antigüedad: 22 años, 3 meses
Puntos: 193
Re: Carga de XML

por que estas cargando la informacion en los textos antes de que el XML este cargado

Código:
stop ();
function ini ()
{
	trace ("cargado");
	trace (obj_xml.firstChild.childNodes [0].firstChild.nodeValue);
	asunto_txt.text = obj_xml.firstChild.childNodes [0].firstChild.nodeValue;
	destino_txt.text = obj_xml.firstChild.childNodes [1].firstChild.nodeValue;
	cuerpo_txt.text = obj_xml.firstChild.childNodes [2].firstChild.nodeValue;
	remitente_txt.text = obj_xml.firstChild.childNodes [3].firstChild.nodeValue;
	nextFrame ();
}
var obj_xml : XML = new XML ();
obj_xml.load ("menu.xml");
obj_xml.onLoad = ini;
obj_xml.ignoreWhite = true;
  #3 (permalink)  
Antiguo 14/03/2007, 04:13
Avatar de gagarin  
Fecha de Ingreso: enero-2002
Ubicación: Madrid
Mensajes: 550
Antigüedad: 22 años, 3 meses
Puntos: 4
Re: Carga de XML

Ja ja Buen punto no?
Venga pues gracias
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 17:28.