Startdrag just on the y

Is there a way to constrain a mc being dragged to just the y coordinate?

Here is the code I’m using so far:

on (press) {
startDrag(this);
}
on (release) {
stopDrag();
}

Thanks!