Need button control help

I have a movie clip with a button on the main timeline that I want to control in a certain way…

during an on (rollOver) it goes to frame 2 of the main timeline, during an on (rollOut) it returns to frame 1.

On frame 2, there is a level 1 movie clip " clipA " that plays and stops when it reaches the end of the clip.

I need a way to use " on (release) { gotoAndPlay (3) } " but only after ClipA has reached the end of the clip.

I tried to use:

on (release) {
if (this._currentframe == this._totalframes) {

It didn’t seem to work.

Any help would be greatly appreciated!