Tengo unos botones dinámicos y todo funciona bien hasta que tengo que hacer el MouseOver y el MouseOut, ya que me da un error, e intentado varias cosas y no logro entender porque este problema. ya que con el CLICK funciona perfectamente...
Código ActionScript :
var links = ["aqui estoy colocando todos los links //QUE FUNCIONAN BIEN"]; public function Botonera() { var botHome:MovieClip = new botDHome(); var botNosotros:MovieClip = new botDNosotros(); var botProdserv:MovieClip = new botDProdserv(); var botOtros:MovieClip = new botDOtros(); var botContacto:MovieClip = new botDContacto(); //var botFondo:MovieClip = new movEmpty(); var fondos = [botHome, botNosotros, botProdserv, botOtros, botContacto]; var etiquetas = ["Home", "Nosotros", "Productos y Servicios", "Otros", "Contacto" ]; var nX = 193; var nY = 4; for ( var i = 0; i < etiquetas.length; i++) { var miBoton:MovieClip = new Boton(); addChild( miBoton ); miBoton.txtEtiqueta.autoSize = "left"; miBoton.txtEtiqueta.text = etiquetas[i]; //fondos[i].alpha = 0; miBoton.addChildAt(fondos[i], 0); miBoton.txtEtiqueta.x = ( (fondos[i]).width - miBoton.txtEtiqueta.width ) / 2; miBoton.txtEtiqueta.y = ( (fondos[i]).height - miBoton.txtEtiqueta.height ) / 2; miBoton.alpha = 0; miBoton.enlace = links[i]; miBoton.buttonMode = true; miBoton.mouseChildren = false; miBoton.x = nX; miBoton.y = nY; nX += miBoton.width + 2; TweenMax.to( miBoton, 0.5, { alpha: 1, delay: i * 0.4 } ); miBoton.addEventListener( MouseEvent.ROLL_OVER, button_over ); miBoton.addEventListener( MouseEvent.ROLL_OUT, button_out ); miBoton.addEventListener( MouseEvent.CLICK, button_click ); } } function button_over(evento) { //ES AQUI EL PROBLEMA TweenMax.to(evento.target.miBoton, 0.5, { alpha: 1, ease: Strong.easeInOut } ); } function button_out(evento) { //ES AQUI EL PROBLEMA TweenMax.to(evento.target.miBoton, 0.8, { alpha: 0, ease: Strong.easeInOut } ); } function button_click(e:MouseEvent):void { var request:URLRequest = new URLRequest(e.target.enlace); try { navigateToURL(request, '_self'); } catch (e:Error) { trace("Error occurred!"); } } } }