# Movements to certain positions on click

**URL:** <https://forum.kirupa.com/t/movements-to-certain-positions-on-click/312969>\
**Category:** Uncategorized\
**Created:** [August 17, 2010, 2:15am UTC](https://forum.kirupa.com/t/movements-to-certain-positions-on-click/312969 "2010-08-17T02:15:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pizzadude223](https://avatars.discourse-cdn.com/v4/letter/p/e95f7d/32.png) [@pizzadude223](https://forum.kirupa.com/u/pizzadude223)\
**Post date:** [August 17, 2010, 2:15am UTC](https://forum.kirupa.com/t/movements-to-certain-positions-on-click/312969/1 "2010-08-17T02:15:45Z")

</div>

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.
