Easing shape in menubar

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:


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!

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

Skip the “_y” part in the onEnterFrame;)

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(-: