Scrolling Text

Alright, I’ve got it scrolling - now how do I make it stop???

The code on the buttons:

on(rollOver){
this.onEnterFrame = function(scrollup){
this.text_mc._y = this.text_mc._y - 10;
}
}
on(rollOut){
delete this.onEnterFrame;
}

I want to make the text stop scrolling when it gets to certain points, i.e. the bottom of the text and the top of the text.

I imagine it’s an if statement. I tried one where i created a variable to get the _y property of the text_mc and told it to delete the scrolling function if the variable == a certain _y number. But it didn’t work, either the code was just wrong and i don’t know what i’m doing or it didn’t recognise the function.

Anyone can help?