# Dynamic menu

**URL:** <https://forum.kirupa.com/t/dynamic-menu/9356>\
**Category:** Uncategorized\
**Created:** [December 10, 2002, 7:33am UTC](https://forum.kirupa.com/t/dynamic-menu/9356 "2002-12-10T07:33:09Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![sub0](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@sub0](https://forum.kirupa.com/u/sub0)\
**Post date:** [December 10, 2002, 7:33am UTC](https://forum.kirupa.com/t/dynamic-menu/9356/1 "2002-12-10T07:33:09Z")

</div>

hey guys…still my menu doesn’t work as I would like…  
all I want is to collapse when I click on another menu item, which expands…  
right now when I click everything stay expanded…I want it more dynamic…  
thanks…  
I’ve attached the file for those who want to look at it…

thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 10, 2002, 2:52pm UTC](https://forum.kirupa.com/t/dynamic-menu/9356/2 "2002-12-10T14:52:45Z")

</div>

Can’t open the fla

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 10, 2002, 5:29pm UTC](https://forum.kirupa.com/t/dynamic-menu/9356/3 "2002-12-10T17:29:38Z")

</div>

I just downloaded and it works on my machine…try again…  
thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 10, 2002, 5:45pm UTC](https://forum.kirupa.com/t/dynamic-menu/9356/4 "2002-12-10T17:45:05Z")

</div>

I came right after I´ve see this:

> _Originally said by sub0_  
> \*\*guigO,

thanks for your welcome…I’m still too busy to spend enough time with you guys…but I will…  
anyway could you please have look at the file I posted on the forum. regarding a dynamic menu…  
thanks for your help…

sub0\*\*

* * *

Man, are you a mac user?

Cause when I try to open your fla in flash I get an error message:_unexpected file format_

If you´re not a mac user try posting again with a different file name.

=)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 10, 2002, 6:14pm UTC](https://forum.kirupa.com/t/dynamic-menu/9356/5 "2002-12-10T18:14:03Z")

</div>

hey, I’m a mac user…but it should be ok…  
anyway this is the code:  
MenuArray=new array();  
MenuArray[1]=menu1;  
MenuArray[2]=menu2;  
MenuArray[3]=menu3;  
MenuArray[4]=menu4;  
MenuArray[5]=menu5;  
MenuArray[6]=menu6;

offset=new array();  
offset[1]=menu1.\_height;  
offset[2]=menu2.\_height;  
offset[3]=menu3.\_height;  
offset[4]=menu4.\_height;  
offset[5]=menu5.\_height;  
offset[6]=menu6.\_height;

function up(MenuNum) {  
var MenuOff=offset[MenuNum]-10;  
MenuNum++;  
for(i=MenuNum; i\<=6; i++){  
MenuArray\*.\_y-=MenuOff;  
}  
}  
function down(MenuNum) {  
var MenuOff=offset[MenuNum]-10;  
MenuNum++;  
for(i=MenuNum; i\<=6; i++){  
MenuArray\*.\_y+=MenuOff;  
}  
}

then I have events calling the functions.  
thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 10, 2002, 6:31pm UTC](https://forum.kirupa.com/t/dynamic-menu/9356/6 "2002-12-10T18:31:25Z")

</div>

Man, I´m totally new to arrays. I think you would be better of me in tha case.☹

Perhaps I can learn something from you:)

Cheers=)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 10, 2002, 7:10pm UTC](https://forum.kirupa.com/t/dynamic-menu/9356/7 "2002-12-10T19:10:12Z")

</div>

Still can’t open the file, I get the same error, however looks like you are trying to create a menu similar to the one I did not too long ago you might check out my fla in this post [http://www.kirupaforum.com/showthread.php?s=&threadid=8962](http://www.kirupaforum.com/showthread.php?s=&threadid=8962) see if that will help you any.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 10, 2002, 8:45pm UTC](https://forum.kirupa.com/t/dynamic-menu/9356/8 "2002-12-10T20:45:04Z")

</div>

I can’t open it either…it saves as attachment.php…  
what the hell is going on…  
thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 10, 2002, 10:11pm UTC](https://forum.kirupa.com/t/dynamic-menu/9356/9 "2002-12-10T22:11:48Z")

</div>

see if i can post the file you e-mailed me for people to look at.

You could try to save the currently open menu name to a variable then use that variable to determine which one to close if one is open when another is clicked.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 11, 2002, 8:26am UTC](https://forum.kirupa.com/t/dynamic-menu/9356/10 "2002-12-11T08:26:56Z")

</div>

Oh d00d… The power of arrays are incredible… hehe…

Especcially when creating games… It’s imperative that you know arrays…

As for your problem… I have no clue… I haven’t looked over it… For a dynamic menu though I don’t think you really need arrays… _lol_…

Check this out… And Make it simpler on you…

Step 1 :: Make a frame with the menu unexpanded on it and make that frame a button.

Step 2 :: Make another duplicate frame or a movie clip with your menu expanded out on it.

Step 3 :: Put the proper onClick attachMovie or duplicateMovieclip in that area. Then you can just set it up if a user gets outside that area it unexpands and goes back to the other frame with it unexpanded.

That’s a small set of clues to try and help you out… Hopefully you get the gist of what I’m saying…

Peace Out,  
Marz \<:}

PS :: guig0… If you wanna know a crapload about arrays and how powerful they can actually be… Gimme a shout at [mentalconcepts@hotmail.com](mailto:mentalconcepts@hotmail.com)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 11, 2002, 11:17am UTC](https://forum.kirupa.com/t/dynamic-menu/9356/11 "2002-12-11T11:17:18Z")

</div>

hey thanks for the help…  
I understand what you’re saying and what you’re getting at…  
my point is to create something very dynamic and elastic!!!  
the way you said it works fine…but it’s not what I’m looking for…  
check this out and you’ll understand what I mean…  
[http://www.fourm.com/console/](http://www.fourm.com/console/)

take care, sub0

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 11, 2002, 4:24pm UTC](https://forum.kirupa.com/t/dynamic-menu/9356/12 "2002-12-11T16:24:16Z")

</div>

Allright… I checked it out and gte what you mean… Let’s check out your code now…

[COLOR=green]  
function up(MenuNum) {  
var MenuOff=offset[MenuNum]-10;  
MenuNum++;  
for(i=MenuNum; i\<=6; i++){  
MenuArray\*.\_y-=MenuOff;  
}  
}  
[/COLOR]  
What I see here looks legit… Cept… When you look at your other code…

function up(MenuNum) {  
[COLOR=green]var MenuOff=offset[MenuNum]-10;[/COLOR]  
MenuNum++;  
for(i=MenuNum; i\<=6; i++){  
MenuArray\*.\_y-=MenuOff;  
}  
}  
function down(MenuNum) {  
[COLOR=green]var MenuOff=offset[MenuNum]-10;[/COLOR]  
MenuNum++;  
for(i=MenuNum; i\<=6; i++){  
MenuArray\*.\_y+=MenuOff;  
}  
}

Allright… Don’t know if this is correct or not… But I think you might wanna change the top one to +10? Not sure actually… Looks legit from what I can see though…

I’d probably have the view the whole file file… But I don’t have MX…

Peace Out,  
Marz \<:}
