How to rotate movieclip with Drag and Drop?
hello everybody,
i working drag , drop game.
i done drag , drop. have problem in totating movieclip.
i want movie clip rotate using mouse drag. not using mouse click.!!!!
can 1 provide me solution 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;
}
}
More discussions in ActionScript 3
adobe
Comments
Post a Comment