# Drag Drop Rotate

**URL:** <https://forum.kirupa.com/t/drag-drop-rotate/332485>\
**Category:** flash\
**Created:** [June 26, 2014, 8:59am UTC](https://forum.kirupa.com/t/drag-drop-rotate/332485 "2014-06-26T08:59:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![The\_Mort](https://avatars.discourse-cdn.com/v4/letter/t/a3d4f5/32.png) [@The\_Mort](https://forum.kirupa.com/u/The_Mort)\
**Post date:** [June 26, 2014, 8:59am UTC](https://forum.kirupa.com/t/drag-drop-rotate/332485/1 "2014-06-26T08:59:59Z")

</div>

I am trying to get different movie clips to drag and rotate independently on the stage

I have found code on the internet which has just one movie in it and does just what I want but when I add a second movie they drag independently but rotate simultaneously. Can anyone tell me where I am going wrong please.

**Movie 1**  
stage.addEventListener(KeyboardEvent.KEY\_DOWN, nextQuestion);

function nextQuestion(event:KeyboardEvent):void {  
//trace(event.keyCode);  
if(event.keyCode == Keyboard.RIGHT)  
{  
dragObject.rotation += 5;  
}  
if(event.keyCode == Keyboard.LEFT)  
{  
dragObject.rotation -= 5;  
}  
}

dragObject.addEventListener(MouseEvent.MOUSE\_DOWN, dragIt);

function dragIt(evt:MouseEvent):void {  
dragObject.startDrag();  
}

dragObject.addEventListener(MouseEvent.MOUSE\_UP, dropIt);

function dropIt(evt:MouseEvent):void {  
dragObject.stopDrag();  
}

**Movie 2**  
stage.addEventListener(KeyboardEvent.KEY\_DOWN, nextQues);

function nextQues(event:KeyboardEvent):void {  
//trace(event.keyCode);  
if(event.keyCode == Keyboard.RIGHT)  
{  
dragObject.rotation += 5;  
}  
if(event.keyCode == Keyboard.LEFT)  
{  
dragObject.rotation -= 5;  
}

}

dragObject.addEventListener(MouseEvent.MOUSE\_DOWN, drag);

function drag(evt:MouseEvent):void {  
dragObject.startDrag();  
}

dragObject.addEventListener(MouseEvent.MOUSE\_UP, drop);

function drop(evt:MouseEvent):void {  
dragObject.stopDrag();  
}

Thank you
