este es el xml:
Código XML :
<?xml version="1.0" encoding="UTF-8"?> <list> <description>La secuelas de las películas suelen ser desastres argumentales con la excusa de devolver a la pantalla al héroe de la versión original. Este es un listado de las secuelas que fueron excepción y que consideramos mejores que las originales. </description> <id type="integer">7</id> <image-file-name>spider-man-2_l.jpg</image-file-name> <permalink>segundas-partes-a-veces-son-mejores</permalink> <title>Segundas partes a veces son mejores</title> <items type="array"> <item> <id type="integer">62</id> <image-file-name>godfather_21.jpg</image-file-name> <link>http://www.elpadrino.com</link> <points type="integer">1</points> <text>La saga de El padrino de Francis Ford Coppola en su mejor versión: Al Pacino y Robert de Niro estan impecables</text> <title>El Padrino 2</title> <video></video> </item> <item> <id type="integer">63</id> <image-file-name>t2.jpg</image-file-name> <link>http://www.terminator.com</link> <points type="integer">1</points> <text>Los efectos especiales con CGI nos dejaron boquiabiertos con esta segunda parte del terminator. Casi la ultima buena de Schwartzeneger</text> <title>Terminator 2</title> <video></video> </item> </items> </list>
Todo funciona cuando mi flash usa este codigo:
Código ActionScript :
var opcionesXML:XML = new XML(); opcionesXML.ignoreWhite = true; opcionesXML.onLoad = function (sucess:Boolean) { if (sucess) { texto.text = opcionesXML.firstChild.childNodes[5].firstChild.childNodes[2].firstChild.nodeValue; } else {trace("Error al Leer archivo XML");}} opcionesXML.load("test.xml");
Pero no logro que funcione cuando tengo que usar este codigo:
Código ActionScript :
var opcionesXML:XML = new XML(); opcionesXML.ignoreWhite = true; opcionesXML.onLoad = function (sucess:Boolean) { if (sucess) { var opciones:Array = this.firstChild.childNodes; for(i = 0; i < opciones.length; i++) { todos.attachMovie("mcBoton","boton"+i,todos.getNextHighestDepth()); todos["boton"+i]._x = -16; todos["boton"+i]._y = -8 + (i * 22); todos["boton"+i].texto = opciones[i].childNodes[1].firstChild; todos["boton"+i].linkurl = opciones[i].childNodes[1].firstChild; todos["boton"+i].img =opciones[i].childNodes[2].firstChild; todos["boton"+i].tit =opciones[i].childNodes[3].firstChild; todos["boton"+i].desc =opciones[i].childNodes[4].firstChild; todos["boton"+i].puntuacion =opciones[i].childNodes[5].firstChild; todos["boton"+i].onRollOver = function () { imagenes.loadMovie(this.img); this.gotoAndPlay("on") texto= this.desc tit= this.tit estrellas.gotoAndStop(this.puntuacion);} todos["boton"+i].onRollOut = function () { this.gotoAndPlay("off");} todos["boton"+i].onRelease = function () { getURL(this.linkurl, "_blank");} } } else { trace("Error al Leer archivo XML"); } } opcionesXML.load("contenido.xml");
Todo un desafío...me estoy volviendo loco para solucionarlo.
Alguna idea?
Gracias.