<?xml version="1.0" encoding="iso-8859-1"?>
<noticias>
<noticia fecha="08/07/2010">
<titulo>5º FECHA CAMPEONATO ESCUELA 2010</titulo>
<mensaje>Mensaje</mensaje>
<image>primera.jpg</image>
<asd> prueba </asd>
</noticia>
<noticia fecha="08/07/2010">
<titulo>Clubes con personeria juridica vencida</titulo>
<mensaje>mensaje</mensaje>
<image>Logo.jpg</image>
<asd> prueba </asd>
</noticia>
y lo leo asi
</noticias>
Código ActionScript :
function cargarDatos(_indice:Number){
//Se inicializan variables utilizadas para almenar los datos de una noticia
var fecha:String;
var titulo:String;
var mensaje:String;
var imagen:String;
var linkNoticia:String;
//Recuperando datos del objeto xml
//Se accede al primer elemento [noticia] y se recupera la fecha desde el atributo [fecha]
fecha = noticias_xml.firstChild.childNodes[_indice].attributes.fecha;
//Se accede al primer hijo de elemento [noticia] y se recupera al valor del primer elemento de [titulo]
titulo = noticias_xml.firstChild.childNodes[_indice].firstChild.firstChild.nodeValue;
//Se accede al segundo hijo de elemento [noticia] y se recupera el valor del primer elemento de [mensaje]
mensaje = noticias_xml.firstChild.childNodes[_indice].firstChild.nextSibling.firstChild.nodeValue
//Se accede al último hijo de elemento [noticia] y se recupera el valor del primer elemento de [imagen]
//imagen = noticias_xml.firstChild.childNodes[_indice].lastChild.firstChild.nodeValue
imagen = noticias_xml.nextSibling.childNodes[_indice].nextSibling.firstChild.nodeValue
linkNoticia = noticias_xml.firstChild.childNodes[_indice].lastChild.firstChild.nodeValueme dice undefined
