Flash 8 Drop Down Menus

In this very basic Flash 8 dropdown menu tutorial I am going to show you how to make a simple dropdown menu using a gotoAndStop command. The basic theory is that on frame 1 you have the top menu button only appearing. Then when you press this button the timeline goes to another frame and that is where the other submenu buttons are put under the top menu level. On this frame if you press the top menu button then you get sent back to frame 1 and the sub menu items disappear. It is very simple and you dont have to deal with making movieclips visible and a whole lot of hocus pocus. But be careful with this one because if you use loadMovie with it then the loaded movies will get loaded over the top of the drop down menu. You will have to think carefully about this. My sneaky little trick would be load the dropdown menu/navigation movie into a really high _level such as _level100.

Create a new Flash 8 doc 700×400.
Create a new layer and call it buttons.
Make 5 buttons 150×30 each and put them under one another.
Give them the instance names of menu1_btn, menu2_btn, etc etc,up to menu5_btn.

Make a new keyframe(F6) on frame 10 of the buttons layer.
The top button will be the main menu button.
The other buttons, 2-5, will be sub-menu items.
Go back to frame 1, buttons layer and delete buttons 2-5.

Create a new layer and call it “actions”.
You will need code to stop the timeline and move the timeline to frame 10 when button 1 is pressed.
Here is the code:

menu1_btn.onRelease = function(){
  gotoAndStop(10); // go to frame 10	

On frame 10 of the actions layer put the code for your submenu button items.
And the code to send the timeline back to 1 when the top button is pressed.
Examples could be:

// send timeline back to frame 1
// and hide submenu items
menu1_btn.onRelease = function(){
// submenu items actions
menu2_btn.onRelease = function(){
	getURL("http://www.video-animation.com/", "_self");
menu3_btn.onRelease = function(){
	getURL("http://www.blah.com/", "_self");
// etc etc

Leave a Reply

Your email address will not be published. Required fields are marked *