Me vendría bien un poco de ayuda si no es molestia.
Basándome en clases que he visto, se me dió por tirarme al mar a ver que pasa y logré que esta funcione, pero quisiera que cada boton se quede en estado presionado, luego del "onRelease" y que al quedar seleccionado ese se deseleccione el resto.
Estoy incluyendo la librería zigo para la animación.
En el . fla coloque 4 movie clips en el escenario a los que llamé
btn_1, btn_2, btn_3, btn_4, dentro de cada uno de ellos hay un movie clip llamado "mc" que cambia de color segun la animación colorTo de zigo que coloqué.
Además usé unos trace para comprobar que funcionara.
fragmento de código en el primer frame del .fla
Código :
#include "lmc_tween.as"
Este es mi archivo llamado boton.as
Código :
/************************************************************************************************************************************************************* ************************************************************* Clase para botones *************************************************************** **************************************************************************************************************************************************************/ class boton extends MovieClip { function boton() { this.useHandCursor = false; //////////////btn///////////////////////////////// _root.btn_1.onRollOver = function() { trace(" Está posandose en el botón 1 "); mc.colorTo(0x0198AB, 1); }; _root.btn_1.onRollOut = function() { trace(" Salió fuera del botón 1 "); mc.colorTo(0x666666, 1); }; _root.btn_1.onPress = function() { trace(" Está presionado el botón 1 "); }; _root.btn_1.onRelease = function() { trace(" Se soltó el botón 1 "); }; //////////////btn_2///////////////////////////////// _root.btn_2.onRollOver = function() { trace(" Está posandose en el botón 2 "); mc.colorTo(0x0198AB, 1); }; _root.btn_2.onRollOut = function() { trace(" Salió fuera del botón 2 "); mc.colorTo(0x666666, 1); }; _root.btn_2.onPress = function() { trace(" Está presionado el botón 2 "); }; _root.btn_2.onRelease = function() { trace(" Se soltó el botón 2 "); }; //////////////btn_3///////////////////////////////// _root.btn_3.onRollOver = function() { trace(" Está posandose en el botón 3 "); mc.colorTo(0x0198AB, 1); }; _root.btn_3.onRollOut = function() { trace(" Salió fuera del botón 3 "); mc.colorTo(0x666666, 1); }; _root.btn_3.onPress = function() { trace(" Está presionado el botón 3 "); }; _root.btn_3.onRelease = function() { trace(" Se soltó el botón 3 "); }; //////////////btn_3///////////////////////////////// _root.btn_4.onRollOver = function() { trace(" Está posandose en el botón 4 "); this.txt_mc.colorTo(0x0198AB, 1); }; _root.btn_4.onRollOut = function() { trace(" Salió fuera del botón 4 "); txt_mc.colorTo(0x666666, 1); }; _root.btn_4.onPress = function() { trace(" Está presionado el botón 4 "); }; _root.btn_4.onRelease = function() { trace(" Se soltó el botón 4 "); }; } }
espero haberme explicado bien, desde ya mil gracias.
espero respuesta.
charlyn