# Text Scrolls forever..how do I get it to stop? My code is included

**URL:** <https://forum.kirupa.com/t/text-scrolls-forever-how-do-i-get-it-to-stop-my-code-is-included/31295>\
**Category:** Uncategorized\
**Created:** [September 20, 2003, 10:36pm UTC](https://forum.kirupa.com/t/text-scrolls-forever-how-do-i-get-it-to-stop-my-code-is-included/31295 "2003-09-20T22:36:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vangogh](https://avatars.discourse-cdn.com/v4/letter/v/df705f/32.png) [@Vangogh](https://forum.kirupa.com/u/Vangogh)\
**Post date:** [September 20, 2003, 10:36pm UTC](https://forum.kirupa.com/t/text-scrolls-forever-how-do-i-get-it-to-stop-my-code-is-included/31295/1 "2003-09-20T22:36:12Z")

</div>

Hey…I have the following code for the actions of my buttons. Right now the text will scroll for days. How do I get it to stop when the text is at the top or bottom?

THANKS. vv

:goatee:  
[AS]//  
scrollUp.onRollover = function(){  
//makes a loop so the movie clip will be scrolled as long as the mouse is over the button  
onEnterFrame = moveUp;  
}

scrollUp.onRollOut = scrollUp.onDragOut = function(){  
//ends the loop so the content stops moving when the mouse leaves the button  
onEnterFrame = null;  
}

scrollDown.onRollover = function(){  
onEnterFrame = moveDown;  
}

scrollDown.onRollOut = scrollDown.onDragOut = function(){  
onEnterFrame = null;  
}

//functions called to move the content mc  
function moveUp(){  
content.\_y -=5;  
updateAfterEvent();  
}  
function moveDown(){  
content.\_y +=5;  
updateAfterEvent();  
}[/AS]
