Comunidad de diseño web y desarrollo en internet online

problema cargando xml

Citar            
MensajeEscrito el 11 Oct 2007 05:44 am
Buenas, me esta surgiendo un problema al cargar unos datos e un xml en una peli flash, el problema es el siguiente:

Tengo una pelicula en la que se carga sin ningun problema el archivo xml y se muestra, pero al hacer una carga e esta pelicula en otra usando loadMovie, no me muestra nada en los campos de texto. He comprobado que las variables recogen bien los datos, pero luego no se muestran.

si sirve de algo aki esta el coigo:

lectura e xml:

Código :

 titulo = noticias_xml.firstChild.childNodes[_indice].firstChild.firstChild.nodeValue;


carga en cajas de txt:

Código :

_root.titulo_txt.htmlText += "<p align='center'><font color='#003300' size='12'><b>" + titulo + "</b></font></p> </b> ";


Gracias

Por pericles

71 de clabLevel



Genero:Masculino  

in Dublin

firefox
Citar            
MensajeEscrito el 11 Oct 2007 06:48 am
var obj_xml:XML = new XML();
obj_xml.ignoreWhite = true;
obj_xml.onLoad = function(exito) {
if (exito) {
var fotos:Number = total;
var fotonum:Number = 0;
for (var z:Number = 0; z<fotos; z++) {
//si el nodo existe
if (obj_xml.firstChild.childNodes[z] != null) {
fotonum = z+1;
titulo= obj_xml.firstChild.childNodes[z].firstChild.nodeValue;
_root.titulo_txt.htmlText += "<p align='center'><font color='#003300' size='12'><b>" + titulo + "</b></font></p> </b> ";
}
}
} else {
//Muestra un mensaje de error en caso de que algo fallara
texto = "Error";
}
};
obj_xml.load("fotos.xml");

Por clipdepelicula

237 de clabLevel



 

Valencia (España)

firefox
Citar            
MensajeEscrito el 11 Oct 2007 11:22 am
mmmm, pues es bastante parecido:

Código :

var noticias_xml:XML=new XML();
function cargarDatos(_i:Number) {
        var titulo:String;
        var mensaje:String;
        titulo = noticias_xml.firstChild.childNodes[_i].firstChild.firstChild.nodeValue;
      mensaje  =noticias_xml.firstChild.childNodes[_indice].firstChild.nextSibling.firstChild.nodeValue;

_root.contenido.noti.fn.titulo_txt.htmlText = "";
        _root.contenido.noti.fn.mensaje_txt.htmlText += "<p align='center'><font color='#006633' size='12'><b>" + titulo + "</b></font></p> </b> ";
        _root.contenido.noti.fn.mensaje_txt.htmlText += "<p><font size='10'>"+mensaje+"</font>";

indice = 0;
noticias_xml = new XML();
noticias_xml.ignoreWhite = true;
noticias_xml.load("noticias.xml");
noticias_xml.onLoad = function() {  
        cargarDatos(i);
};


pero ya te digo, ademas de esto tb cargo una imagen en un clip de pelicula mediante loadMovie, y esta sale sin ningun problema poniendo la ruta _root.contenido.noti.fn.nombre_del_clip, y con un trace (titulo) me enseña el titulo, pero no consigo que salga en el txt dinamico.....Pero lo mejor de todo es que si pongo el codigo igual en un archivo flash aparte lo hace sin problemas, cuando se peta es cuando lo meto entro e mas de un clip de pelicula creo.

Gracias por responder tan rapido.

Por pericles

71 de clabLevel



Genero:Masculino  

in Dublin

firefox

 

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