# nextFrame problem

**URL:** <https://forum.kirupa.com/t/nextframe-problem/312995>\
**Category:** flash\
**Created:** [August 17, 2010, 8:24pm UTC](https://forum.kirupa.com/t/nextframe-problem/312995 "2010-08-17T20:24:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![02rilund](https://avatars.discourse-cdn.com/v4/letter/0/e68b1a/32.png) [@02rilund](https://forum.kirupa.com/u/02rilund)\
**Post date:** [August 17, 2010, 8:24pm UTC](https://forum.kirupa.com/t/nextframe-problem/312995/1 "2010-08-17T20:24:23Z")

</div>

Hi, I have a movieclip called mySampleMC wich I woluld like to control with a next and a prev button outside the clip (Scene 1). I don´t get any errors in the output, but for some reason it doesn’t work.

Hopefully someone can help me with this, it’s driving me crazy…

“meny” is a movieclip in wich the button “next\_kn” is.  
The code:

```auto
meny.next_kn.addEventListener(MouseEvent.CLICK, nextMouseClickHandler);

function nextMouseClickHandler(event:MouseEvent):void

    {
    if (mySampleMC.currentFrame == totalFrames) {
        mySampleMC.gotoAndStop(1);
    }
	else {
       mySampleMC.nextFrame();
    }
}

```
