Follow mouse

I have a script for an object to follow your mouse, but I want to use it for a menu, and have the object ‘lock on’ to buttons…I have seen it before, does anyone have this offhand?


 
onClipEvent(load){
 yMin = 10; // _height/2
 yMax = 390; // 400-_height/2
}
onClipEvent(enterFrame){
 if(!this.hitTest(_root._xmouse, _root._ymouse, true)){
	 _y += (_root._ymouse-_y)/15;
 }
 if(_y < yMin){
  _y = yMin;
 }else if(_y > yMax){
  _y = yMax;
 }
}