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!