Roll out animation code onMousepress STAY help!

hi!

i’ve been trying to code a small variation into the normal roll over roll out animations… i want the animation to stay on the last frame once i click the button. but when i put the code in it dosent even bother playing the rollover/out animations it just goes to the end frame… anyway here is the code so any help would be apreciated!


stop(); 
this.onEnterFrame = function(){ 
if(rewind == true){ 
prevFrame(); 
} 
} 
if (this.onPress = function(){gotoAndPlay (5);}){
}else{
this.onEnterFrame = function(){ 
if(rewind == true){ 
prevFrame(); 
} 
} 
 
this.onRollOver = function(){ 
rewind = false; 
play(); 
} 
this.onRollOut = function(){
rewind = true;
}
}