Play button backwards

hello

im trying to get this button to work, but i can’t seem to get it right. if the user rolls over AND STAYS over the button i want the movie to play all the way through. and if the user rolls over the button and rolls out before the movie hits frame 36 i want the movie to play up to frame 36 and then play backwards. and if the user rolls out after frame 36 i just want it to play backwards. TIA for any help. here’s my code:

stop();

this.onEnterFrame = function(){
if(rewind == true){ //if rewind switch is set to true play backwards
prevFrame(); // play backwards
}
}

this.onRollOver = function(){
rewind = false; //set variable that decides wether ot not to play backwards…
play(); // play this movie clip
}

this.onRollOut = function(){
while (this._currentframe < 36){
this.nextFrame();
}
rewind = true;
}

this.onRelease = function(){
getURL("##","_blank");
}

cut the first onEnterFrame !!

stop();

this.onRollOver = function(){
delete this.onEnterFrame
this.play()
}

this.onRollOut = function(){
if(this._currentFrame <36){
this.onEnterFrame = function(){
this.prevFrame()
}
}else{
this.play()
if(this._currentFrame >=36){
this.onEnterFrame = function(){
this.prevFrame()
if(this._currentFrame == 0){
delete this.onEnterFrame
}
}
}

this is just a quick writing, hope it helps.
i didnt test it, but you can see the logic in this code…

cheers