# gotoAndPlay(nextFrame); Trouble

**URL:** https://forum.kirupa.com/t/gotoandplay-nextframe-trouble/201349
**Category:** flash
**Created:** [September 20, 2006, 5:33pm UTC](https://forum.kirupa.com/t/gotoandplay-nextframe-trouble/201349 "2006-09-20T17:33:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![MMXII](https://avatars.discourse-cdn.com/v4/letter/m/ecb155/32.png) [@MMXII](https://forum.kirupa.com/u/MMXII)
#### Post date: [September 20, 2006, 5:33pm UTC](https://forum.kirupa.com/t/gotoandplay-nextframe-trouble/201349/1 "2006-09-20T17:33:26Z")

</div>

I have created two buttons. I want one to play the next frame and one to play the previous frame. I am using the code from the complex button rollover. I have tried several different things but cant seem to get it to work.

I tried to change this

this.onRelease = function(){  
getURL(“solutions.php#fax\_routing”,"\_self");

to this

this.onRelease = function(){  
\_root.gotoAndPlay(nextFrame);

and this

this.onRelease = function(){  
gotoAndPlay(nextFrame);

Any help would be great, thanks!!

```auto

stop(); // stop the movie clip from playing (stop button from growing, we want that when the mouse rolls over only
                                             
this.onEnterFrame = function(){
    if(rewind == true){ //if rewind switch is set to true play backwards
        prevFrame(); // play backwards
    }
}

this.onRollOver = function(){
    rewind = false; //set variable (or switch) that decides wether ot not to play backwards...
    play(); // play this movie clip.. (grow the button(tween));
}

this.onRollOut = function(){
    rewind = true; //set or rewind switch to true so it will play backwards...
}

this.onRelease = function(){
    getURL("solutions.php#fax_routing","_self");
}

```
