# Point at Mouse

**URL:** https://forum.kirupa.com/t/point-at-mouse/76560
**Category:** Uncategorized
**Created:** [January 19, 2005, 2:48pm UTC](https://forum.kirupa.com/t/point-at-mouse/76560 "2005-01-19T14:48:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![VoS](https://avatars.discourse-cdn.com/v4/letter/v/22d042/32.png) [@VoS](https://forum.kirupa.com/u/VoS)
#### Post date: [January 19, 2005, 2:48pm UTC](https://forum.kirupa.com/t/point-at-mouse/76560/1 "2005-01-19T14:48:39Z")

</div>

hey, i need the help of some of u trigonomitry people out there )  
ive created a black box with the dimensions 100 \*5 and made it into a movie clip with the center in the right corner  
and with this AS i was hoping to make it always point at the mouse

```auto

onClipEvent (enterFrame) {
	xd=_root._xmouse-this._x;
	yd=_root._ymouse-this._y;
	this._rotation=100*Math.tan(xd/yd)*-1;
	trace("rotation "+this._rotation);
	trace("x_dist "+xd);
	trace("y_dist "+yd);
}

```

now this , is not working =)  
and i want to know how i would make it work so one of the short ends of the box is always pointing in the direction of the mouse.

Thanks  
VOS
