Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/04/2009, 13:25
chaleko
 
Fecha de Ingreso: noviembre-2005
Mensajes: 117
Antigüedad: 19 años, 5 meses
Puntos: 1
duda con xml hacer un unload

hola que tal amigos

Necesito resolver el siguiente dilema o problema

Estoy cargando una noticia dinamica a traves de flash con xml y

mi xml se llama news.xml

/*********Mi XML*************/

<noticia link="../portada.php">

<foto>thumb.jpg</foto>
<titulo>Este título será el destacado de noticia</titulo>
<bajada>continuamos con el desarrollo de la información referente a esta increíble noticia</bajada>

</noticia>

/*********Mi XML*************/

Bien y necesito decirle a mi swf que si no hay nada para <titulo></titulo> el xml que se cargo en mi flash no se cargue osea que si esta en blanco el titulo no carga el xml y si hay un titulo SI lea news.xml



ahora en mi flash lo construyo de la siguiente manera

/**********Mi FLsah**********/

System.useCodepage = true;

var ruta = _root.cont_mc.mc_noticias;

/*-----------------crear XML---------------------*/
var noticia:XML = new XML();
noticia.ignoreWhite = true;

noticia.onLoad = function() {
/*if( noticia.firstChild.childNodes[1].firstChild.nodeValue == ""){
//descargar el xml
}else{ */
ruta.link = noticia.firstChild.attributes.link;
ruta.foto = noticia.firstChild.childNodes[0].firstChild.nodeValue;
ruta.titulo.text = noticia.firstChild.childNodes[1].firstChild.nodeValue;
titular = noticia.firstChild.childNodes[1].firstChild.nodeValue;
detalle = noticia.firstChild.childNodes[2].firstChild.nodeValue;
ruta.imagen.loadMovie("images/"+ _root.cont_mc.mc_noticias.foto);
//}

_root.cont_mc.mc_noticias.boton.onRelease = function() {
getURL(_root.cont_mc.mc_noticias.link);
};
ruta.titulo.text = substring(titular, 0, 40);
ruta.bajada.text = substring(detalle, 0, 148) + "...";


};

noticia.load("news.xml");

/**********Mi FLsah**********/


Pero no se como pordria hacerlo, que si titulo.text es = "" (Nada) mi news.xml haga un unload


HELP

Gracias Saludos