Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/02/2004, 07:12
robsergar
 
Fecha de Ingreso: junio-2003
Mensajes: 37
Antigüedad: 20 años, 10 meses
Puntos: 0
redimensionar fotos

Buenos dias a todos !
Les cuento que tengo muy pocos conocimientos de Flash, y estoy haciendo una presentacion
en cd con fotos (empece hace una semana !!).
Todo este codigo lo saque de un ejemplo de galeria de fotos que trae el MX, el cual he
modificado un poco para permitir que tome datos de un archivo externo, que indica el titulo
de las fotos y el numero de la primera y ultima foto,Teniendo en cuenta que los nombres de las fotos van de dsc0xxxx.jpg a dsc0nnnn.jpg.

Formato de ejemplo del archivo conf.txt :

&titulo=fotos del periodo 2004&
&fst=8424&
&lst=8573&

Todo hasta acá muy lindo, el problema que tengo es que hay fotos de distintas resoluciones,
y no se como achicar las fotos grandes, y centrar las mas pequeñas.

Si alguien me puede ayudar se lo agradecere eternamente, ya que tengo que entregar este
trabajo el fin de semana.



//--------------------------------------------codigo-----------------------------
// initialize variables and properties
bandera=true
square._alpha = 0;
zona_menu._alpha = 0;
whichPic = 1;
loadVariablesNum("conf.txt", 0);
whichPic = fst;

next.onPress = function() {
if (whichPic<lst && !fadeIn && !fadeOut) {
fadeOut = true;
whichPic++;
if (whichPic >lst) {
whichPic = fst;
}
input = whichPic;
}
};
back.onPress = function() {
if (whichPic>fst && !fadeIn && !fadeOut) {
fadeOut = true;
whichpic--;
if (whichPic < fst) {
whichpic = lst ;
}
input = whichPic;
}
};
_root.onEnterFrame = function() {
// when a new Photo is selected, fade out, load new image, and fade in
if (square._alpha>20 && fadeOut) {
square._alpha -= 20;
}
if (square._alpha<20) {
{trace("whichpic = " + whichPic);
{trace("fst = " + fst);}
{trace("lst = " + lst);}
{trace("bandera = " + bandera);}}
loadMovie("dsc0"+whichPic+".jpg", "square");
fadeOut = false;
fadeIn = true;
}
if (square._alpha<100 && fadeIn && !fadeOut) {
square._alpha += 20;
} else {
fadeIn = false;
}
// limit input field
if (input>lst) {
input = fst;
}
// initiate change to new image when Enter key is pressed
if (Key.isDown(Key.ENTER)) {
fadeOut = true;
whichpic = input;
}
if (Key.isDown(Key.SPACE)) {
if (bandera){
bandera = false;
whichPic=fst;
{trace("entro en bandera")};
{trace("whichpic = " + whichPic)};
{trace("fst = " + fst)};
}
if (!fadeIn && !fadeOut) {
fadeOut = true;
whichpic++;
if (whichPic > lst) {
whichpic = fst ;
}
input = whichPic;
}
}
if (Key.isDown(Key.BACKSPACE)) {
if (!fadeIn && !fadeOut) {
fadeOut = true;
whichpic--;
if (whichPic < fst) {
whichpic = lst ;
}
input = whichPic;
}
}
};
// 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;
};
__________________
Sergio Garcia
Bahia Blanca
Argentina