First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing! | Flash Jobs
Search tutorials
Author: Ben Pritchard/Dave Karpinski | Website: http://www.blattnerbrunner.com

--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.

» Level Advanced

Added: 2001-12-21
Rating: 8 Votes: 27
(10 being the highest)
» Author
Easy 4 step history object for flash movies and externally loaded movie clips.
» 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.