drag and rotate an object with a mouse click
Hello,
I would like to be able to click on an object and drag it, then rotate it on its axis until I like its position. I have only be able yo drag and drop, I do not know how to implement a continuous rotation. All my shapes are movie clips. Thank you in advance, help is appreciated.
import flash.events.Event;
import flash.events.MouseEvent;
import flash.ui.Mouse;
var rotationSpeed:int = 0;
var rotationValue:int = 0;
var shape:Array = [square,triangle,circle];
for (var i = 0; i < shape.length; i++)
shape.buttonMode = true;
for (var n = 0; n < shape.length; n++)
shape
function beginDrag(event:MouseEvent):void
{
event.target.startDrag();
}
stage.addEventListener(MouseEvent.MOUSE_UP, endDrag);
function endDrag(event:MouseEvent):void
{
event.target.stopDrag();
}
stage.addEventListener(MouseEvent.CLICK, clickStage);
function clickStage(event:MouseEvent):void
{
event.target.rotation +=10;
}
