DOWNLOADS:
- 
----------------------------------------------------------------------------------------------------------------------------------------
Keep in mind that I am not focusing on the design part in this tutorial so it may not look the best or fancy but it will help you understand the basics of a FULL FLASH PAGE. After you're done with this tutorial, you can start making your own web page and you can add as many graphics as you please.
STEP 2.
The things that we have done in "STEP 1." are the parts of the page that will not be modified from now on, so they won't bather us anymore. The interesting part begins only now. Select "Layer 1" on your stage, and right click it, select Properties ; after you clicked on properties, a little window will pop up ( it's called Layer Properties ), you'll find some interesting options here too but the only thing that we are going to do is to rename this layer to: Background. When this is done, simply hit OK and you'll be back on the stage, you can observe now that the layer is no longer called "layer 1", but "Background". So let's LOCK this layer because we won't use it for a while, you can lock a layer by pressing the little white circle under the little "lock icon".
*** NOTE : I will explain the steps but I will not repeat them everytime I do the step again, so even if you are a total noobie to Flash you will need to know some basic stuff regarding the tools and icons/buttons. It will simply take too much time to explain every step again and again whenever I lock a layer or create a new one.
After you locked the "Background" layer, create a new layer by clicking on the "Insert layer" button, you'll find this button under your layers, it has the same icon as a layer and a little blue "+" on it. After this is done, then rename the new layer to "Actions Layer" ( this will be the layer where we add our code ).
*** NOTE : It is indicated to put your code on a separate layer, like "Actions Layer" because that way you can always track your code really easily. The thing is that whenever you insert a new layer then always make sure that your "Actions Layer" is on the top of all the other layers, that way you'll always see where the code is.
After you are done with the "Actions Layer", insert a new layer and rename it to "Home" ( this si the layer where we'll add the first button, the "Home" button ). After this is done, then draw a grey rectange on the stage ( don't make it too large because it will be a button you know ) and after this is done with the TEXT TOOL write "Home" on the recrange you just created. After this is done then select both the rectangle and the text and go to: Modify>Convert to symbol... or simply press F8. A window will pop up, at the "type" option, select "movie clip" and press OK. Now if you select the button in the Properties Panel you'll observe that you just made a MOVIE CLIP symbol. Now double click the HOME movie clip, so you can edit it. After this si done, right click it and select Distribute to Layers ( this will distribute the text and the shape on 2 separate layers ). Now you'll get 3 layers, the middle layer is already renamed to "HOME", now rename the first layer to "Actions Layer" and the third layer to "Button Backgound", and lock the Actions Layer. Afther all this si done, insert a keyframe to frame 10 to all 3 layers ( it should look like in the following image ):
----------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------
Ok, I presume everything is clear untill now. Do not forget that we are making a MOVIE CLIP button and not a simple "button symbol", so the next steps will be quite tricky. After you are done with those key frames, then select the 10th frame at your "Button Background" layer and change the color from grey to green. Select the first frame of the "Button Background" layer and from the Properties panel choose Tween: Shape ( it's a little drop down menu, next to "Tween" ). This is a simple animation in which the buttons background color will change from grey to green. Hope you done this right ( if you did then the first 9 frames of "Button Background" layer have a light green color and an arrow on it, that means you have a "shape tween" applied to those frame, so you have some sort of an animation ). Ok, not we must add some code, so that the Movie Clip will act as a button.
Select frame 1 of "Actions Layer" and press F9. A window will pop up again, this is the area where you write your code ( I like to call it Actions Panel ). I'll just place the code here and you can copy-paste it ( be sure you have FRAME 1 selected of Actions Layer when you hit F9 ):
----------------------------------------------------------------------------------------------------------------------------------------
stop();
this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
}
}
this.onRollOver = function(){
rewind = false;
play();
}
this.onRollOut = function(){
rewind = true;
}
-----------------------------------------------------------------------------------------------------------------------------------------
I will not waste too much time explaining every code, because I presume that you do have some programming knowledge and understand the code or atleast have an idea what it does. The code above "stops" the movie at the frame where the "stop();" action is placed at ( in our case frame 1 ) and the rest of the code is regarding to your mouse actions, meaning that it will rewind or play when you roll in or out of the button with your mouse pointer. If you wish to know more about movie clip buttons then you can take a look at this great video tutorial that explains the easy steps of making a movie clip button: http://www.kirupa.com/developer/flash8/video/creatingMCbuttons.htm ( great tutorial by LearnFlash.com, a great and simple way to create movie clip buttons ).
After this is done then hit F9 again to close your Actions Panel. Now select frame 10 from "Actions Layer" and press F9 again, we'll add the simple stop(); code again, so that we can stop our movie when it gets to frame 10 ( steps explained in the video tutorial above ). So things should look like this ( and if you hit CTRL+ENTER to test your movie, then when you roll over the button it should change the color from grey to green, try it out by pressing CTRL+ENTER ):
-----------------------------------------------------------------------------------------------------------------------------------------
.
-----------------------------------------------------------------------------------------------------------------------------------------
STEP 3.
Ok, you just made a MOVIE CLIP BUTTON ( altought it does noting on click [ yet ] but it's quite cool, ha ? ). Anyways, let us continue to create other buttons too. Let us go back to our main stage by clicking on the "Stage 1" link next to the Timeline button ( you'll find the Timeline button on top of your first layer, or near that, and the Stage 1 thingie to the right of the Timeline button, CLICK IT ). Ok, now you're back on the main stage where you should have the following 3 layers: Actions Layer, Home, Background. Ok, now let us add another layer and name it to "History". From default this new layer will be on top of Actions Layer ( or on top of the last layer selected by you ), so we have to drag it under Actions Layer, you ask me how ? Well simple, just click the new layer ( that you just named to History ) and do not release the mouse after click, now just drag it down to the position you want ( i prefere right under Actions Layer ). If you didn't get it from first then play with those layers a bit untill you understand how to place them in a right order ( hold click and drag ). Ok, after this is done then add 2 more layers, called: "Runaways" and "Revitalization" ( do not use the quotes, i'm using them so that you may see what they are named as ). If you are ready with this then just as you did with the "History" layer, drag them under the Actions Layer. Your Stage should look something like this:
-----------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------
STEP 4.
Just as in STEP 2, create a button for each new layer that you just created in STEP 3.
*** NOTE : Always make sure that whenever you want to add/draw anything on a certain layer, make sure that YOU HAVE THE CERTAIN LAYER selected. For example, if you want to draw something on "Home" layer, then you should first click on the layer and draw only after that. Otherwise Flash will draw ( from default ) on the last layer selected by you.
After you are done with the buttons, then you could UNLOCK the Background layer by clicking on the lock again, and draw another line to the right of the buttons so that we can mark off the menu area. After this is done then your stage should look something like this:
-----------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------
Before the next step, select Actions Layer from the main stage and by pressing F9. add a stop(); action to Frame 1 and after this is done close the Actions Panel.
STEP 5.
In this step, we'll start building up our work space with data, information ( in our case some text regarding Hollywood ). So we need some aditional key frames and layers. Create 4 new layers and place them under Actions Layer, name the layers to: home_text , history_text , runaway_text , revitalization_text and add 3 frames to all the layers in the stage and some key frames to the layers that you just created. You can add frames by right clicking on the timeline, on a frame and selecting INSERT FRAME ( or by just clicking on the frame you want to insert a new frame and by pressing F5 in that position ), or INSERT KEY FRAME ( same as for INSERT FRAME , the only thing that differes that here you press F6 ). It is essentials that after you added the layers and frames/key frames you must have something like this:
-----------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------
STEP 6.
Ok, after you have the frames the way you see them in that picture we can start with the text/animations. So, select Frame 1 from layer home_text. Make sure it is selected and with the TEXT TOOL add some text to the stage. Example:
-----------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------
After you added the text then select it, by clicking on it ONCE and press F8 to create a new symbol. Choose Type: Movie clip and pess ok, now do this once again, F8 > Movie Clip, OK. So, now, double click your text to enter the Movie clip so you can edit it. Ok, you should have a Layer 1 there, rename it to TEXT MC and create a new layer called Actions Layer. After this is done, insert 9 new frames to each layer and at the end of both layers insert a key frame. If this is done, then on frame 10 of Actions Layer add a stop(); action. Now, select frame 1 of TEXT MC layer and at the Properties Panel select, tween: MOTION. If you done this right then your frames from TEXT MC layer should be colored in a dark pink with an arrow on them. Now select FRAME 1 of TEXT MC layer and click on the text, it should be a movie clip if you take a look at the Properties Panel. Now, you will add an ALPHA "effect" to the COLOR of that movie clip by clicking on the drop down list next to "Color" and by chooseing Alpha and change the value to 0%. If you done everything right, you should see this:
-----------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------
STEP 7.
Now go back to the main stage and select FRAME 2 from the history_text layer. Add some text there too and follow the steps you did with the home text... Select the text you added and make it a movie clip, then again, and animate it. Just repeat the steps in STEP 6 but now with a different text. After this is done then select FRAME 3 from runaways_text and repeat the same steps as in STEP 6. Tthen select FRAME 4 from revitalization_text layer and repeat the steps you done with the other layers. Ok, if all this is done, then you should have some text on each of those 4 layers: home_text, history_text, runaways_text and revitalization_text. If you finished with all these things then your main stage should look like this:
-----------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------
STEP 8.
Now, we will add some simple code to our buttons so when we click on one of them, they should tell the movie to go to a frame where the data/information is. First, I didn't want to complicate this step too much, but then I realized that this is the best way to do it, so prepare and pay much attention:
Select your HOME button ( by clicking it ONCE ) becasue we are going to give it a "name/label". I'll refere to this method again in a later STEP, but first we have to make it for our buttons. So after you selected your HOME button, take a look at your Properties Panel at the bottom of the "window/stage" and see that under Movie Clip, you have a little input area, called <Instance Name>. This area will help us give our Movie Clip a name so that Flash will recognize it after it's name when it searches for it. ( you can give whatewer name you want ). In this tutorial simply name it "home", just click the area where you see <Instance Name> written and write home. If you done this right then it should now look like this:
-----------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------
Ok, after you are done and now your Home Movie Clip is called "home" then select FRAME 1 of Actions Layer and Press F9 to open your Actions Panel. If it's open then we'll add some aditional code that referes to the button ( this is a quite dynamic method to add code to a button, because you will have all the button code in one place so you can track it easily and don't have to spends precious time to find the code on a certain button ). So just add this code:
_root.home.onRelease = function(){
gotoAndStop(1);
}
After you added the code CLOSE your Actions Panel.
CODE EXPLANATION
With the help of that code you will tell your movie to look on the main timeline ( on "root" ) for an object called "home" and when you release that button ( after click, "onRelease" ) a function should accure and it would tell the movie to "go to and STOP" at FRAME 1 of the timeline. I'm sure that some of you don't understand why should it go to and STOP exactly on FRAME 1, well the answer is quite simple, because the data that it should display onRelease is situated on FRAME 1 of the timeline.
Ok, after this is done, then we must follow the same steps for the rest of our buttons. So, select the next button called HISTORY and give it an instance name: history . After this is done, then select again Frame 1 of Actions Layer , press F9 and add this code:
_root.history.onRelease = function(){
gotoAndStop(2);
}
*** NOTE : You can observe that the code for the HISTORY button is almost the same as for our HOME button, but it does have some differences. For example: when the animation accures then the movie won't seach for an object called "home" as it did for the home button, but for an object called "history". And the other thing that differes is that it won't stop at FRAME 1, but at FRAME 2 ( why on FRAME 2 ? well, because the data that it should display is placed on FRAME 2 ).
I know that this may seem a bit complicat for some of you out there but don't worry, if you didn't understand if from first then read it again, try different things and somehow get to the final result. It may seem hard at the beginning but it's not impossible, you just have to take some time and try to understand what we are trying to achieve and what must we do to achive our goals.
Ok, enought of the talk, let's finish the other buttons too, so repeat the steps for the rest of the buttons the only thing that you must change is the code, so, here it is:
Give an instance name to your RUNAWAYS button ( movie clip ) of: runaways . Add the following code to the rest of your code on Frame 1 of Actions Layer:
_root.runaways.onRelease = function(){
gotoAndStop(3);
}
Now, select your last button, the REVITALIZATION movie clip, and give it an instance name of: revitalization . After this is done then add the following code to the rest of the codes on Frame 1 of Actions Layer :
_root.revitalization.onRelease = function(){
gotoAndStop(4);
}
Ok, so we are done with our buttons, now you can test if they work by pressing CTRL+ENTER.
STEP 9.
I can say that we finished with the "design/layout/data" ( almost finished ) part of this site, the only thing that we didn't do yet is a preloader. Well, many people have problems with preloaders, and quite many types of preloaders exist, well, i don't really like those preloaders that load an external .swf so my preloaders are usually on another SCENE inside my flash movie. Let's start with this preloader, don't worry, it's not that hard:
Now, we have to create a new Scene. How we do that ? Well, listen carefully: I'm addicted to shortcuts so instead of describing the long road to get to the SCENE PANEL, just simply press SHIFT+F2.
You'll see that somehwere something new appreared with a Scene 1 inside it, well that is your SCENE PANEL. Explore it for a few seconds and you'll find an ADD SCENE button in that panel. Great, found it ? Click it, now you'll have a new SCENE called "Scene 2".
*** NOTE : Scenes are just like layers, you can drag them and place them in the oder you want them to play.
So, now drag Scene 2 on top of Scene 1. This way whenever you play your Flash movie, the first things that will playe are the movie clips/animations in SCENE 2 and only after SCENE 2 has finished comes SCENE 1 ( since you draged Scene 2 on top of Scene 1, the order has changed, so Scene 2 is number 1 ).
Ok, you'll see that Scene 2 is totaly empty, so you don't have the stuff you had in Scene 1 ( you can toggle between the two scenes by simply clicking on one of them ).
STEP 10.
In this tutorial I don't want to complicate things more then they are so we will create a simple bar preloader ( a bar that scales while the data is loading, i'm sure you saw many os those ).
Let's start with the things that we learned untill now: Rename Layer 1 to Actions Layer, and create 2 more layer ( and drag them under Actions Layer just as we did untill now ) and rename them to: loading_bar , background. If you done everything the way you should have then you will see an empty stage with 3 layer:
-----------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------
You can even observe that you are in Scene 2 by taking a look at the right of the Timeline ( you'll see the "name" of the scene that you are currently viewing )...
STEP 11.
Let's add some graphics to this scene by drawing 2 horizontal lines and adding some static text that says "Please wait, data loading" ( DO NOT FORGET to select the background layer before drawing or writing anything ). The result should look something like this:
-----------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------
After this is done, LOCK your background layer so it won't bather us anymore.
STEP 12.
Now, we'll create our loading bar. It's quite simple, select loading_bar layer and then select the RECTANGLE TOOL ( or press R ) and draw a small rectangle between the 2 lines that we have drown a few minutes earlier. After you have the rectangle in place press F8 to convert it to a Symbol and choose Movie Clip and hit OK. At this moment your Stage should look like this:
-----------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------
STEP 13.
Now, double click the rectagle that you just converted to a movie clip so that we can edit it. Inside the movie clip we have a layer called Layer 1, you know, rename it, to: bar_background.
And now create a new layer called Actions Layer. After all this is done, then we'll add some frames/key frames to this movie, go and select frame 100 in both layers ( you can select more frames at once by holding down CTRL/or SHIFT and by clicking on frames ) and now add a key frame to frame 100 on both layers. This should look like this:
-----------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------
STEP 14.
After you added the aditional frames, it is time to make some adjustments and add some code. Select frame 1 of bar_background layer and after that is done then click on your bar and change it's width to 1. ( you can change the width or height of it by taking a look at your Properties Panel and simply changing W [ <- for width ] or H [ <- for height ] ). After you have the bar width of 1 then click Frame 1 again and at your Properties Panel create a Tween: Shape ( this tween is mostly refered to as SHAPE TWEEN )( this way, you'll make a small tween, that will scale the bar from 1 to 100% ). Your stage should look like this:
-----------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------
I presume everything is OK untill now, so let's add some simple code here. Not much of a code to add actually just select Frame 1 of Actions Layer and perss F9 to open Actions Panel and add a simple stop(); Now close this panel and go back to Stage 2.
STEP 15.
Ok, i hope that you are now at Scene 2 and you see the following layers: Actions Layer, loading_bar and background ( if you are not seeing these layers that means that you are still inside your bar movie clip, so GET OUT OF THERE ).
After this is done then we must add some code and frames here too. First of all select your bar movie clip ( only click ONCE when you select it ) and in your Properties Panel , under where you see Movie Clip written, you will see something else too, something that says "<Instance Name>" ( this <instance name> thingie can help you "name" your symbols ), so click on <Instance Name> and name your button/movie clip to "bar".
-----------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------
After you named your movie clip to "bar" then select it again ( click it ONCE ) and press F9. Now your Actions Panel is open so we can add some code to your "bar" movie clip. Put the following code on it and close Actions Panel:
onClipEvent (enterFrame) {
gotoAndStop(int(_parent.getBytesLoaded()*100/_parent.getBytesTotal()));
}
CODE EXPLANATION
This code is applied on the movie clip with instance name: bar. What it basically does is that, it updates or rather controls the play head of the timeline in the tween_MC ( your bar movie clip ) . It tells that on refresh of the frame, update the current frame of the timeline INSIDE the tween_MC movie clip. int rounds off the total percent loaded.
STEP 16.
After this is done we must add a KEY FRAME to your Actions Layer and normal frames to the rest of the layers. Stage will look like this ( observe how the frames look like, only 1 key frame on Actions Layer's frame 2 and on the other layers normal frames - altought you can add only simple frames and no key frames, but I always like to add an aditional key frame ):
-----------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------
After you are done, then we must add some code here too. Let's start by adding some code on Frame 1 of Actions layer, so select frame 1 and press F9: add this code:
loaded_bytes = Math.round(_root.getBytesLoaded());
loaded_total = Math.round(_root.getBytesTotal());
total_percent = (loaded_bytes/loaded_total)*100;
ifFrameLoaded ("Stage 1", 4) {
gotoAndPlay(1);
}
CODE EXPLANATION
The first line sets the variable loaded_bytes equal to the number of bytes loaded. Math.round makes it a perfect integer (rounds it off). Similarly, loaded_total is the total number of bytes to be loaded. total_percent is the ratio of loaded_bytes and loaded_total times 100. For example, if the total bytes are 200 and currently loaded bytes are 50, then it is 25 % of the total loaded. i.e., (50/200)*100. After this Flash checks "if the frames are loaded" in "Stage 1" and a total number of "4 frames", if this is TRUE then it will "go to and PLAY from frame 1 ).
STEP 17.
Now, there is nothing else to do then to save your Flash Movie/Project by pressing CTRL+S and give it a name, after this is done simply press CTRL+ENTER to test/publish it.
*** NOTE : We created a preloader for this page, but due to it's small size, ( only a few kb ) you will not see it load when you test it ( or it will load really fast - for bigger .swf files it will load just fine, and you can observe the way the bar scales ).
So, we managed to achieve all our goals ( atleast i hope we did ), as i said at the beginning i wasn't focusing too much on detail but on "how a full flash page works". We learned some basic AS like "gotoAndPlay(); gotoAndStop(); play(); and so on" and hopefully you understood that FULL FLASH PAGES are just a HUGE CONTROLLED ANIMATIONS. Meaning that as you can see we simply added some frames, ones with some text written , other with nothing, and we controled the way the animation plays by adding here and there some "stop();" actions or eventualy adding some code to our buttons so they will do what we want them to do..
If you are able to create such simple sites as shown in this tutorial, then in time you will be able to create more complex ones too, the only thing is to focuse more on detail. In web design and not only web deisgn, DETAIL is essencial, you can add Transmission animations, loops, and all kind of cool stuff, you can even add cool animations to your buttons ( and not only a simple color change animation like in this tutorial ). The idea is to understand what you are doing and always know what you are trying to do.
Hope everyone enjoied this tutorial ( as i said it's my first one, so go easy on me :P ) and i hope that some of you out there even learned a few tricks or it simply helped you to understand a bit better how full flash pages work.
So, good bye for now, wish you all luck and don't forget that there is always hope, never give up.
Cheers mates,
Biro
PS: Although this tutorial is not perfect and maybe i did miss some things, but well, there "is always a tomorrow". Hope you guys out there won't have any problems understanding me, because as i mentioned, i'm from Romania, so my main language isn't english...
DON'T FORGET TO COMMENT IF YOU SEE SOMETHING THAT IS NOT WORKING OR DO PLEASE TELL IF YOU GUYS ARE SATISFIED WITH THIS TUTORIAL AND IF IT HELPED ANYONE.
discuss this topic to forum
