Moving something on x axis

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 :slight_smile:

unexpected file format.

hmm, works for me.

Try this:

http://www.scottberks.com/help/movetest.fla

yea that one worked.

change your drag script to this:


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

Hey that totally worked. So simple.

Thanks man.

P :slight_smile: