Flash menu

Posted on 2003-10-26
Last Modified: 2010-04-03
hi i am using flah mx and i8 am wondering if somebody could help me creat the menu  whihc is on
the menu that when you click on the text suddenly therandom shape comes under it and it displays the submenus for each of the links it's hard to explain but the thing that i would like to set up is exacly on the site
thank s
Question by:balbinasuka
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5

Accepted Solution

Calron earned 125 total points
ID: 9625384
Do you mean the different poses of people that show when you move the mouse over the main menu items?

That is quite simple to create. What they did do is put a movieclip with all these poses on the red menu thing. Every frame of that movieclip also includes a stop(); command so that only one pose shows and it doesn't play through.
Then on the mouseover state of the menu buttons all they do is change the frame that is currently showing in the poses movieclip.

the code would look something like this:

  _root.posesClip.gotoAndStop(2);  // this number of course would have to change depending on which button you add this code to.

The submenus again could also be a movieclip with a frame for each submenu. Though here you will have to add the code to the button instance:
on (release) {
  _root.submenuClip.gotoAndStop(2);  // again depending which button, change the frame number.

Author Comment

ID: 9627825
yes i that will help but not only i want to do that i would like to have those text links on top of the movie clip and
than whn i press on link the text will go bold red and then the red thing drags to it it like comes to it like slides toit exacly the same as on the just slidees to it and then stops exacly at the link and then it shows the diffrent sub menues
i don't care about the human figures all i would like is the menu system explained above the best example of that is
also i am wondering if i could set something like
every time you come to the page it shows diffrent picture
let say
one time i go to my page and i see a picture of myself
then i close the browser and i go to the website agian and it show a picture of my sister

Expert Comment

ID: 9628128
A random picture is easy:
make a movieclip with n frames then add this code in the first frame:

gotoAndStop(random(n));   //n being the number of frames

The bold red text is only a mouseover effect which can be solved when setting up the button.

To move the submenu to it's position you will need some actionscript. i'll set something up and get back to you
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.


Expert Comment

ID: 9629391
I made a sample that has such a movement in it. There's still a lot you can do to finetune it, but this is roughly it:

This is a site that will help you with equations to finetune the movement:

Author Comment

ID: 9631265
that great stuff you made but just a question
how to i get diffrent links in diffrent buttons in the same red box
the movement is just what i wanted but the other thing
is that if you press btn1 it sees about me and home those two links
when btn2 pressed it sees e-mail and mice
when btn3 pressed it sees computers and software


Author Comment

ID: 9631285
sorry for asking too much but i need to knwo few more things
can the red box drag with the links when i go through them at first so basically when i mouse over it the menu come under the text link but once i click on one of the links
i does the exacly the same thing as it's doing in your movie so it moves overe once you click not a mause over is the switch that i need to knwo from mouse over to onclick
and if the menu could disappear if i clicke outside

Expert Comment

ID: 9631911
To your first question on showing the different subenus:
What you do is create a movieclip that contains the different submenus and when the menu button is clicked in addition to calling mc_submenu.gotoPosition(...) you also have to add this call: mc_submenu.submenu.gotoAndStop(2);  This of course assumes that the movieclip containing the submenus is placed inside the movieclip with the red bar and has the instance name submenu.

As for the start where the red bar just follows the mouse, this sample show how to detect the mousmovements:

What you do is something really similar where you only take the x coordinate of the mouse and move the red bar toward that x coordinate.

As to changing the the behaviors from one (follow mouse) to move to the menu and stay there until a next menu is clicked. Just use a global variable:

_global.followmouse = true;

The first time a menu button is clicked set this variable to false and have the mouse following code only execute if this variable is true.

Author Comment

ID: 9637525
but i am gettin stuck on the swich can you perhaps give me some more hints

Expert Comment

ID: 9637617
Do you have the code that makes the menu follow the mouse? If so add this somewhere in it to prevent the moving:

if (_global.followmouse) {
  // we want to follow the mouse in here

on each button you have the code:

on (release) {
  // we add this line
  _global.followmouse = false;   // as soon as a menu button is pressed we stop the mouse following

You have to see the variable _global.followmouse as a big flag that tells you whether you are still allowed to follow the mouse or not depending whether it is set to true or false;

Author Comment

ID: 9639002
it gives me an error message
i doesn't work after i added the code to the menu.fla
i don't know why
it just stops and it doesn't even move when i click on it

Expert Comment

ID: 9639883
I can't really help you if that is all the information you give me .....

Post the code, tell me what kind of error message you get, or post your fla and I'll have alook at it.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question