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

redimensionar fotos

Estas en el tema de redimensionar fotos en el foro de Flash y Actionscript en Foros del Web. Buenos dias a todos ! Les cuento que tengo muy pocos conocimientos de Flash, y estoy haciendo una presentacion en cd con fotos (empece hace ...
  #1 (permalink)  
Antiguo 13/02/2004, 07:12
 
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
  #2 (permalink)  
Antiguo 13/02/2004, 10:47
Avatar de ¬...  
Fecha de Ingreso: noviembre-2003
Ubicación: Guatemala
Mensajes: 742
Antigüedad: 20 años, 5 meses
Puntos: 4
usa una funcion parecida a esta para cambiarle de tamaño a los movieClips donde cargas la imagen
Código:
resize_clip=function(wclip,xs,ys){
	wclip._xscale=xs;
	wclip._yscale=ys;
}
// su uso:
resize_clip(elclip,20,40);
__________________
'_'

...
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 05:50.