Comunidad de diseño web y desarrollo en internet online

Descifrar codigo!!!

Citar            
MensajeEscrito el 05 Mar 2010 04:03 pm
Hola, ya se que mucho molesto pero asi se aprende, estoy en una plantilla que me baje de internet, es de una galeria de photos, necesito que alguien me indique o me instruya sobre los eventos del mouse, lo que sucede es que esta platilla tiene cuatro estados: fit screen, original size, 200% y 300%. yo logre hacer que por defaul quedara en original size y no en fit a como venia porque me distorcionaba las fotos, la cuestion es que cuando se esta en los otros 3 estados restantes de zoom hay un evento de mouse que cuando lo pasas sobre la foto esta sigue al puntero y pues si acabo de abrir la imagen y esta en original no quiero que pase eso, solo para los 200 y 300% nada mas pero no en original y pues el fit ya no existe!
aca esta el codigo:

Código ActionScript :

stop();

orginal_width = pic._width;
original_height = pic._height;

double_width = orginal_width * 2;
double_height = original_height * 2;

triple_width = orginal_width * 3;
triple_height = original_height * 3;

current_width = orginal_width;      // the default width
current_height = original_height;   // the default height

pic_speed = 5;

pic_desc.bt0.onRelease = function()
{
   current_width = orginal_width;
   current_height = original_height;
}

pic_desc.bt1.onRelease = function()
{
   current_width = orginal_width;
   current_height = original_height;
}
pic_desc.bt2.onRelease = function()
{
   current_width = double_width;
   current_height = double_height;
}
pic_desc.bt3.onRelease = function()
{
   current_width = triple_width;
   current_height = triple_height;
}

pic.onEnterFrame = function()
{
   if(this._alpha < 100 )
      this._alpha+=pic_speed;

   if( pic._width < orginal_width )
      pic._x = ( orginal_width - pic._width ) / 2;
   else
      pic._x = pic._x - ( _xmouse * ( ( pic._width - Stage.width ) / Stage.width ) + pic._x ) / pic_speed;

   if( pic._height < original_height )
      pic._y = ( original_height - pic._height ) / 2;
   else
      pic._y = pic._y - ( _ymouse * ( ( pic._height - Stage.height ) / Stage.height ) + pic._y ) / pic_speed;
   
   if( pic._width != current_width )
      pic._width -= ( pic._width - current_width ) / pic_speed;
      
   if( pic._height != current_height )
      pic._height -= ( pic._height - current_height ) / pic_speed;
}


Solo diganme que quito o que pongo por favor!!! qu esto se que debe ser algo chiquito y tonto pero ya me ha quitado toda la semana de trabajo :shock:

gracias!!! es urgente :(

Por Myckel Coronado

15 de clabLevel



 

Nicaragua

firefox
Citar            
MensajeEscrito el 07 Mar 2010 12:43 am
Holap :)

Mira, si postearas tu .fla seria as sencillo, aunq creo q basta con quitar estas 2 lineas, (ponlas como comentario // por si me equivoco)


Código ActionScript :

pic._x = pic._x - ( _xmouse * ( ( pic._width - Stage.width ) / Stage.width ) + pic._x ) / pic_speed; 
pic._y = pic._y - ( _ymouse * ( ( pic._height - Stage.height ) / Stage.height ) + pic._y ) / pic_speed;



mmm.... aunq pensandolo bn esto haria q se perdiera el efecto en los otros estados de zoom, si esto pasa, vuelve a poner esas lineas (ctrl+z) jjeje, y prueba reemplazar los 2 if donde estaban las lineas antariosres por estos:


Código ActionScript :

if( pic._width <= orginal_width )       
   pic._x = ( orginal_width - pic._width ) / 2;    
else
       pic._x = pic._x - ( _xmouse * ( ( pic._width - Stage.width ) / Stage.width ) + pic._x ) / pic_speed;

if( pic._height <= original_height )       
pic._y = ( original_height - pic._height ) / 2;
else       
pic._y = pic._y - ( _ymouse * ( ( pic._height - Stage.height ) / Stage.height ) + pic._y ) / pic_speed;     


Prueba las 2 opciones y me cuentas

Por Joren2008

13 de clabLevel



 

Mi Silla

msie7
Citar            
MensajeEscrito el 07 Mar 2010 05:56 pm
OYE y como posteo mi fla???? donde tengoq ue ponerlo para que los puedan bajar????
auque tambien yo m elo baje de flasmo.com el numero es flasmo_gallery_034!!! ahi esta el zip, y yo lo unico que le quite fue el full screen porque me deformaba las imagenes!!! pero dime como posteo el fla!

gracias y yo t eaviso como me quedan las recomendaciones tuyas!!!

Saludes desde Nicaragua :)

Por Myckel Coronado

15 de clabLevel



 

Nicaragua

msie8

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.