Movieclip Timeline control

Hi, new to AS3.

I’m trying to animate a MC on the stage before moving to a named stage frame. i want the MC to finish all 27 frames before it advances stage frames. It loops, and traces 1-27, but doesn’t advance the MC framehead. The instance name is correct.
How do I:
MC.play();
wait until MC is finished;
gotoAndStop(“StageFrame”);
?
thanks.

[FONT=Courier New]function gotoLabeledFrame(Event:MouseEvent) {
for (var x:uint=1; xframe<=27; xframe++) {
doorhandle.gotoAndStop(doorhandle.currentFrame+1);
trace(x);
}
gotoAndStop(“LabeledFrame”);
}[/FONT]