# Smart back button, PLEASE HELP ME!

**URL:** https://forum.kirupa.com/t/smart-back-button-please-help-me/213394
**Category:** Uncategorized
**Created:** [January 19, 2007, 5:23am UTC](https://forum.kirupa.com/t/smart-back-button-please-help-me/213394 "2007-01-19T05:23:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Samurai](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@Samurai](https://forum.kirupa.com/u/Samurai)
#### Post date: [January 19, 2007, 5:23am UTC](https://forum.kirupa.com/t/smart-back-button-please-help-me/213394/1 "2007-01-19T05:23:36Z")

</div>

say I have 5 buttons that go to their corresponding frames (1 to 5):

1 2 3 4 5

I also have a back button. What I am trying to achieve is this:

I click on 5, then on 1, then on 3. the sequence was 5, 1, 3, the last  
button pressed was 3, which is where I am currently. The second last  
button pressed was 1. Now I click the back button. I want the back  
button to recognize that frame 1 is actually the previous frame and not  
frame 2.

I was thinking about global variables, but I have yet to get this concept  
to work for me. If anyone is willing to help I’d appreciate it.

Thanks
