# Allowing Drag ONLY along X axis

**URL:** <https://forum.kirupa.com/t/allowing-drag-only-along-x-axis/155174>\
**Category:** flash\
**Created:** [July 15, 2005, 6:28am UTC](https://forum.kirupa.com/t/allowing-drag-only-along-x-axis/155174 "2005-07-15T06:28:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ratbaggy](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@ratbaggy](https://forum.kirupa.com/u/ratbaggy)\
**Post date:** [July 15, 2005, 6:28am UTC](https://forum.kirupa.com/t/allowing-drag-only-along-x-axis/155174/1 "2005-07-15T06:28:25Z")

</div>

I’ve been trying to allow a MC to be draggable ONLY in the X axis.

currently the drag is triggered onPress and stopped onRelease  
with an if statement within an EnterFrame triggering the “lock” to Y axis, as I want to lock the MC to X axis until (say a value of 400) then it is freely draggable.  
but it gives a “jumpy” effect (i.e. you can see the MC shift and then shift back to it’s “locked” position). From what I figure it’s because there is a slight delay in the “testing” of the if statement.

what is the best way to achieve a draggable MC that is ONLY draggable along the X axis?

Cheers in adv.
