Comunidad de diseño web y desarrollo en internet online

AUMENTAR LA VELOCIDAD EN UN SCROLL DE IMAGEN POR MOVIMIENTO

Citar            
MensajeEscrito el 29 Nov 2009 07:26 pm
Hola a todos!!!!
Tengo una imagen que muevo según coloco el ratón en la pantalla y he puesto este código:

Código ActionScript :

clip.onEnterFrame = function()
{
   var margen:Number = 250;
  _x=0;
  _y=0;
   //izquierda
   if (_xmouse >= 0 && _xmouse <= margen) {
      this._x++;
   }
   //derecha 
   if (_xmouse <= Stage.width && _xmouse >= Stage.width - margen) {
      this._x--;
   }
   //arriba 
   if (_ymouse >= 0 && _ymouse <= margen) {
      this._y++;
   }
   //abajo 
   if (_ymouse <= Stage.height && _ymouse >= Stage.height - margen) {
      this._y--;
   }
};


El problema es que quiero aumentar la velocidad de desplazamiento y no sé cómo hacerlo.
Me puede ayudar alguien por favor? Me empiezo a desesperar.....
Muchas gracias.

Por caracumic

31 de clabLevel



 

safari
Citar            
MensajeEscrito el 30 Nov 2009 04:14 am
A que te refieres? Quieres volver mas rápido todo en gral o que vayaaumentamdo gradualmente ?

Por Hernán

BOFH

6148 de clabLevel

19 tutoriales
23 articulos

Genero:Masculino   REC Desarrollador de GAIA

Marketing & IT

safari
Citar            
MensajeEscrito el 01 Dic 2009 11:11 pm
A que vaya más rápido todo en general... gracias

Por caracumic

31 de clabLevel



 

safari
Citar            
MensajeEscrito el 02 Dic 2009 12:33 am

Código ActionScript :

var margen:Number = 250; 
var velocidad:Number=4;
clip.onEnterFrame = function() 
{ 
  _x=0; 
  _y=0; 
   //izquierda 
   if (_xmouse >= 0 && _xmouse <= margen) { 
      this._x+=velocidad; 
   } 
   //derecha  
   if (_xmouse <= Stage.width && _xmouse >= Stage.width - margen) { 
      this._x-=velocidad;
   } 
   //arriba  
   if (_ymouse >= 0 && _ymouse <= margen) { 
      this._y+=velocidad;
   } 
   //abajo  
   if (_ymouse <= Stage.height && _ymouse >= Stage.height - margen) { 
      this._y-=velocidad;
   } 
};


Eso debería funcionar.

Saludos, Hernán . -

Por Hernán

BOFH

6148 de clabLevel

19 tutoriales
23 articulos

Genero:Masculino   REC Desarrollador de GAIA

Marketing & IT

firefox
Citar            
MensajeEscrito el 09 Dic 2009 04:53 pm
Muchas gracias!!!!

Por caracumic

31 de clabLevel



 

safari

 

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