# Press a button to advance to next frame

**URL:** <https://forum.kirupa.com/t/press-a-button-to-advance-to-next-frame/332645>\
**Category:** flash\
**Created:** [September 6, 2014, 8:41pm UTC](https://forum.kirupa.com/t/press-a-button-to-advance-to-next-frame/332645 "2014-09-06T20:41:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deadmaxx](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@Deadmaxx](https://forum.kirupa.com/u/Deadmaxx)\
**Post date:** [September 6, 2014, 8:41pm UTC](https://forum.kirupa.com/t/press-a-button-to-advance-to-next-frame/332645/1 "2014-09-06T20:41:25Z")

</div>

REALLY REALLY REALLY new to Flash, so I’m hoping I can get some help. 🙂

I’m trying to get a button to just advace to the next frame when I click on it. So far the only thing I’ve figured out how to do is getting it to ‘randomly’ choose a frame, but I don’t know how to type out anything to just get it to advace one by one and then start over.

heres my code for the button:

on (press) {

this.Player\_1.gotoAndStop(“2”);  
}

-Player\_1- is the name of the ‘instance’ and the time line with the frames in it.

heres the code for the ‘timeline’:

for actionscripton frame #1 i have:

stop();

then in frame#2 i have:

gotoAndStop(random(10)+3);

any help would be great, thanks 🙂

bsb
