Rollover questions

I am using this code for a rollover. I know it is not the best way.

onClipEvent(enterFrame){
if(this.hitTest(_root._xmouse,_root._ymouse,true)){
this.nextFrame();
}else{
this.prevFrame();
}
}

Here is my problem. Inside the movie clip is an animation with buttons to trigger to go to a different frame. This code bypasses my stop(); actions. Is there a way to make it so it stops on frames that have stop();?