# Creating a simple back button

**URL:** <https://forum.kirupa.com/t/creating-a-simple-back-button/120675>\
**Category:** Uncategorized\
**Created:** [August 26, 2004, 12:02pm UTC](https://forum.kirupa.com/t/creating-a-simple-back-button/120675 "2004-08-26T12:02:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony\_Bolero](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@Tony\_Bolero](https://forum.kirupa.com/u/Tony_Bolero)\
**Post date:** [August 26, 2004, 12:02pm UTC](https://forum.kirupa.com/t/creating-a-simple-back-button/120675/1 "2004-08-26T12:02:26Z")

</div>

Hi!

I have made a flash site that contains a lot of buttons that loads imported swfs. Now, I want to create a simple back button by using variables.

An example:  
The visitor clicks on the\*\* contact button\*\* which loads the contact.swf  
Then, the visitor clicks on the **About us** button which loads the aboutus.swf.  
Now, the visitor wants to **go back** to to the contact page and hit the **back button** inside the About us page.

The code for loading the pages looks like this:

on (release) {  
\_root.section = “nameofthepage.swf”;  
\_root.transition.gotoAndPlay(“closing”);  
}

Now I want this to happen: When the visitor clicks on the contact button a variable is saved named “contact” and then inserts “contact” in the code of the back button. Something like this:

on (release) {  
\_root.section = “insert the name of the current variable name.swf”;  
\_root.transition.gotoAndPlay(“closing”);  
}

Now, how, you oh migthy actionscriptgods, do I make this happen?
