Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop Down Menus in Flash

Status
Not open for further replies.

marybailey

Programmer
Mar 14, 2002
47
US
I want to rewrite an html site I have which includes drop down menus when you mouse over menu choices. How do I do this in Flash?

Lets assume (to make it easier I think) that I have two buttons defined that each bring me to a different frame when clicked. I'd like to be able to mouse-over and have a drop down menu appear which has several choices. When I click on the choices I go to a URL. Now I think I know how to do the URL parts. And I've already successfully programmed the buttons without drop downs. Its specifically the drop down parts I dont know how to program.

THANKS!
MRS B
 
you do need 2 keyframes for each button to expand the menu something like this

on (rollOut) {
_root.menuMovie.gotoAndStop(1);
}
on (rollOver) {
_root.menuMovie.gotoAndStop(2);
}
 
Like this:

Regards
David Byng
bd_logo.gif

davidbyng@hotmail.com
 
Thanks for the quick response!
So then for each button I would put that code in. 1 and 2 then represent the frame where the drop downs would be?
 
frame 2 would represent the drop downs...frame 1 the state with the dropdows not visible. remember each button needs its own frame 1 and 2 in this simplistic model.
 
Okay. I have a few questions.

1. Looking at your example (which, btw, is the type of drop down that I am trying to do), I noticed the "+" that is invis_but but it is not something I can see when its run. How do you do it and why?

2. The drop-downs look like they are defined as movies. Is this correct? How are they put together. They look like each of them is one piece of the drop down.

3. How do you keep the drop downs from disappearing when you move the cursor off the button that they drop down from? Everytime I come off I end up losing the drop down.

Any help is greatly appreciated!
Mrs B

 
Okay again.

I looked at the movies, etc. again. I think I know what is going on now. One big question I have is how you get that "+". Otherwise, it looks like these things are defined in movie explorer as opposed to object actions.

Is this true?
 
'invis_but' Known as invisable button, it is a button with only a hit-state its a commonly used Flash principle. You can place invisable buttons over text etc it just makes building movies faster. Regards
David Byng
bd_logo.gif

davidbyng@hotmail.com
 
I've been spending hours looking through FLash and examples and books. I looked at your implementation again last nite in trying to figure this all out.

1. I cannot figure out - I've really racked my brains about this - how you activate the drop down menu. I know its a mouse over but I cant see where in the code it is called. How do you activate the drop down when I mouse over the blue rectangle?

2. I've just started looking into OnClipEvent. How does this fit in to the scheme of things?

Thanks!!!
Jean

 
This is the code that triggers it:

Code:
if (hitTest(_root._xmouse, _root._ymouse)) {
    if (_currentframe != 10) {
        play ();
    }
    _root.slct = this;
    num = 1;
}

hitTest (); basically checks if the cursor is over the top rectangle and if it is then trigger menu Regards
David Byng
bd_logo.gif

davidbyng@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top