# Easing shape in menubar

**URL:** <https://forum.kirupa.com/t/easing-shape-in-menubar/118602>\
**Category:** Uncategorized\
**Created:** [August 7, 2004, 3:48am UTC](https://forum.kirupa.com/t/easing-shape-in-menubar/118602 "2004-08-07T03:48:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jedinitex](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jedinitex](https://forum.kirupa.com/u/jedinitex)\
**Post date:** [August 7, 2004, 3:48am UTC](https://forum.kirupa.com/t/easing-shape-in-menubar/118602/1 "2004-08-07T03:48:58Z")

</div>

I’m making a horizontal menubar and I want to have a shape slide along with the mouse and snap into place underneath the button when they hover over that button. I want to have the shape ease into place. In one of the tutorials I found this code:

```auto

onClipEvent (load) {
 _x = 0;
 _y = 0;
 speed = 5;
}
onClipEvent (enterFrame) {
 endX = _root._xmouse;
 endY = _root._ymouse;
 _x += (endX-_x)/speed;
 _y += (endY-_y)/speed;
}

```

How do i constrain it to just the x axis and also to snap to those buttons like I mentioned above? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Skribble](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Skribble](https://forum.kirupa.com/u/Skribble)\
**Post date:** [August 7, 2004, 4:31am UTC](https://forum.kirupa.com/t/easing-shape-in-menubar/118602/2 "2004-08-07T04:31:09Z")

</div>

hey dude, this was made by sumone at flashkit for an early design of my site. its kinda like wot u want i think.

---

<div class="post-metadata">

**Author:** ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)\
**Post date:** [August 7, 2004, 6:42am UTC](https://forum.kirupa.com/t/easing-shape-in-menubar/118602/3 "2004-08-07T06:42:09Z")

</div>

Skip the “\_y” part in the onEnterFrame;)

```auto
onClipEvent (load) {
	_x = 0;
	_y = 0;//change this to where you want it positioned
	speed = 5;
}
onClipEvent (enterFrame) {
	endX = _root._xmouse;
	_x += (endX-_x)/speed;
}

```

scotty(-:
