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

como distingo con action q boton se seleeciono?

Estas en el tema de como distingo con action q boton se seleeciono? en el foro de Flash y Actionscript en Foros del Web. ESTE ES MI CODIGO with(botonera){ boton1.onRelease = function(){ boton2.enabled = boton3.enabled = boton4.enabled = true; this.enabled =false; if(this.enabled==false) this.gotoAndStop("_seleccion"); } boton2.onRelease = function(){ this.enabled =false; ...
  #1 (permalink)  
Antiguo 31/12/2007, 16:59
 
Fecha de Ingreso: marzo-2007
Mensajes: 302
Antigüedad: 17 años
Puntos: 2
Pregunta como distingo con action q boton se seleeciono?

ESTE ES MI CODIGO

with(botonera){
boton1.onRelease = function(){
boton2.enabled = boton3.enabled = boton4.enabled = true;
this.enabled =false;
if(this.enabled==false) this.gotoAndStop("_seleccion");
}

boton2.onRelease = function(){
this.enabled =false;
boton3.enabled = boton4.enabled = boton1.enabled = true;
if(this.enabled==false) this.gotoAndStop("_seleccion");
}

boton3.onRelease = function(){
this.enabled =false;
boton1.enabled = boton2.enabled = boton4.enabled = true;
if(this.enabled==false) this.gotoAndStop("_seleccion");
}

boton4.onRelease = function(){
this.enabled =false;
boton1.enabled = boton2.enabled = boton3.enabled = true;
if(this.enabled==false) this.gotoAndStop("_seleccion");
}
}


dos preguntas:
1)puedo resumir todo ese codigo con algun ciclo o algo..porq no se me ocurre.
2) con esta linea if(this.enabled==false) this.gotoAndStop("_seleccion"); logro destacar el boton seleccionado pero mi problema es como hacer que vuelva a su estado normal cuando selecciono otro.

grax! :)
  #2 (permalink)  
Antiguo 03/01/2008, 19:22
Avatar de bernethe  
Fecha de Ingreso: abril-2004
Ubicación: San José, Costa Rica
Mensajes: 384
Antigüedad: 19 años, 11 meses
Puntos: 2
Re: como distingo con action q boton se seleeciono?

A ver si entendí:
Código:
function enResumen(bot_btn:Button) {
	for (i in botonera) {
		botonera[i].enabled = true;
		botonera[i].gotoAndStop(1);
	}
	bot_btn.enabled = false;
	if (this.enabled == false) this.gotoAndStop("_seleccion");
}
botonera.boton1.onRelease = function() {
	enResumen(botonera.boton1);
};
botonera.boton2.onRelease = function() {
	enResumen(botonera.boton2);
};
botonera.boton3.onRelease = function() {
	enResumen(botonera.boton3);
};
botonera.boton4.onRelease = function() {
	enResumen(botonera.boton4);
};
__________________
..::BERNETHE::..
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 07:54.