Comunidad de diseño web y desarrollo en internet online

:: AS3 ESTADO CLICKED ::

Citar            
MensajeEscrito el 05 Sep 2007 03:32 pm
hola estoy comenzando con action script 3. estoy utilizando el componente boton que trae flash. Lo que intento hacer es que cuando clickee un boton se quede en estado clicked y que si hay uno clickeado antes le haga rollout, alguien tiene idea si se puede hacer?

Por thacon

53 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 05 Sep 2007 06:01 pm
como si fuera un toggle button o necesitas del MouseEvent.MOUSE_DOWN???

Por master_of_puppetz

Claber

2483 de clabLevel

7 tutoriales
3 articulos

Genero:Masculino   Premio_Secretos

WebDev (Flex + PHP + JS)

firefox
Citar            
MensajeEscrito el 05 Sep 2007 06:48 pm
estoy usando el evento mouse_down. tenes idea de como hacer?

Por thacon

53 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 05 Sep 2007 08:39 pm
pero no te termino de entender, quieres hacer una botonera con toggle buttons???
o quieres capturar el evento cuando se mantiene presionado el boton izquierdo sobre un boton???

Por master_of_puppetz

Claber

2483 de clabLevel

7 tutoriales
3 articulos

Genero:Masculino   Premio_Secretos

WebDev (Flex + PHP + JS)

safari
Citar            
MensajeEscrito el 05 Sep 2007 09:02 pm
te explico. en as2 tenia un componente para crear botones. guardaba el movie clickeado en una variable, entonces cuando apretaba otro boton podia hacerle rollout.
En as3 intente hacer lo mismo pero como no maneja variables globales no lo puedo hacer. por eso preguntaba si alguien lo sabia hacer o en todo caso hacerlo pero con el componente boton que trae el flash cs3. Muchas gracias por tu ayuda.

Por thacon

53 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 06 Sep 2007 01:00 am
ok, creo que ya te entendí, cuando invokes el evento MOUSE_DOWN, tienes que agregar el objeto a una variable global del mismo tipo que los botones, supongamos que es de tipo Button:

Código :

var boton:Button = new Button();
var boton1:Button = new Button();
var boton2:Button = new Button();
var boton3:Button = new Button();
boton1.addEventListener(MouseEvent.CLICK, mouse_down);
boton2.addEventListener(MouseEvent.CLICK, mouse_down);
boton3.addEventListener(MouseEvent.CLICK, mouse_down);
/***pones todo el codigo del boton: etiqueta, ancho, alto, etc***/
//Los agregas al stage
addChild(boton1);
addChild(boton2);
addChild(boton3);
//puedes inicializar el boton con alguno
boton = boton1;
function mouse_down(e:MouseEvent):void {
   //haces lo que tengas que hacer con el boton seleccionado
   [...]
   //igualas el boton clickeado al nuevo
   boton = Button(e.currentTarget);
}


Espero que eso te sirva.
Saludox!!! ^^

Por master_of_puppetz

Claber

2483 de clabLevel

7 tutoriales
3 articulos

Genero:Masculino   Premio_Secretos

WebDev (Flex + PHP + JS)

firefox
Citar            
MensajeEscrito el 06 Sep 2007 11:22 am
ahora lo voy a probar. muchas gracias por tu ayuda.

Por thacon

53 de clabLevel



Genero:Masculino  

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.