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:
'
» Level Intermediate |
Added: 2007-02-02 Rating: 10 Votes: 2 |
» Author |
I am the co-owner of Creative Forces, Inc. |
» Download |
Download the files used in this tutorial. |
Download (87 kb) |
» Forums |
More help? Search our boards for quick answers! |