Foros del Web » Creando para Internet » Flash y Actionscript »

xml y función addEventListener

Estas en el tema de xml y función addEventListener en el foro de Flash y Actionscript en Foros del Web. Hola buenos días A ver si alguien me puede ayudar. Esto haciendo un script que me muestra los resultados de un xml y luego dentro ...
  #1 (permalink)  
Antiguo 30/09/2012, 03:39
 
Fecha de Ingreso: junio-2008
Mensajes: 10
Antigüedad: 15 años, 11 meses
Puntos: 0
xml y función addEventListener

Hola buenos días

A ver si alguien me puede ayudar.

Esto haciendo un script que me muestra los resultados de un xml y luego dentro de cada resultado he creado un boton para ampliar información. Dicha información la tengo oculta en una caja de texto mediante visible = false.

Bien a la hora de crear la función MouseEventClick y meterle visible = true, si me muestra 3 resultados, por ejemplo, pulse el botón que pulse siempre se me muestra el campo oculto del último resultado pero no del resto.

Espero haberme explicado, pongo el código.
Código:
//XML
            var loader:URLLoader = new URLLoader();
            loader.addEventListener(Event.COMPLETE,loader0Handler);
            var ruta:URLRequest = new URLRequest("archivo.xml");
            loader.load(ruta);
         }
      
         function loader0Handler(event:Event)
         {
            var posX:Number = new Number(10);
            var posY:Number = new Number(255);
            var cargador:URLLoader = event.target as URLLoader;
            var xml:XML = new XML(cargador.data);
      
            for each(var nodo:XML in xml.elements())
            {
               var cita:Cita = new Cita();
               escenario.addChild(cita)
               cita.x = posX;
               cita.y = posY;
               cita.re_descripcion.text = nodo.descripcion;
               cita.re_lugar.text = nodo.lugar;
               cita.re_direccion.text = nodo.direccion;
               cita.re_detalle.text = nodo.detalle;
               cita.re_dia.text = nodo.dia;
               cita.re_detalle.visible = false;
               cita.re_boton.addEventListener(MouseEvent.CLICK,function(){cita.re_detalle.visible = true;});
               
               if(posY == 255)
                  {
                     posY = 645;
                  }
            
               else
                  {
                  posX = 10;
                  posY = posY + 390;
                  }
            }
Gracias por adelantado

Etiquetas: addeventlistener, xml, botones
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:59.