- Home
- Tutorials
- Flash
- Intermediate
- Creating a Simple Website

Brief Description
Hello again! Ok, to understand the code you should consider what happens when you click a button. Consider that following scenario:
From the "main" page, you press the "Images" button when the the "home" page is currently being viewed. Note that when the home page is visible, the "home" movie is stopped at frame16 on the "actions" layer for that movie. The same behaviour should be portrayed from the "images" and "about" page movies.
After you press the "images" button, the following code will be executed:
on (release)
{
//Will execute when you release the mouse button on the "images" button
if (_root.nextPage == undefined)
{
_root.nextPage = "image.swf";
_root.container.loadMovie("image.swf");
}
else if (_root.nextPage != "image.swf")
{
if (_root.container.midFrame >= _root.container._currentframe)
{
_root.nextPage = "image.swf";
_root.container.play();
}
}
}
This is what this code does: If the "images" button is pressed, check to see if the
"_root.nextPage" variable is defined, if not, initialise it with the string "image.swf" andload the movie "image.swf" in the "_root.container" movie clip which is initially empty. If "_root.nextPage" is denfined then the if "_root.nextPage" doesn't hold the name of the movie requesting to be load ("image.swf") in "_root.container" check to see if the current is not equal the midframe of the currently loaded movie. If the it is on the midFrame at which the movie is stopped, set the the nextPage variable to "image.swf" and player the rest of the movie currently loaded in the "_root.container" movie clip.Remember when we wrote code on the last frame (30) on each page movie? Well when frame thirty of the currently loaded movie is reached it will load the movie whos name is located in the "_root.nextPage" variable. In effect a page transition occurs.
For closure, the folling code is what is executed when the 30th frame of what ever movie is loaded in the "_root.container" movie clip:
_root.container.loadMovie(_root.nextPage);
Ok that is the end of this tutorial. I hope this was some help and you understood it.
You can also add different stuff to each movie page that gives it its own characteristics and such. But make sure that they have the commonalities explained above. That concludes this tutorial.
Click this link to see the completed work: Completed Website
Spread The Word
8 Responses to "Creating a Simple Website" 
|
said this on 04 Feb 2007 5:15:57 PM CST
i found it a little bit d
|
|
said this on 25 Feb 2007 2:46:23 PM CST
I also found it difficult
|
|
said this on 12 Mar 2007 7:13:55 AM CST
well i followed your tt b
im using here is t **Error* **Error** Symbol=menu, on (rel **Error** Sy on Tot |
|
said this on 14 May 2007 4:41:26 PM CST
Hi Thomas, you probably h
var nextPage = co it seems y |
|
said this on 05 Sep 2007 2:04:31 PM CST
fix the link so we can se
|
|
said this on 06 Sep 2007 11:06:47 AM CST
I got the same exact erro
on  |
|
said this on 16 Oct 2007 1:36:23 PM CST
Can I do it using flash c
Thanx |
|
said this on 30 Oct 2008 6:08:28 AM CST
I will try to explain wha
th In the Main.fla you need the container ( x,y = the buttons with t and in the keyframe acti var container.loadMovie(next that it`s all for NOTE: the keyframe wit buttons fo on keyframe 1 var mi on keyfra stop(); on keyf _root.container. it`s a great tutoria |



Author/Admin)