Comunidad de diseño web y desarrollo en internet online

Como puedo agregarle menos velocidad al scroll ? , Ayuda!!

Citar            
MensajeEscrito el 26 Mar 2009 01:41 pm
Hola gente, quisiera preguntarles una cosita, primero les comento lo que hice, un cuadro de texto, llamo al txt y dos flechitas "up" y "down", y realizo el correspondiente scroll , cuando pasa el mouse por encima de la flecha realiza el sroll, aca viene mi pregunta como le vajo la velocidad??? ya q est en -1 y 1 necesito una velocidad bien lenta, o bien se puede hacer en forma de easing??? como seria?, aqui les dejo mí codigo, ayuda!!!

Código ActionScript :

this.loadVariables("texto.txt");
this.Up.onRollOver = function(){
Direccion = "up";
MoverTexto();
}

this.Down.onRollOver = function(){
Direccion = "down";
MoverTexto();
}

function MoverTexto(){
_root.onEnterFrame = function(){
if(Direccion == "up"){
mytext.scroll -= 1;
}else if(Direccion == "down"){
mytext.scroll += 1;
}
}
}
this.Down.onRollOut = function(){
delete _root.onEnterFrame;
}

this.Up.onRollOut = function(){
delete _root.onEnterFrame;
}

Por arieljbon

56 de clabLevel



 

argentina

msie7
Citar            
MensajeEscrito el 26 Mar 2009 09:21 pm
Podrias hacer esto:

Código ActionScript :

function MoverTexto(){ 
   _root.cont = 0;
   _root.onEnterFrame = function()
   {
      if( this.cont++ > 20 )
      {
         this.cont = 0;
         if(Direccion == "up"){ 
         mytext.scroll -= 1; 
         }
         else if(Direccion == "down")
         { 
            mytext.scroll += 1; 
         } 
      }
   }
} 

Por LongeVie

Claber

1741 de clabLevel

1 tutorial

Genero:Masculino  

En un lugar, re moto.

firefox
Citar            
MensajeEscrito el 26 Mar 2009 09:43 pm

LongeVie escribió:

Podrias hacer esto:

Código ActionScript :

function MoverTexto(){ 
   _root.cont = 0;
   _root.onEnterFrame = function()
   {
      if( this.cont++ > 20 )
      {
         this.cont = 0;
         if(Direccion == "up"){ 
         mytext.scroll -= 1; 
         }
         else if(Direccion == "down")
         { 
            mytext.scroll += 1; 
         } 
      }
   }
} 



Gracias, longeVie, pero no me funciona!!! no se que puede ser :( el codigo final me quedo así... puede ser...

Código ActionScript :

this.loadVariables("show.txt");//aquí pones el nombre de tu archivo.txt
this.Up.onRollOver = function(){
Direccion = "up";
MoverTexto();
}

this.Down.onRollOver = function(){
Direccion = "down";
MoverTexto();
}

function MoverTexto(){
   _root.cont = 0;
   _root.onEnterFrame = function()
{
   if( this.cont++ > 20 )
{          
   this.cont = 0;          
   if(Direccion == "up"){
   mytext.scroll -= 1;
} 
else if(Direccion == "down")          
{              
mytext.scroll += 1;
   }
  }
 }
} 

this.Down.onRollOut = function(){
delete _root.onEnterFrame;
}

this.Up.onRollOut = function(){
delete _root.onEnterFrame;
}

Por arieljbon

56 de clabLevel



 

argentina

msie7
Citar            
MensajeEscrito el 26 Mar 2009 09:49 pm
¿Que no funciona? ¿Que hace? ¿Que no hace? ¿Que sale en el trace?

Código ActionScript :

function MoverTexto(){  
   _root.cont = 0; 
   _root.onEnterFrame = function() 
   { 
      trace(this.cont);
      if( this.cont++ > 20 ) 
      { 
         trace("Ejecuta");
         this.cont = 0; 
         mytext.scroll += (Direccion == "up") ? -1 : 1;  
      }
   } 
} 

Por LongeVie

Claber

1741 de clabLevel

1 tutorial

Genero:Masculino  

En un lugar, re moto.

firefox
Citar            
MensajeEscrito el 26 Mar 2009 09:58 pm

LongeVie escribió:

¿Que no funciona? ¿Que hace? ¿Que no hace? ¿Que sale en el trace?

Código ActionScript :

function MoverTexto(){  
   _root.cont = 0; 
   _root.onEnterFrame = function() 
   { 
      trace(this.cont);
      if( this.cont++ > 20 ) 
      { 
         trace("Ejecuta");
         this.cont = 0; 
         mytext.scroll += (Direccion == "up") ? -1 : 1;  
      }
   } 
} 


No funciona el scroll osea no va ni para arriba ni para abajo y en el trace sale 0, tanto Up como Down, nescesitas el fla?

Por arieljbon

56 de clabLevel



 

argentina

msie7
Citar            
MensajeEscrito el 26 Mar 2009 10:04 pm
prueba con:

Código ActionScript :

function MoverTexto(){   
   _root.onEnterFrame = function()  
   {  
      this.ctr = (this.ctr)?this.ctr+1:1;
      if( this.ctr >= 20 )  
      {  
         trace("Si se ejecuta ejecuta esta linea?"); 
         this.ctr = 1;  
         mytext.scroll += (Direccion == "up") ? -1 : 1;   
      } 
   }  
} 

Por LongeVie

Claber

1741 de clabLevel

1 tutorial

Genero:Masculino  

En un lugar, re moto.

firefox
Citar            
MensajeEscrito el 26 Mar 2009 10:38 pm

LongeVie escribió:

prueba con:

Código ActionScript :

function MoverTexto(){   
   _root.onEnterFrame = function()  
   {  
      this.ctr = (this.ctr)?this.ctr+1:1;
      if( this.ctr >= 20 )  
      {  
         trace("Si se ejecuta ejecuta esta linea?"); 
         this.ctr = 1;  
         mytext.scroll += (Direccion == "up") ? -1 : 1;   
      } 
   }  
} 


Listooo, Maestro!!!! :D , funciona a la perfección!!!!, GRACIAS !!!!!!! :wink:

Por arieljbon

56 de clabLevel



 

argentina

msie7

 

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