# Back and Forward Buttons

**URL:** <https://forum.kirupa.com/t/back-and-forward-buttons/28816>\
**Category:** flash\
**Created:** [August 18, 2003, 11:17pm UTC](https://forum.kirupa.com/t/back-and-forward-buttons/28816 "2003-08-18T23:17:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![manguvilla](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@manguvilla](https://forum.kirupa.com/u/manguvilla)\
**Post date:** [August 18, 2003, 11:17pm UTC](https://forum.kirupa.com/t/back-and-forward-buttons/28816/1 "2003-08-18T23:17:56Z")

</div>

Hi! guys  
Do you know of any codes or scripts that will prevent the back and forward button of a browser to kick you out of the site? (in Flash)  
I know the easy way is to open another window from an Enter button, and I also tried one of those scripts posted earlier and also in MX those Anchor stuff that don’t work.  
If you have any idea please let me know.

I will not go to sleep until someone give me an answer.

Thanks:cyclops:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 19, 2003, 12:01am UTC](https://forum.kirupa.com/t/back-and-forward-buttons/28816/2 "2003-08-19T00:01:57Z")

</div>

> I will not go to sleep until someone give me an answer.

I hope you have a pot of coffee, because I have no idea what you’re talking about!! 😛

You mean the browser’s back button or navigation through Flash?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 19, 2003, 12:10am UTC](https://forum.kirupa.com/t/back-and-forward-buttons/28816/3 "2003-08-19T00:10:39Z")

</div>

I found some stuff for you if you mean the browser’s back button:  
Here’s a link that says you can’t but offers cheats:  
[http://forum.java.sun.com/thread.jsp?thread=231710&forum=45&message=828964](http://forum.java.sun.com/thread.jsp?thread=231710&forum=45&message=828964)

This is something else I found which is so true about disabling browser option (if possible):

> 

If you want to annoy your customers by disabling their browser’s  
back button then you’ll have to use JavaScript to do it. That’s  
not an Interchange question.

I’m sure a couple of web searches will come up with specific  
instructions on how to mess with people’s browsers and drive  
customers away from your site.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 19, 2003, 12:35am UTC](https://forum.kirupa.com/t/back-and-forward-buttons/28816/4 "2003-08-19T00:35:45Z")

</div>

Hey FreddyThunder, I guess I did not make myself clear  
I probably need some sleep.  
Maybe not disabling the back and forward buttons, but a script that would allow those buttons to act as if you were in HTML, on a regular site (non flash) back to the frame or scene that one previously viewed, or forward also.  
I played a bit with the Named Anchor settings in MX but don’t work properly.

Hope this is a little clearer.

Mangu

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 19, 2003, 12:42am UTC](https://forum.kirupa.com/t/back-and-forward-buttons/28816/5 "2003-08-19T00:42:17Z")

</div>

I think so…if I get what you’re saying, it’s really easy!!  
Using buttons in Flash to navigate through Flash is cake. You could either have them tell the movie to go to specific places, for instance, on your button, put these actions:

```auto

on(release){
_root.gotoAndPlay(frameNumber);
//or if you don't want it to play:
_root.gotoAndStop(frameNumber);
}

```

if you want it to go back one frame:

```auto

on(release){
_root.gotoAndStop(_currentframe-1);
//or twenty frames back:
_root.gotoAndStop(_currentframe-20);
}

```

Is that what you meant?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 19, 2003, 12:49am UTC](https://forum.kirupa.com/t/back-and-forward-buttons/28816/6 "2003-08-19T00:49:16Z")

</div>

Well[SIZE=1] [COLOR=seagreen]not really[/COLOR][/SIZE] but almost. Can you apply this now to the actual browser buttons? And how? :whistle:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 19, 2003, 1:21am UTC](https://forum.kirupa.com/t/back-and-forward-buttons/28816/7 "2003-08-19T01:21:38Z")

</div>

Wierd…okay, well, I remembered seeing something like that back in the DHTML days (not so long ago) and I found the command and plugged it into Flash like:  
(actionScript in text file below - this forum has a filter on the word ‘javascript:’)

That works for the back button, but for some reason you have to click it twice ??? Not sure why.
