# Moving and aligning an object along a path using startDrag & \_xmouse

**URL:** <https://forum.kirupa.com/t/moving-and-aligning-an-object-along-a-path-using-startdrag--xmouse/181109>\
**Category:** flash\
**Created:** [March 6, 2006, 4:37pm UTC](https://forum.kirupa.com/t/moving-and-aligning-an-object-along-a-path-using-startdrag--xmouse/181109 "2006-03-06T16:37:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![artISgarbage](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@artISgarbage](https://forum.kirupa.com/u/artISgarbage)\
**Post date:** [March 6, 2006, 4:37pm UTC](https://forum.kirupa.com/t/moving-and-aligning-an-object-along-a-path-using-startdrag--xmouse/181109/1 "2006-03-06T16:37:29Z")

</div>

This is my first post here, I hope I can find some help!

i’m busting my brains…

I am trying to build a navigation header for one of my projects right now… the header has a nice curve to it, and I want to get my nav buttons to ease-and-follow the x-coordinate of the mouse cursor, but still snap to the curve…

This is the 1st frame actionscript to get the object (follow) to follow-and-ease with the x-coordinate of the mouse:

mouse\_x = \_xmouse;  
setProperty (\_root.follow, \_x, mouse\_x+((getProperty(\_root.follow,\_x)-mouse\_x)/2));

That works just fine for moving along one axis, but no matter what tweaks I try… I simply cannot get modify this actionscript to get my object to snap to a motion guide. I suppose I could define the path with actionscript, but I am unfamiliar with this technique and I am on a deadline for this project. The only tutorial I found for this method is highly in depth, complex and honestly I just need to bang this out ([http://http://proto.layer51.com/d.aspx?f=952](http://http//proto.layer51.com/d.aspx?f=952))

I tried cheating the actionscript by applying a clip inside of the object (follow), locking it to a motion guide and giving it a similar actionscript to the one above setting a variable for the sub-objects’ y-position… No dice.

If somebody out there has done something similar and could refer me to a tutorial or FLA I would be IMMENSLY appreciative. Any thoughts at all would be great. Many thanks! ~Anthony
