Animating out into a removeMovieClip

It worked. but I found that just having a button that closes a page instantly is to [COLOR=black][FONT=Verdana]abrupt[/FONT][/COLOR] and I think I need to have it animate out before the submenu page closes.

I am goin to make up the following code to help explain what I am hoping to achieve.

I was wondering if I could have something like this:
newmovie1.xbutton.onPress = function(){
      gotoAndPlay(12);
}
[COLOR=blue]if newmovie1.WBF1 = frame 23(){
_root.newWindow.removeMovieClip();
}[/COLOR]

I would like to try to have it where when you click on xbutton it plays the ending animation, but when the movie clip reaches a certain frame it then removes the MovieClip. (in this case frame 23) is this possible?