Solved

Flash menu

Posted on 2003-10-26
13
161 Views
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
http://www.p-diddy.com/pd/
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 http://www.p-diddy.com/pd/
thank s
0
Comment
Question by:balbinasuka
  • 6
  • 5
13 Comments
 
LVL 5

Accepted Solution

by:
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.
}
0
 

Author Comment

by:balbinasuka
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 http://www.p-diddy.com/pd/. 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 http://www.p-diddy.com/pd/
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
0
 
LVL 5

Expert Comment

by:Calron
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
stop();

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
0
 
LVL 5

Expert Comment

by:Calron
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:

www.lauchenauer.info/menu.fla


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

http://www.robertpenner.com/easing/
0
 

Author Comment

by:balbinasuka
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
meaning
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
thanks

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:balbinasuka
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
thanks
0
 
LVL 5

Expert Comment

by:Calron
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:
http://www.flashkit.com/movies/Animations/Other/Compass_-Navy-2111/index.php

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.
0
 

Author Comment

by:balbinasuka
ID: 9637525
thanks
but i am gettin stuck on the swich can you perhaps give me some more hints
thankss
0
 
LVL 5

Expert Comment

by:Calron
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
  mc_submenu.gotoPosition(n);
}

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;
0
 

Author Comment

by:balbinasuka
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
0
 
LVL 5

Expert Comment

by:Calron
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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
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.

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now