06-04-2007, 08:39 PM
|
#1
|
|
Registered User
Join Date: Jun 2007
Posts: 1
|
Drop Down Menu Question
I am relatively new to flash work and I am trying to set up a drop down menu. I have it set up now so that when you roll over a button, it skips to the frame in the movie that contains the animation for the menu that drops down, rather than building the whole menu into a single instance or button.
The problem with doing this, I've discovered, is that when you roll out, the menu does not go away until you roll over another option on the menu, meaning that the drop down stays open unless you open a new one.
I tried creating a transparent shape over the top of the whole menu with a command to return to the first frame of the movie on roll out, but now the problem becomes that you cannot click on any of the buttons because there is a shape over those objects. If I put the transparent shape behind the menu, then whenever you roll onto one of the menu options, the movie resets because you are rolling out on the transparent shape.
Is there a way that I can set up the menu so that when you roll out, the menu closes without having to open a new one without making the menus invididual instances and/or buttons? Please let me know if I am being unclear or if I need to provide more info as I'm new to posting on these forums.
Thanks in advance for the assistance!
-J
|
|
|
06-05-2007, 12:29 AM
|
#2
|
|
Banned by AS.org Staff
Join Date: Jan 2007
Location: Montréal, Québec
Posts: 14,073
|
Try this...
|
|
|
10-18-2007, 04:50 PM
|
#3
|
|
inosmniac
Join Date: Oct 2007
Posts: 6
|
I have similar problem, can you advice?
Hi, I post my code, I did alone. There is a MC named bar0 on the Scene and this same bar (button) is linked in Library as bar.
My wish was to:
- attach multiple bar's from Library to the one on the Scene,
- slide all of them down from the main bar, when it's clicked,
- rollover on some menuitem on the Scene, which can't cause close() function to be launched
//----- CODE
odstep=0;
ilosc=5;
speed=3;
var napisy = new Array('menu','element 1','element 2','element 3','element 4','element 5');
function open() {
for (i=1;i<=ilosc;i++) {
this.attachMovie('bar','bar'+i,i);
this['bar'+i]._y=bar0._y;
this['bar'+i]._x=bar0._x;
this['bar'+i].endY = bar0._y + i*(bar0._height+odstep);
this['bar'+i].onEnterFrame = function() {
this._y += (this.endY-this._y)/_root.speed;
}
this['bar'+i].createTextField("napis", getNextHighestDepth(), 3, 2, 80, 20);
this['bar'+i].napis.html = true;
this['bar'+i].napis.selectable = false;
this['bar'+i].napis.htmlText="<FONT FACE='Verdana' SIZE='11' COLOR='#000000'>"+napisy[i]+"</FONT>";
}
}
function close() {
for (i=1;i<=ilosc;i++) {
this['bar'+i].onEnterFrame = function() {
this._alpha -=10;
}
this['bar'+i].napis._visible=false;
}
}
//-------------------
function buttonStates(n) {
this[n].state = 0;
this[n].onPress = function() {
this.state = !this.state;
};
this[n].onRelease = function() {
if (this.state) {
open();
} else {
close();
}
};
}
this.buttonStates(_root.bar0._name);
As you can see above, all works fine but one thing. The negation this.state[n]=!this.state[n] causes, that when I launch open() at the program start, I can click item in menu (the hand shows up), but when I click main menu, and the want to rollover subitem in that menu, the hand is gone, even when I test it, launching open() twice, to check if something was wrong.
So at the end, something is wrong witch switch on/off function, especially with the negation, but what?
I used Flash 8 Professional, below is an attachement with the application. Be free to use it, like you want.
Maybe, you will find simpliest way of implement on/off and select functions.
I'm exhausted with my tiny little problem. Maybe you have an idea how to overcome or reroute this?
|
|
|
10-18-2007, 04:53 PM
|
#4
|
|
inosmniac
Join Date: Oct 2007
Posts: 6
|
Working example of my...
... and some example, I' ve created in F8 Professional.
|
|
|
10-20-2007, 05:38 PM
|
#5
|
|
inosmniac
Join Date: Oct 2007
Posts: 6
|
Could you post here the attachement with your Flah animation? I'll try to solve it in 24h. C'ya.
|
|
|
10-22-2007, 11:24 AM
|
#6
|
|
Senior Member
Join Date: Dec 2006
Posts: 152
|
Jackwrench, try this Open Source menu, rollOut event works properly
|
|
|
10-29-2007, 07:50 PM
|
#7
|
|
Registered User
Join Date: Oct 2007
Posts: 7
|
sub menu
Quote:
Originally Posted by atomic
Try this...
|
how do i make a submenu with this drop down menu??
|
|
|
10-29-2007, 08:41 PM
|
#8
|
|
Banned by AS.org Staff
Join Date: Jan 2007
Location: Montréal, Québec
Posts: 14,073
|
You mean a submenu of one of the items in the drop menu?
|
|
|
10-29-2007, 10:24 PM
|
#9
|
|
Registered User
Join Date: Oct 2007
Posts: 7
|
ya.
how do i do that?
Last edited by sam2; 10-29-2007 at 10:28 PM.
|
|
|
11-19-2007, 03:29 PM
|
#10
|
|
shreadmeister
Join Date: Jun 2002
Location: Sonoran Desert
Posts: 491
|
Alexus,
I can't seem to get that flash menu from flashmenulabs you mentioned to work. I downloaded the whole zip, open up the .fla in Flash, try to preview movie and a blank screen comes up. I have all the components but I 2 errors
**Error** Scene=Scene 1, layer=actions, frame=1:Error opening include file frame1st.as: File not found.
**Error** Symbol=menu_item_prototype, layer=Layer 1, frame=1:Line 1: The class or interface 'CMenuItem' could not be loaded.
Total ActionScript Errors: 2 Reported Errors: 2
Both the CMenuItem and frame1st.as files are in the same folder. Any thoughts? Also, is there a version of that .fla that does not call out to external as files?
thanks,
Skee
|
|
|
| Thread Tools |
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 06:49 AM.
///
|
|