# A little help with follow mouse cursor \[fmx\]

**URL:** <https://forum.kirupa.com/t/a-little-help-with-follow-mouse-cursor-fmx/23174>\
**Category:** Uncategorized\
**Created:** [June 13, 2003, 11:50pm UTC](https://forum.kirupa.com/t/a-little-help-with-follow-mouse-cursor-fmx/23174 "2003-06-13T23:50:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DDD](https://avatars.discourse-cdn.com/v4/letter/d/9fc348/32.png) [@DDD](https://forum.kirupa.com/u/DDD)\
**Post date:** [June 13, 2003, 11:50pm UTC](https://forum.kirupa.com/t/a-little-help-with-follow-mouse-cursor-fmx/23174/1 "2003-06-13T23:50:46Z")

</div>

let me describe the .fla. I have a mc in the middle (logo) and I have 1 button to either side of the mc logo. The one on the left is yes and the other is no. What I am trying to make happen is when the person mouses over the button (yes). I want the logo to slide over to the button and when a mouse out occurs slide back to the middle (smoothly) like wise for the other button. Any help would be greatly appreciated. Oh yeah this happens only on the x axis (the sliding that is)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 14, 2003, 12:28am UTC](https://forum.kirupa.com/t/a-little-help-with-follow-mouse-cursor-fmx/23174/2 "2003-06-14T00:28:36Z")

</div>

```auto
var xrstr = xctrl=logo._x, ease = 10;
logo.onEnterFrame = function() {
	this._x += (xctrl-this._x)/ease;
};
yes.onRollOver = no.onRollOver=function () {
	xctrl = this._x;
};
yes.onRollOut = no.onRollOut=function () {
	xctrl = xrstr;
};

```

😉
