# Jumping between two frames at the press of a button

**URL:** https://forum.kirupa.com/t/jumping-between-two-frames-at-the-press-of-a-button/211218
**Category:** Uncategorized
**Created:** [December 28, 2006, 6:20pm UTC](https://forum.kirupa.com/t/jumping-between-two-frames-at-the-press-of-a-button/211218 "2006-12-28T18:20:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dalewb](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/dalewb/32/3029_2.png) [@dalewb](https://forum.kirupa.com/u/dalewb)
#### Post date: [December 28, 2006, 6:20pm UTC](https://forum.kirupa.com/t/jumping-between-two-frames-at-the-press-of-a-button/211218/1 "2006-12-28T18:20:45Z")

</div>

This isn’t working right. From what I understand, it should, but it doesn’t. What am I doing wrong?

```auto

on(release){
    var targetFrame = this._currentframe;
    if(targetFrame == 10){
        gotoAndStop(1);
    }else if (targetFrame == 1){
        gotoAndStop(10);
    }
    trace("Frame number=" + targetFrame)
}

```

The trace returns “1” every time I press the button.
