Can't get it, I think it's pretty simple action script?

I have a movie that I’ve set up as a button. When people roll over it it plays the movie up to a point where the movie stops. then when you roll off it plays the second half of the movie. It is a symmetrical movie (ie same frames are reversed for the second half).

I want it so that if you roll off before it gets to the half way mark it plays from the same point in the second half of the movie that it was up to in the first half (so it looks smooth)

This is what I’ve got right now but when I roll of it just goes to frame 0 not to the fame where I want it. Any help very much appreciated. This code is on the clip.

onClipEvent(load){
  	var whatframe = (clip._totalframes)-(clip._currentframe);
  	this.onRollOver = function(){
  		this.play();
  	}
  	this.onRollOut = function(){
  		this.gotoAndPlay(this.whatframe);
  	}
  }