hello everybody, ![]()
i am working with drag and drop game.
i am done with drag and drop. now i have problem in totating the movieclip.
i want movie clip to be rotate using mouse drag. Not using Mouse Click.!!!!
Can any one provide me solution for this?
var isDrageen:Boolean;
var lastX:Number;
var lastY:Number;
var dragX:Number;
var dragY:Number;
stage.addEventListener(MouseEvent.MOUSE_DOWN,down);
stage.addEventListener(MouseEvent.MOUSE_UP,up);
stage.addEventListener(MouseEvent.MOUSE_MOVE,mov);
function down(e:MouseEvent):void{
isDrageen=true;
lastX=mouseX;
lastY=mouseY;
}
function up(e:MouseEvent):void{
isDrageen=false
}
function mov(e:MouseEvent):void{
if(isDrageen){
dragX=mouseX-lastX;
dragY=mouseY-lastY;
MC.rotationY+=dragX/1.65;
MC.rotationX+=dragY/1.65;
lastX=mouseX;
lastY=mouseY;
}
}
North America
Europe, Middle East and Africa
Asia Pacific