Ver Mensaje Individual
  #8 (permalink)  
Antiguo 04/03/2010, 14:25
juandedios
 
Fecha de Ingreso: mayo-2003
Ubicación: Lima
Mensajes: 967
Antigüedad: 21 años
Puntos: 8
Respuesta: Scroll de una imagen con el mouse con as3

Bueno para que salga el movimiento como yo lo quería, cambie algo el codigo:

Código AS3:
Ver original
  1. import flash.display.Stage;
  2. import flash.display.StageDisplayState;
  3. import flash.display.MovieClip;
  4. import flash.display.Graphics;
  5.  
  6. var centro = stage.stageHeight/2;
  7. var centro2 = stage.stageWidth/2;
  8.  
  9. fondo.x = 0 - stage.stageWidth;
  10. fondo.y = 0 - stage.stageHeight;
  11.  
  12. fondo.addEventListener(Event.ENTER_FRAME, mover);
  13.  
  14. function mover(e:Event):void {
  15.     var posx = stage.mouseX+(centro2-stage.mouseX)*(fondo.width/(centro2*3));
  16.     var posy = stage.mouseY+(centro-stage.mouseY)*(fondo.height/(centro*3));
  17.    
  18.     x += (posx - x) * 0.07;
  19.     y += (posy - y) * 0.07;
  20. }
__________________
El aprendiz.