# Menu following Mouse

**URL:** https://forum.kirupa.com/t/menu-following-mouse/168988
**Category:** flash
**Created:** [November 11, 2005, 10:12pm UTC](https://forum.kirupa.com/t/menu-following-mouse/168988 "2005-11-11T22:12:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![andreas\_h87](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@andreas\_h87](https://forum.kirupa.com/u/andreas_h87)
#### Post date: [November 11, 2005, 10:12pm UTC](https://forum.kirupa.com/t/menu-following-mouse/168988/1 "2005-11-11T22:12:42Z")

</div>

Hello everybody!

```auto

menuMC.onEnterFrame = function() {
	var yMouse = _root._ymouse;
	if (Math.abs(yMouse-this._y)<1) {
		this._y != 100;
	} else {
		this._y -= (this._y-yMouse)/10;
	}
};

```

I made this small code but now I have the problem that the menu is following the mouse everywhere in my small movieclip on the \_y axle.

How can I rewrite the code so tha moveclip is inside an area.

Please, But I don’t want to use drag and drop.
