Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/11/2008, 21:50
Avatar de Yara
Yara
 
Fecha de Ingreso: julio-2003
Ubicación: Santo Domingo, República
Mensajes: 59
Antigüedad: 20 años, 9 meses
Puntos: 0
Generar botones desde un xml

Hola, estoy generando un boton por cada nodo, quiero que al hacer click sobre ese boton se carguen unos datos a un cuadro de texto y un movieclip.

En el XML tengo esto
Código HTML:
<?xml version="1.0" encoding="iso-8859-1"?>
<agenda>

  <evento id="2">
    <fecha>25.12.2008</fecha>
    <nombre>Fiesta en Barcelona</nombre>
    <enlace>../images/agenda/chilling-on-the-beach.jpg</enlace>
    <contenido>A view of the remains of Brightons West Pier through a sculpture on the beach.
Taken late one summers day whilst people were chilling with a beer (or two) and a BBQ on the beach. </contenido>
    <tumb>../images/agenda/tumbnails/fiesta.jpg</tumb>
  </evento>
  
  <evento id="1">
    <fecha>22.12.2008</fecha>
    <nombre>Lanzamiento revista lados</nombre>
    <enlace>../images/agenda/lanzamiento-revista-lados.jpg</enlace>
    <contenido>All spreads from Issue 1
la(dos) magazine is a free printed magazine covering Art & Culture.
Is is distributed in Spain.
Art direction Hanko Jacobsen, Raul Allen
Page formating and editing Elena Veguillas
We are currently looking for people to contribute to the magazine.
Web designers, photographers, illustrators, designers and musicians alike are welcome to submit material for consideration.</contenido>
    <tumb>../images/agenda/tumbnails/tiempo.jpg</tumb>
  </evento>
  
</agenda> 
En mi Flash tengo esto:

Código:
var info:XML = new XML();
info.ignoreWhite = true;
info.load("../agenda.xml");

info.onLoad = function(suceso:Boolean) {
	if (suceso) {
		var agenda:Array = this.firstChild.childNodes;
		for (i=0; i<agenda.length; i++) {
			_root.createEmptyMovieClip("contenedor",_root.getNextHighestDepth());
			_root.contenedor.attachMovie("agenda_mc","datos"+i,_root.getNextHighestDepth());
			_root.contenedor["datos"+i]._x = 250;
			_root.contenedor["datos"+i]._y = 150+(i*130);
			_root.contenedor["datos"+i].fecha.text = agenda[i].childNodes[0].firstChild;
			_root.contenedor["datos"+i].titulo.text = agenda[i].childNodes[1].firstChild;
			_root.contenedor["datos"+i].tumb.loadMovie(agenda[i].childNodes[4].firstChild);
			_root.contenedor["datos"+i].enlace.onRelease = function() {
				_root.titulo_big.text = agenda[i].childNodes[1].firstChild;
				_root.big.loadMovie(agenda[i].childNodes[2].firstChild);
				_root.contenido.htmlText = agenda[i].childNodes[3].firstChild;
			};

			//Evento por defecto
			_root.titulo_big.text = agenda[i].childNodes[1].firstChild;
			_root.big.loadMovie(agenda[i].childNodes[2].firstChild);
			_root.contenido.htmlText = agenda[i].childNodes[3].firstChild;

		}
	} else {
		trace("error en cargar la información");
	}
};
El problema está que al presionar el boton ENLACE, los campos contenido, big y titulo big no se llenan.
__________________
Yara
tomxavier.com