Setting restrictions on mouse follow buttons

how can i make a MC follow the mouse, but only follow the mouse vertically, not horizontally? like stay wherever i stick it horizontally

Are you using startDrag()?

You can do it with start drag like this (on a movie clip)…

onClipEvent (load) {
	this._x = 300;
	this._y = 150;
}
on (press) {
	startDrag(this, true, this._x, 100, this._x, 200);
}
on (release) {
	stopDrag();
}

You define the x and y in the onClipEvent(load)

Then in the on(press) you define a startDrag(clip, lockcenter, left, top, right, bottom)

This puts the clip at _y 150, so you can drag the clip 50px up to 100 or 50 px down to 200.

The on(release) defined the stopDrag() so you can… well… stop dragging the clip.

If you were using anything other than that, you can just remove the _x variables.

Without clicking and dragging it would look like this…

onClipEvent (load) {
	this._x = 300;
	this._y = 150;
}
onClipEvent (enterFrame) {
	startDrag(this, true, this._x, 100, this._x, 200);
}

For a more realistic approach try this…
http://www.kirupa.com/developer/mx/followease.asp

You can do that and just remove any line that says _x or _xmouse in it.

okay the codes working good so far, but how would i make it so when i press the menu button that is following the mouse, that it stops dragging (and goes to frame 2 that shows the rest of the menu. ive attatched the file if it helps.

Here’s a basic drag and drop menu. You can rip it apart and tailor it to your style if you like.
menu.fla
Hope it helps.