Tuesday, 18 November 2008
It has been a big week for tutocity with our last 2 tutorials making the home page of www.good-tutorials.com and one of our designs was featured on deviantart. We hope to continue our recent success with our next group of tutorials that will be releasing soon.

We are currently working on setting up a comment module for our tutorials so that we can start getting some feedback from you guys!
 
Basic Flash Website

Step 5: Now we will be creating our content for our pages. Because these are just test pages I will be using a random text generator such as this one to create my text.

Select frame 1 on the "Pages" layer and then select the text tool (T) Now click where you want your heading to appear and then type "Welcome to my site". Select your text and then change your font settings in the properties window.

Now select the text tool again and now paste in your content. Use a smaller font size for this.

This is how mine is looking.



Now create the content for the rest of your pages.

Step 6: Now its time to add some code to our interface. If you hit Ctrl+Enter to test your flash file you will see your content just rotating through, to fix this and make it so it just stays on the one page we need to add a stop() command on each page.

Select frame 1 on the "Pages" layer and then hit F9 to bring up the actions window. In the actions window add the following code:

stop()                                                                                                      

Now test your flash file again, it should now just stay on your "Home" page. Now place the same code on the rest of your pages.



Step 7: Ok now all thats left for us to do is to tell our buttons what page to go when they are clicked. To do this we need to convert our buttons into symbols and then add in some small acounts of code telling it what page to go to when the mouse button is released.

Select the 1st frame on the "Menu" layer and then select the shape we placed over our home button. Hit F8 to convert the shape to a symbol and name this new symbol "Home". Do the same for our remaining shapes, use the symbol names stated below.

About Me = About
Photos = Photos
Stuff = Stuff
Contact = Contact

Hit Ctrl+L to open up your library if you dont already have it open, you should see your 5 movie clips and your background image.

Now on the menu layer double click on your "Home" movie clip to take us inside the movie clip. Select the very 1st frame and then hit F9 to bring up the actions window and then paste the following code: (We explain the code below!)

this.onRelease = function() {
    _root.gotoAndStop("Home");
};


Ok so what this code does is it waits for an event, which in our case its the release of our mouse button, when this event is triggered it sets of our function. Our Function is telling our _root timeline to jump to our "Home" Frame labe that we created earlier in the tutorial.

Change "Home" in the code to "Contact" and test your flash file. You will notice that when you click on the "Home" button it now sends us to the contact page. Now change it back to "Home".

Now place the same code in the rest of our button movie clips, but of course replacing it with the correct frame label for your button.

Step 7: If you test your flash file now you will notice that your menu is now working but it only works the 1 time, this is because our menu layer only exists on our "Home" page. To fix this select the 5th frame on our "Menu" layer and insert a keyframe Insert > Timeline > Keyframe.

Your flash website should now be working :)

Finished result: Click
Finished file: Download (Flash 8 file)

If you enjoyed this tutorial please show some support for the site by registring. Thank you!

Post your result on the forum! We would love to see how you went :)

Credit: I have forgotten the link to the stock image used in the design but I will link it here as soon as i find it!

For more information on Actionscript code see this site.
Comments
Add New
LJ   |2008-11-25 15:43:29
Thanks for this great tutorial! It's really easy to understand.
But isn't there
supposed to be a bit more information at step 7?
h   |2008-12-09 21:46:20
f
HJKH  - SFS   |2008-12-11 07:08:30
VERY CONFUSED
Amanda   |2008-12-12 16:54:23
Everything works except that when I click on my contact page it won't go back to
any other pages... What am i doing wrong?
Travis  - worked for me   |2008-12-12 19:38:35
i found this tutorial very easy to follow. mine turned out like i was
hoping.

you did seem to leave out that at step #7 to select 'movie clip' when
making the symbol.
Do your tutorial again!  - ?   |2008-12-24 21:21:08
You should remake your tutorial after doing the instructions completely without
prior knowledge, because the instructions do not follow through. The buttons
specifically do not work properly! Check codes? or process?
reham  - thanks   |2008-12-25 00:09:15
thanks it is easy to understand
Andreas  - actionscript 3   |2008-12-28 19:10:36
I didn't understand why I was getting all these strange errors, and then I found
out that I was programming in actionscript 3. Then I switched to actionscript 2,
and it worked. Make sure you don't make the same mistake :)
clarissa  - doubt please !!!!!   |2009-01-13 07:38:53
Your tutorial are super easy. By my doubt is in the labels created as pages, can
we have movieclips with animations running on the same page.
Kindly help.
nadavec  - dude i have a qusetion...   |2009-01-15 19:21:20
i did every things ok but when i finished and i am playing it only the home
butten work... and i did that on action script 0.2..pls help me
Joana  - Thanks   |2009-02-02 20:41:10
Hey this tutorial was great!
vic   |2009-04-13 20:02:15
tutorial very easy to follow
Anonymous  - luthimir   |2009-05-04 00:50:09
you have to make sure you name the buttons in AS2 or the command will not
work.

Here's what mine looks like:

stop();

BioButton.onRelease =
function()
{
gotoAndStop("bio");
}
ven   |2009-06-16 09:11:41
i did same thing used actionscript 3 then swore alot. plus converted the symbols
to buttons =/ lots of undo's
Izo   |2009-07-20 15:01:24
Agradeço o tutorial, mas senti muita dificuldade a partir da dica #7!

Vê se me
ajuda aí, estou precisando!

Obrigado!

(será porque uso o as3?)
abp  - HELP   |2009-09-15 20:46:45
Ok this tutorial is really easy to understand thanks!! But I am having one
problem. I put the stop() action in, but my pages just keep playing thru? What
could I be doing wrong? Thanks Again!!
abp  - Nevermind..   |2009-09-15 20:49:01
Nevermind... lol

It worked, it just didn't work in the play mode, but it works
in the preview mode :)
Mandi   |2009-09-15 22:26:47
I'm having the same problem as Amanda did...everything works great, but when I
get to the last page all my links go dead. I can move in and out of pages from
any other page, just not the last one? What am I doing wrong?? Thanks!!
Robert Bulmer  - actionscript errors   |2009-09-25 14:43:51
We have an old version of Flash (i think it is version 4) at our school and I am
trying to teach the students how to build a website. I have followed your
tutorial byt get the following error message:

**Error** Scene=Scene 1,
layer=Menu, frame=1:Line 1: Statement must appear within on/onClipEvent
handler
this.onRelease=function(){

This is the same for all 5
buttons.

Can you please advise.

Thank you

Rob
admin   |2009-09-30 03:20:07
Robert Bulmer

Make sure you place the button code on frame inside the button,
not just on the actions panel on the button itself.

Hard to work out what the
problem is without more info.
Write comment
Name:
Email:
 
Title:

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."



 
Name: Flash Website
Type: Flash
Description: In this tutorial we will show you the basics of creating a flash based website with minimal code.
Finished Preview:

 


Web Design
Web Design Melbourne