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

Codigo para anterior slide

Estas en el tema de Codigo para anterior slide en el foro de Flash y Actionscript en Foros del Web. Buenas a todos, mi duda es sobre un codigo. Esto lo saque de un ejemplo, pero solo incluye el codigo para el boton Siguiente es ...
  #1 (permalink)  
Antiguo 20/11/2005, 22:28
Avatar de Residente  
Fecha de Ingreso: mayo-2005
Ubicación: Lima - Perú
Mensajes: 282
Antigüedad: 18 años, 11 meses
Puntos: 0
Codigo para anterior slide

Buenas a todos, mi duda es sobre un codigo.

Esto lo saque de un ejemplo, pero solo incluye el codigo para el boton Siguiente es una instancia de Button , con nombre next_btn.

Cita:
// function for the Next button
function nextMenuItem(eventObj:Object) {
slideShow_mc.gotoAndPlay("slide"+(currImage));
if ((currImage+1)>=totalImages) {
currImage = 0;
} else {
currImage++;
}
menu_mc.title_txt.text = this._parent["image"+currImage+"title"];
menu_mc.description_txt.text = this._parent["image"+currImage+"desc"];
}

// add the event listener for the Next button
next_btn.addEventListener("click", nextMenuItem);
Quisiera añadirle tambien un boton Anterior o previo pero no se cual seria el codigo necesario.

Espero me ayuden, gracias.
__________________
El Perú lo tiene todo ¡Vívelo!
www.pixelproducciones.com
  #2 (permalink)  
Antiguo 25/11/2005, 10:04
Avatar de bernethe  
Fecha de Ingreso: abril-2004
Ubicación: San José, Costa Rica
Mensajes: 384
Antigüedad: 20 años
Puntos: 2
Va esta respuesta, a ver si sirve.

Código:
// function for the Next button
function nextMenuItem(eventObj:Object) {
	slideShow_mc.gotoAndPlay("slide"+(currImage));
	if ((currImage+1)>=totalImages) {
		currImage = 0;
	} else {
		currImage++;
	}
	menu_mc.title_txt.text = this._parent["image"+currImage+"title"];
	menu_mc.description_txt.text = this._parent["image"+currImage+"desc"];
}
// function for the Back button
function backMenuItem(eventObj:Object) {
	slideShow_mc.gotoAndPlay("slide"+(currImage));
	if ((currImage-1)<=0) {
		currImage = totalImages;
	} else {
		currImage--;
	}
	menu_mc.title_txt.text = this._parent["image"+currImage+"title"];
	menu_mc.description_txt.text = this._parent["image"+currImage+"desc"];
}
// add the event listener for the Next button
next_btn.addEventListener("click", nextMenuItem);
back_btn.addEventListener("click", backMenuItem);
__________________
..::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 09:46.