[F5] Looping in Actionscript (or another solution)

Hey, anyway, my problem is this, I am creating a photo gallery, but I want it to scroll when the user puts their cursor over a button. The code I’ve used so far is this

on(rollOver){
var scroller = scroller +1;
gotoAndStop(scroller);
}

which works fine, however I can’t figure out a way to constantly execute this script for as long as the user keeps their cursor on the button (which this code is in). The only thing I can think of is using an if statement, but Im still fairly new to actionscript, and Ive tried a few diffrent ways and haven’t had much luck. Any help would be appreciated! Thanks!