Stop a function

I’m using the rewind button tutorial from this website here, but I want it to stop rewinding when i click the button, so that it locks at the final frame so when you move your mouse away from it, it still stays at, say frame 31 instead of rewinding back to the beginning

stop();

this.onEnterFrame = function() {
	if (rewind == true) {
		prevFrame();
	}
};
this.onRollOver = function() {
	rewind = false;
	play();
};
this.onRollOut = function() {
	rewind = true;
};

this.onRelease = function() {
	gotoAndStop(31);
};

basically, in that onRelease part of the code, i need it to stop the entire rewind process