Latest tutorial: Making a Movieclip face another Movieclip or point on the stage | Ask Tutorial5!
 

Get tutorials on EMail




Flash tabs menu

(68 votes)
Written by AnaS   

flashtabsmenulogo_50x50.jpgIn this tutorial it will be shown step by step how can be developed an awesome flash menu with tabs. We will use MovieClips, masks, invisible buttons and some ActionScript.

Following the steps of this tutorial you would obtain the below Flash tabs menu:



1. Create a new Adobe Flash document having dimensions 500x150. Choose Modify >> Document (Ctrl+J) or go to the Properties panel and change Frame rate to 50 fps.

2. Create 5 new layers. Rename layers from top to bottom: actions, button5, button4, button3, button2, button1.

flashtabsmenu1.gif

3. Now go to the first frame of button1 layer. Save the image below on your disk. Select File >> Import >> Import to Stage (Ctrl+R) and select the image below.

tabimage.jpg

4. Select the image you just inserted. Go to Properties panel and be sure that it has W: 89, and H: 56. Now go to Modify >> Convert to Symbol (F8) to convert the image in a MovieClip. In the window that appears choose MovieClip as type and choose center for Registration point. Give it also a name of button1MC.

flashtabsmenu2.gif

5. Select the MovieClip you just created, go in the Properties panel and give it an instance name on button1_mc. Set also X: 20, Y: 40. Now double-click it or right-click and choose Edit in Place to start edit it.

6. We are now in Edit mode for button1MC (see picture below). Insert two new layers. Rename the bottom layer tab, the middle one name it mask and the top layer text.

scene1.gif

7. In the text layer create a text field using the Text Tool (T) and write Home. In the Properties panel set the following properties: Text Type: Static Text, font:Verdana, size 15, bold. Align the text to the center of the MovieClip. Go to the frame 50 of the text layer and press F5 to insert frames from 1 to 50.

flashtabsmenutext1.gifflashtabsmenutext2.gif

8. In the tab layer select the first frame (make a click on it) and go to the Properties panel. Choose Tween: Motion.

9. Go to frame 50 >> right-click and choose Insert Keyframe (F6). Now select the tab Bitmap here, go to the Properties panel and set Y: -40.

flashtabsmenu3.gif

10. Now go to the first frame of the mask layer. Using the Rectangle Tool (R) draw a rectangle with no stroke. Select the rectangle and in the Properties panel set W: 89, H: 56. Set also x:-44.5, Y: -40.

11. Now go to the frame 50 of the mask layer >> right-click and choose Insert Frame (F5).

12. Good job! Now go to mask layer >> right click and choose Mask ( see next picture).

flashtabsmenu4.gif

13. Choose Scene 1 to go back to the main movie. Now create a invisible button with dimensions W: 89, H: 44. Name the symbol invb. Go to the Properties panel and give it an instance name of invb1_btn. Also set x: 20 and Y: 40. For found out how to create an invisible button go to the tutorial Creating an invisible button in Flash.

scene2.gif

14. Select the invisible button and open the Actions panel (F9). Put this ActionScript code in:

on (rollOver) {
_root.over_button1 = true;
_root.button1_mc.nextFrame();
}
on (rollOut) {
_root.over_button1 = elsevalue;
_root.button1_mc.prevFrame();
}

15. Great! Now go to the first frame of the actions layer and open the Actions panel (F9). Put the next ActionScript code in:

_root.button1_mc.onEnterFrame = function() {
if (over_button1) {
_root.button1_mc.nextFrame();
} else {
_root.button1_mc.prevFrame();
}
};

16. Good job! We have now our first tab. Go to the Library (Window >> Library or Ctrl+L), click the button1MC and then right-click and choose Duplicate. In Duplicate Symbol window that appear chage name to button2MC and then OK.

17. Go to the first frame of the button2 layer. Drag button2MC on the stage. Go to the Properties panel and give it instance name of button2_mc, set x: 109, Y:40. Double click the button2_mc or right-click >> Edit in Place to edit it. Go to the first frame of the text layer and change the text to About us. Click Scene 1 to go back to the main movie.

18. Drag also from the Library an instance of invb. Go to the Properties panel and gve it ans instance name of invb2_btn. Also set x: 109, Y:40.

19. While invb2_btn is selected open the Actions panel (F9) and put the following ActionScript code:

on (rollOver) {
_root.over_button2 = true;
_root.button2_mc.nextFrame();
}
on (rollOut) {
_root.over_button2 = elsevalue;
_root.button2_mc.prevFrame();
}

20. Now go in the first frame of the actions layer and add the next ActionScript code:


_root.button2_mc.onEnterFrame = function() {
if (over_button2) {
_root.button2_mc.nextFrame();
} else {
_root.button2_mc.prevFrame();
}
};

21. Great! now repeat steps 16 to 20 to create three new tabs like in my example. Of course give them different names and instance names and make sure you use the proper names in the ActionScript code too. Also for all tabs and invisible buttons set Y:40 and X: 89+the X of the one from the left.

22. Your stage should look like image below. Now we will add a rectagle to complete the menu. Using the Rectangle Tool (R) draw a rectangle with no Stroke and Fill color #00CCFF. In the Properties panel set W: 445, H: 10, X: 20, Y: 84.

flashtabsmenu5.gif

23. Now test the movie and enjoy your Flash rounded tabs menu. I hope this tutorial improved your Flash knowledge.

You need to Register in order to download the FLA file.



Subscribe now via RSS feed and get all the new tutorials

written by Eric Kim , November 03, 2007

