# Constrain movement to path

**URL:** <https://forum.kirupa.com/t/constrain-movement-to-path/306043>\
**Category:** flash\
**Created:** [March 8, 2010, 7:53pm UTC](https://forum.kirupa.com/t/constrain-movement-to-path/306043 "2010-03-08T19:53:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mthicke](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@mthicke](https://forum.kirupa.com/u/mthicke)\
**Post date:** [March 8, 2010, 7:53pm UTC](https://forum.kirupa.com/t/constrain-movement-to-path/306043/1 "2010-03-08T19:53:02Z")

</div>

How would I allow the user to move (drag) a shape ie circle along a path but not off the path.

If the path were a polyline, the shape could move back and forth and along the line but not completely off the line (but the shape isn’t constrained by a point, rather it can be moved across the line until the farthest edge just touches the line)

Sorry if I haven’t described it clearly enough, I have tried to search for this but haven’t been able to find anything.
