Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/12/2007, 10:44
charlielpz
 
Fecha de Ingreso: diciembre-2007
Mensajes: 22
Antigüedad: 16 años, 4 meses
Puntos: 0
Cargar xml en Flash

Hola necesito cargar una linea concreta de un archivo xml (rss) en un campo dinámico de flash.

El archivo xml "news.xml" tiene esta estructura:

<?xml-stylesheet title="XSL_formatting" type="text/xsl" href="rss_convert.xsl"?>
<rss version="0.91">
<channel>
<title>RTÉ News</title>
<link>http://www.rte.ie/rss/news.xml</link>
<description>Latest Irish and international news supplied by RTE.ie</description>
<copyright>Copyright © RTÉ Publishing</copyright>

<pubDate>Wed, 05 Dec 2007 16:49:48 +0000</pubDate>
<lastBuildDate>Wed, 05 Dec 2007 16:49:48 +0000</lastBuildDate>
<category domain="News">General News</category>
<image>
<url>http://www.rte.ie/images/logo.gif</url>
<link>http://www.rte.ie</link>

</image>
<item>
<title>Cowen delivers fourth Budget</title>
<description>Minister for Finance Brian Cowen has delivered his fourth Budget against what he has described as a challenging economic backdrop.</description>
<pubDate>Wed, 05 Dec 2007 16:49:42 +0000</pubDate>
<createDate>Wed, 05 Dec 2007 00:00:00 +0000</createDate>
<link>http://www.rte.ie/news/2007/1205/budget.html?rss</link>

</item>
</channel>
</rss>


El archivo flash tiene un campo de texto dinamico llamado "item_1_txt" y el siguiente codigo:



var cargaxml:XML = new XML();


cargaxml.onLoad = function(exito) {
if (exito) {


item_1_txt.text = cargaxml.firstChild.childNodes[0].childNodes[0].childNodes[0]





} else {
trace("error al cargar el archivo");
}
};


cargaxml.ignoreWhite = true;
cargaxml.load("news.xml");


Este código me carga la siguiente etiqueta: <title>RTÉ News</title>... pero yo necesito cargar el titular de la primera noticia: <title>Cowen delivers fourth Budget</title>.

Si alguien me puede ayudar lo agradecería muchísimo.

Muchas gracias.