# MC facing mouse with tween

**URL:** <https://forum.kirupa.com/t/mc-facing-mouse-with-tween/315366>\
**Category:** flash\
**Created:** [October 24, 2010, 2:06pm UTC](https://forum.kirupa.com/t/mc-facing-mouse-with-tween/315366 "2010-10-24T14:06:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![luoruize](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@luoruize](https://forum.kirupa.com/u/luoruize)\
**Post date:** [October 24, 2010, 2:06pm UTC](https://forum.kirupa.com/t/mc-facing-mouse-with-tween/315366/1 "2010-10-24T14:06:32Z")

</div>

Hey guys,  
I’m trying to get a MC to rotate to face the mouse using tween:

```auto

import flash.events.MouseEvent;
import fl.transitions.Tween;

stage.addEventListener(MouseEvent.CLICK,clicks);

var tween:Tween;

function clicks(e:MouseEvent):void {
	var dx:Number = mouseX-mc.x;
	var dy:Number = mouseY-mc.y;
	var angle:Number = Math.atan2(dy,dx)*180/Math.PI+90;
	tween = new Tween(mc,"rotation",null,mc.rotation,angle,5);
}

```

While this works fine, there are certain clicks which make the MC pick the longer route to rotate.  
I suck at math and trig… can anyone lend a hand?
