--Not Using Multiple Movieclips--
The code for a one-movie clip version of this code is very similar. Let's start by adding to the first frame of our movie, the action script given in step 1 above. This code works the same way in this instance. We will not be loading external MC's, so the only other way to get new content on the screen is to move to another frame somewhere in the movie. Therefore we will move to a new frame on the timeline, and set this as our theoretical page2. It will contain the same code given in step 2. Ok, guess what? The code described in step 3 is also the same! Just navigate to the new frame that contains the content that is your page2 and place a back button there with the code I mentioned.
Ok, finally - some differences; Step 4 will be different because we are not loading MC's - we are jumping to different frames. Let's look at the code:
// ///////////////////////////////////////////
// history object functions
// //////////////////////////////////////////
function go () {
trace (_level0.history[_level0.history.length-2]);
if (_level0.history[_level0.history.length-2] == "page1") {
_level0.onPage1 = "yes";
with (_root) {
gotoAndStop(1);
}
} else {
with (_root) {
gotoAndStop(_level0.history[_level0.history.length-2]);
_level0.onPage1 = "no";
}
}
_level0.history.splice(_level0.history.length-1, 1);
}
// /////////////////////////////////////////////
// omniMode & linking functions
// ////////////////////////////////////////////
function omniLink (pageToLoad) {
with(_root){
gotoAndStop (pageToLoad);
}
_root.cameFrom = _root.referrer;
}
As you can see - Above are the history object and omniMode Linking. A few changes have been made. First, instead of loading movies, we are jumping to frame labels in the movie. I named a frame "page2" and a frame "page3." On the omniLink, I just tell the root movie to jump to the frame requested from the page2 or page3 buttons.
This about covers it all - I have provided source files for the above tutorial. They are very stripped down FLA's
and contain no format - just functionality. They are:
master.fla -- the multi-movieclip master movie.
page2.fla -- the multi-movieclip page2 movie.
master_no_external.fla -- the single movieclip history movie.
Feel free to email me with questions: bpritchard@blattnerbrunner.com.