Move a MC with LEFT and RIGHT Buttons AND STOP when it should

I know everyone has wrote this a hundred times,
BUT I just can’t get it to work

I have a main content area called MC that is very wide
Then a mask around the area I want to see of the MC

I have two buttons set up below the mask for LEFT and RIGHT

How to I make those buttons move the main content, and stop when It gets to the end of the masked area so you dont just keep scrolling

ALL I HAVE in my code right now, is attached the left and right buttons—
on(release){
MC._y = (MC._y)-50;
}

is there more to it than that?
How do I stop it?

HELP!