currentFrame

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