Movements to certain positions on click

I have a credits button for a game. I want it when clicked to bring together two movie clips called top and bottom, then go to a frame labeled 2. I tried this code but it just freezes:

credits_button.addEventListener(MouseEvent.CLICK, CreditClick);
function CreditClick(event:MouseEvent):void {
while(top.y < 113) {
top.y -= 5;
bottom.y +=5;
}
gotoAndPlay(“2”);
}

How would I make this work? Thanks.