Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/05/2010, 14:25
albertc
 
Fecha de Ingreso: mayo-2010
Mensajes: 1
Antigüedad: 13 años, 11 meses
Puntos: 0
rotacion de movieclip con movimiento del mouse

Hola. Estoy intentando hacer algo mo esto: http://www.theeggrepublic.com
http://www.flashdo.com/item/3d-tilt-coming-soon-with-countdown-timer-as3/464/full_screen_preview
http://www.soft.se/#index

Tengo algo, pero no me funiona del todo como debe ser, la verdad tengo un conocimiento básico de ActionScript:

var spPrincipal:Sprite= new Sprite();
spPrincipal.addChild(cubo);
cubo.x=0;
cubo.y=0;
spPrincipal.x = stage.stageWidth / 2;
spPrincipal.y = stage.stageHeight / 2;
addChild(spPrincipal);

addEventListener (Event.ENTER_FRAME, rotar)

function rotar (evt:Event):void{

spPrincipal.rotationY = 45 * - ((stage.mouseX -(stage.stageWidth / 2 )) / (stage.stageWidth / 2));
spPrincipal.rotationX = 15 * - ((stage.mouseY -(stage.stageHeight / 2 )) / (stage.stageHeight / 2));

}

Gracias por la ayuda que me puedan dar

Última edición por albertc; 11/05/2010 a las 15:27