First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing!
Search tutorials
Author: Nathan Smith | Website: http://www.thecreativeforces.com

Flash Back Buttons - unFocus History Keeper

Also see this tutorial at: http://www.mycreativecollective. com

Purpose:
This has been out for awhile now, but I haven’t seen a lot of tutorials showing how to implement it. This tutorial uses the unFocus History Keeper to add back button functionality to your flash sites. The unFocus History Keeper is great because it doesn’t use frames like one of the most used methods created by Robert Penner.

Demo & Introduction:
You can view this in action at www.thecreativeforces.com. Personally, I don’t know how many times I have been asked why the back buttons don’t work in the all flash site I have just created for a client. With this being said I really like this method because it works in most common browsers out there right now and with the popularity of Fire Fox growing everyday, this is a definite benefit.

How I came across the concept:
I first saw this was an option after it was posted on flash99good.com. After looking into it more, I noticed that no one really had any idea how to make it work at first. In come the great people on the forums at the unFocus history keeper site who eventually worked the problem out.

Before you start:
First download the source files

Using the unFocus History Keeper:
Fist thing you need to do is copy the JavaScript folder into the root of your site. After this, start a new .fla and create two layers. Name the first layer: Back AS and the second one: Player Type. Next, insert the following code into the Back AS layer:

import flash.external.ExternalInterface;

_root.watch('unFocusHistoryUpdate', function(propName, oldValue, newValue) {
query_string_txt.text = propName + " || " + oldValue + " || " + newValue;
trace('watch: '+ newValue);
if (newValue == '') newValue = 'Home';
gotoAndStop(newValue);
// reset the document title (set here so that it maintains
// the title even from a history recall)
ExternalInterface.call('History_setTitle', newValue);
return newValue;
});

_root.gotoNewSection = function (newSection) {
trace('gotoNewSection called');
// first add the history
ExternalInterface.call('History_addHistory', newSection);
// now update the state, otherwise the title gets messed up in the history
_root.unFocusHistoryUpdate = newSection;
ExternalInterface.call('History_setTitle', newSection);
}

if (typeof _root.unFocusHistoryUpdate == 'undefined') {
_root.unFocusHistoryUpdate = 'Home';
}

gotoAndStop(_root.unFocusHistoryUpdate);

We want to put this code into the Player type layer:

_root.playerType = System.capabilities.playerType;

'

» Level Intermediate

Added: 2007-02-02
Rating: 10 Votes: 2
(10 being the highest)
» Author
I am the co-owner of Creative Forces, Inc.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.