# Start over current frame

**URL:** <https://forum.kirupa.com/t/start-over-current-frame/324447>\
**Category:** Uncategorized\
**Created:** [August 21, 2011, 9:44pm UTC](https://forum.kirupa.com/t/start-over-current-frame/324447 "2011-08-21T21:44:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jovstern](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@jovstern](https://forum.kirupa.com/u/jovstern)\
**Post date:** [August 21, 2011, 9:44pm UTC](https://forum.kirupa.com/t/start-over-current-frame/324447/1 "2011-08-21T21:44:14Z")

</div>

hi,  
im trying to make a commend that when it arrive the last frame it will  
come automatic to the start, like a loop, but with button.  
it doesn’t work like i did.

thanks.

the code:

**trunkBut.addEventListener(MouseEvent.CLICK, fl\_ClickToGoToNextFrame\_2);  
function fl\_ClickToGoToNextFrame\_2(event:MouseEvent):void  
{  
Object(root).trunkBottom ++;  
Object(root).tree.nextFrame();  
if ( Object(root).tree.currentFrame == 4 )  
{  
Object(root).tree.gotoAndStop(1);  
}  
}**
