# Rotate Towards Movieclip?

**URL:** https://forum.kirupa.com/t/rotate-towards-movieclip/332505
**Category:** flash
**Created:** [July 5, 2014, 12:14am UTC](https://forum.kirupa.com/t/rotate-towards-movieclip/332505 "2014-07-05T00:14:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Dibbie](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@Dibbie](https://forum.kirupa.com/u/Dibbie)
#### Post date: [July 5, 2014, 12:14am UTC](https://forum.kirupa.com/t/rotate-towards-movieclip/332505/1 "2014-07-05T00:14:36Z")

</div>

Hey,  
I have 2 movieclips, lets call it MCa, and MCb.

I want MCb to rotate in the oposite direction as MCa, so that MCb is ALWAYS facing MCa.  
How might I go about doing that?

This code here is for the MCa, so that MCa rotates, always looking at the mouse, I want to same logic applied to MCb, except instead of the mouse its always looking at MCa. Iv tried just renaming the variables, so instead of using the mouse x/y loc, I used MCa x/y loc, but nothing happened.

```auto

// find x and y differences
    disx = _root._xmouse-_x;
    disy = _root._ymouse-_y;
    // calculate the angle
    Radians = Math.atan2(disy, disx);
    // convert to degrees and set rotation
    Degrees = 360*Radians/(2*Math.PI) + 50;
    _rotation = Degrees + 50;

```
