Comunidad de diseño web y desarrollo en internet online

Cargar XML sin botones

Citar            
MensajeEscrito el 20 Oct 2006 01:06 pm
Hola!
Estaba probando un tutorial de XML que he visto por aquí:
http://www.cristalab.com/tutoriales/12/tutorial-de-xml-en-flash
Me preguntaba como cargar el texto de XML sin necesidad de botones, es decir que se carge sobre un texto dinámico.
El código que yo he puesto es este pero no me funciona:

Código :

cargarXML();

var obj_xml:XML = new XML();
obj_xml.ignoreWhite = true;  
obj_xml.onLoad = function(exito) {
   if (exito) {
      asunto_txt.text = obj_xml.firstChild.childNodes[0].firstChild.nodeValue;
   }
}
function cargarXML() {
   obj_xml.load("texto.xml");
}


Creo que la primera línea:

Código :

cargarXML();
es la que esta fallando.
Gracias por la ayuda.
[/flash]

debes usar las etiquetas code para postear tu codigo

Por celentano

Claber

123 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 20 Oct 2006 01:59 pm
Vale, estaba equivocado en el orden. Es así:

Código :

var obj_xml:XML = new XML();
obj_xml.ignoreWhite = true;
obj_xml.onLoad = function(exito) {
if (exito) {
asunto_txt.text = obj_xml.firstChild.childNodes[0].firstChild.nodeValue;
}
}
function cargarXML() {
obj_xml.load("texto.xml");
}
cargarXML();


debes usar las etiquetas code para postear tu codigo

Por celentano

Claber

123 de clabLevel



Genero:Masculino  

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.