Advantage:
This will remove the need to have a movieClipLoader component and have to load a seperate swf for each section of your profile. Allows for smooth transitions between pages(fade in/out, bounce, etc.)
Disadvantage:
Usually causes a larger total file size.
1. To start, first set up a menu with as many different buttons as your like.
Ex:

Here we have an About, Music, and Friends page
2. Make each button a separate movie clip and give each one an instance name.
for this example the instance names are.
aboutBtn_mc
musicBtn_mc
friendsBtn_mc
3. Now to create the content that will go in each section.
For this example I am just going to have the title of the section be the content also but you can add whatever images, text, etc that you want to.
Ex:
Make the content for the about section into a movie clip and give it an instance name of about_mc
now double click on this movie clip to go into it.
4. You must create three layers in this movie clip.
make them Actions, Labels, and Content.
Lock the actions and labels layer. We will only be working in the content layer.
5. In your first frame of the about_mc movie clip make a label and title it "on"
and place a s
top action on the first frame of the actions layer
in the content layer, create whatever type of effect you want the content to appear with. In this example, we create a simple motion tween for the text to move in from off of stage
left and s
top in the middle of the page.
Ex:
and be sure to place a s
top action at the end of the animation.
6. Now skip a few frames just for neatness and place a new label on the labels layer.
title it "off"
in the same frame on the content layer, insert a new keyframe.
7. Now create the exiting effect that you want your content to have. In this example I just made the content move from center stage to off of stage
right.
it is not necessary to place a s
top action at the end of this animation, because it will s
top in the first frame as soon as it loops.
here is what your time line for your about_mc movie clip should look like now.
Ex:
8. Now repeat steps 3 - 7 for each of your content pages. Making sure that you give each content movie clip an "on" and "off" label.
Place each page of content and the menu on seperate layers.
Now we are done with the animation portion of the tutorial. All that is
left now is the action script.
9. Go to your root (Scene 1) timeline and create an actions layer and lock it. Then click on the first frame of the actions layer and press F9 to go to the actions panel.
Actions:
var currentPage = "about_mc";
_root.on
Load = function() {
animateOn("about_mc");
};
function animateOn(page:String) {
eval(page).gotoAndPlay("on");
}
function animateOff(page:String) {
eval(page).gotoAndPlay("off");
}
aboutBtn_mc.onRelease = function() {
if (currentPage != "about_mc") {
animateOff(currentPage);
animateOn("about_mc");
currentPage = "about_mc";
}
};
musicBtn_mc.onRelease = function() {
if (currentPage != "music_mc") {
animateOff(currentPage);
animateOn("music_mc");
currentPage = "music_mc";
}
};
friendsBtn_mc.onRelease = function() {
if (currentPage != "friends_mc") {
animateOff(currentPage);
animateOn("friends_mc");
currentPage = "friends_mc";
}
};
Explanation of AS:
It is highly recommended that you read this so that you actually know what is going on in the action script and to help you with future tutorials and pages of your own
function animateOn(page:String) {
eval(page).gotoAndPlay("on");
}
function animateOff(page:String) {
eval(page).gotoAndPlay("off");
}
this is declaring the functions that will call the page and cause the action decalred to happen.
We make put this in a function because it will be applied to numerous different movie clips.
aboutBtn_mc.onRelease = function() {
if (currentPage != "about_mc") {
animateOff(currentPage);
animateOn("about_mc");
currentPage = "about_mc";
}
};
musicBtn_mc.onRelease = function() {
if (currentPage != "music_mc") {
animateOff(currentPage);
animateOn("music_mc");
currentPage = "music_mc";
}
};
friendsBtn_mc.onRelease = function() {
if (currentPage != "friends_mc") {
animateOff(currentPage);
animateOn("friends_mc");
currentPage = "friends_mc";
}
};
these are the button actions that call the function we made and sets the current page. The if() statement says that if the current page is the one that is not the page on
the screen, then the actions of animating off the current page and animating on the seleted page will happen. Else, nothing will happen.
currentPage = "XXXX_mc" sets the current page to the page that was just animated on.
var currentPage = "about_mc";
_root.onLoad = function() {
animateOn("about_mc");
};
This last piece of AS simply sets up the page.
var currentPage = "about_mc" sets the initial currentPage value for the about page so that you cannot click on the about button to start because it will already be displayed.
The onLoad function says that as soon as the file loads, the "about_mc" movie clip will be the first to call the animateOn function.
currentPageVar.fla
Thank you for reading this tutorial. I hope you find it very helpful with your flash animations. For any help with this tutorial or questions, please post only in this forum thread.
~Flash Mods