# Moving something on x axis

**URL:** <https://forum.kirupa.com/t/moving-something-on-x-axis/96966>\
**Category:** Uncategorized\
**Created:** [December 15, 2003, 11:19pm UTC](https://forum.kirupa.com/t/moving-something-on-x-axis/96966 "2003-12-15T23:19:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![putch](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@putch](https://forum.kirupa.com/u/putch)\
**Post date:** [December 15, 2003, 11:19pm UTC](https://forum.kirupa.com/t/moving-something-on-x-axis/96966/1 "2003-12-15T23:19:31Z")

</div>

Hey kids,

got a question. On the .fla attached, I have two buttons that can be moved and depthswapped, etc. They can be moved anywhere on the stage. My question is, what would be the as code to make them only move on the x axis (across the stage, thats the right one, right?).

So they would be right next to each other, but have only the option to move on the X axis. Sounds pretty simple, but I cannot figure it out.

Thanks in advance.

P 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 16, 2003, 12:04am UTC](https://forum.kirupa.com/t/moving-something-on-x-axis/96966/2 "2003-12-16T00:04:06Z")

</div>

unexpected file format.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 16, 2003, 12:08am UTC](https://forum.kirupa.com/t/moving-something-on-x-axis/96966/3 "2003-12-16T00:08:57Z")

</div>

hmm, works for me.

Try this:

[http://www.scottberks.com/help/movetest.fla](http://www.scottberks.com/help/movetest.fla)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 16, 2003, 12:12am UTC](https://forum.kirupa.com/t/moving-something-on-x-axis/96966/4 "2003-12-16T00:12:27Z")

</div>

yea that one worked.

change your drag script to this:

```auto

on (press) {
	startDrag(this, false,0 ,this._y, Stage.width, this._y);
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 16, 2003, 12:17am UTC](https://forum.kirupa.com/t/moving-something-on-x-axis/96966/5 "2003-12-16T00:17:52Z")

</div>

Hey that totally worked. So simple.

Thanks man.

P 🙂
