# currentFrame

**URL:** <https://forum.kirupa.com/t/currentframe/324427>\
**Category:** flash\
**Created:** [August 20, 2011, 9:56am UTC](https://forum.kirupa.com/t/currentframe/324427 "2011-08-20T09:56:46Z")\
**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 20, 2011, 9:56am UTC](https://forum.kirupa.com/t/currentframe/324427/1 "2011-08-20T09:56:46Z")

</div>

hi,  
i am trying to make a commend that whem it arrive the last frame it will  
come automatic to the start, but it doesn’t work.

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);  
}  
}**