i need some help here, after i typed in the code i get this error when testing my menu
"1087: Syntax error: extra characters found after end of program."

i put the correct action script code in, but got that error. Any help?
written by Bobby Faruqi , November 06, 2007

Here i my version in AS3. Works well with 3 lines.
Also note here that I have no invb button.
This is the script for 1 button.


button1mc.addEventListener(MouseEvent.MOUSE_OVER ,bobbymoveit);
function bobbymoveit(e:MouseEvent):void{
mybtn.play();
}

written by Dx , January 18, 2008

I have a flash for my we page, this flash not make i. This flash have two menu, then i put this flash en .net (xml). Then a need select each one options the menu for open other windows.

My problem is that don´t known access a each option the menu of flash from to .Net
written by aryotalk , February 21, 2008

Good Tutorial
and for hidden menu i give getURL, so this menu have two function :)

on (rollOver) {
_root.over_button2 = true;
_root.button2_mc.nextFrame();
}
on (rollOut) {
_root.over_button2 = elsevalue;
_root.button2_mc.prevFrame();
}

on (press) {
getURL("http://www.tutorial5.com/", "_blank");
}

thanks guys
written by oyun , March 04, 2008

thanks
written by Tony jacob , March 20, 2008

how do i actually create an invisible button on a movie clip text?
written by puffin_d_herb , March 20, 2008

this seems to work fine when the size of my image is 89 by 56 how ever when i try to use a smaller image but use the same coordinates for movment i do not get the same effect?

i have even tried moving the mask about but this does not achieve the effect either, can anyone help?
written by puffin_d_herb , March 20, 2008

tony i would say come out of the movie clip and create the button within the scene, place it over the text and resize it to fit around the text?
written by Oyun , April 09, 2008

thank u
written by humam , June 23, 2008

i have a problem in draging
when am draging a movie clip it not interact with the bottom movie clip
so mouseover is not working (since the mouse button is already clicked)
how can i make the drag(while holding the mouse button clicked) interactive with the bottom layer
written by OYUN , August 21, 2008

thanks alot
written by oyunlar , August 21, 2008

her sey güzel olacak
written by oyun oyna , August 21, 2008

thanks
written by north cyprus holidays , October 04, 2008

The writings , explanations and pictures are so usuful that i will keep in my mind and they are really interesting so thank you because of your hard work of your web page.I enjoyed too much and i will wait for next new writings of you.
written by en güzel oyunlar , October 23, 2008

This article clear things up for me. Thanks for showing us the truth about this case. I have been wondering about such things back then. Thank you for posting the artic
written by oyunlar , October 23, 2008

thanks alot
written by oyun , October 26, 2008

Thanks so much.
written by chuck , November 12, 2008

Hi

I have the following script working fine:

on(rollOver){
cube.nextFrame();
}

I would like to have something like this but I dont know how to do it:

on(mouseOver){
cube.nextFrame();
}

BTW: I dont want to use any EnterFrame and _xmouse stuff for this.

Can it be done?
written by kei , November 19, 2008

This is really a great tutorial, thank you very much!
written by Martin Cheung , November 22, 2008

i have problem they shown"current selection cant have action applied to it " when i press F9 for adding code
how can i solve it
written by Kei , December 03, 2008

hello Martin,

I think I had the same problem before.
I am not sure about the reason, but it is solved if you use Actionscript 2.0 (you can select when you start a new file)

Hope this can help.
written by sava? oyunlar? , December 20, 2008

? have followed your writing for a long time.really you have given very successful information.
In spite of my english trouale,I am trying to read and understand your writing.
And ? am following frequently.I hope that you will be with us together with much more scharings.
I hope that your success will go on.
written by radyo çhat , December 25, 2008

The writings , explanations and pictures are so usuful that i will keep in my mind and they are really interesting so thank you because of your hard work of your web page.I enjoyed too much and i will wait for next new writings of you.
written by North Cyprus Holiday , December 26, 2008

I like very much the writings and pictures and explanations in your adress so I look forward to see your next writings. I congratulate you.
written by North Cyprus Holiday , January 10, 2009

I read your article.The things you have written sound very sincere and nice topics i am looking forward to its continuation.
written by 3d Oyunlar , January 26, 2009

THANK YOU
written by Sava? Oyunlar? , January 26, 2009

te?ekkürler
written by Oyunlar 1 , January 26, 2009

oyun sitesi ekledim
written by Maç Oyunlar? , January 26, 2009

thank you admin
written by Brain Cancer , January 30, 2009

The informations are so lovely and so usefull so thank you very much. Be sure i will use all of them keeping in my mind.Have a goog luck.
written by Oyun , February 03, 2009

Go to the Properties panel and gve it ans instance name of invb2_btn. Also set x: 109, Y:40
written by ee , April 05, 2009

great tut, but how can we use this template in dreamweaver 8?
written by gazeteler , April 21, 2009

THANK YOU
written by radyo dinle , April 21, 2009

The informations are so lovely and so usefull so thank you very much. Be sure i will use all of them keeping in my mind.Have a goog luck.
written by zeka , April 24, 2009


great tut, but how can we use this template in dreamweaver 8?
written by siki? , April 29, 2009

thanks for the great article.
written by casus telefon , June 01, 2009

casus cep telefonu
written by yap boz oyunlar? , June 06, 2009

yapboz oyunu ekledim te?ekkürler
written by exchange rates , February 07, 2010

nice information.thanks.

Do you need more help? Ask now!
 

busy
Last Updated ( Friday, 28 March 2008 )