Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/07/2007, 07:25
Puas
 
Fecha de Ingreso: julio-2006
Mensajes: 6
Antigüedad: 17 años, 8 meses
Puntos: 0
pregunta sobre codigo action script

Hola, queria consultarles por un codigo que uso para album de fotos, el swf lee los jpg ubicados dentro de una carpeta (en el ejemplo, "fotos") y va pasando manualmente una a una, siguiendo el orden de sus nombres (1.jpg, 2.jpg, 3.jpg... etc). Creo que es action script 1.

1) Mi pregunta es la siguiente, primero como pasar este codigo a action script 2, ya que no lo puedo convinar con otras funciones de ese formato.

2) Y lo mas necesario, que no solo se puedan pasar las fotos manualmente, sino que cada X segundos la foto pase sola a la siguiente (reproduccion automatica).

3) La tercer cosa (ya es mucho pedir, lo se) es que si no encuentra un archivo, lea el archivo XX.jpg de ese mismo directorio.

Desde ya, muchisimas gracias!

Código:
//initialize variables and properties
square._alpha = 0;
whichPic = 1;
//initiate change to new image when buttons are clicked
next.onPress = function() {
	if (whichPic<999 && !fadeIn && !fadeOut) {
		fadeOut = true;
		whichpic++;
		input = whichPic;
	}
};
back.onPress = function() {
	if (whichPic>1 && !fadeIn && !fadeOut) {
		fadeOut = true;
		whichpic--;
		input = whichPic;
	}
};
_root.onEnterFrame = function() {
	// when a new Photo is selected, fade out, load new image, and fade in
	if (square._alpha>10 && fadeOut) {
		square._alpha -= 100;
	}
	if (square._alpha<10) {
		loadMovie("fotos/"+whichPic+".jpg", "square");
		fadeOut = false;
		fadeIn = true;
	}
	if (square._alpha<100 && fadeIn && !fadeOut) {
		square._alpha += 100;
	} else {
		fadeIn = false;
	}
	// limit input field
	if (input>999) {
		input = 999;
	}
	// initiate change to new image when Enter key is pressed   
	if (Key.isDown(Key.ENTER)) {
		fadeOut = true;
		whichpic = input;
	}
};
// if a number is entered in the input field but Enter is not pressed, change 
// back to current Photo number when clicking anywhere else
inputField.onKillFocus = function() {
	input = whichPic;
};