Dynamic menu in Flash 5

I need something similar to the flyout hierarchal menus you’ve seen with javascript, only in flash 5. Plus, they have to be dynamic.

I have several main navigation buttons, and when you roll over them, a rectangular shaped submenu will fly out. I need that submenu to be populated from a text file. So, not only will the contents of the submenu change based on the text file contents, but the size of the submenu box will change based on how many submenu items there are. I hope I am explaining this clearly. If not, let me know.

I know how to load data from a text file and drop it into a button, but I can’t figure out how to generate the number of buttons I need, and place them in an ordered way, based on the total number of submenus, which will change.

This might be better off being a javascript/PHP thing, but the client really wants me to try flash.

Any ideas?

Thanks, Dan

You could have an XML document with the links in. Read the XML file in and add elements to an array.

<LINKS>
<LINK NAME=“Main” FROM=“Top” />
<LINK NAME=“Links” FROM=“Top” />
<LINK NAME=“Contact” FROM=“Top” />
<LINK NAME=“Link 1” FROM=“Links” />
<LINK NAME=“Link 2” FROM=“Links” />
</LINKS>

so you want to go through the array in a for loop and duplicate your link button/mc when from==“top” this gives you your main menu…
then on(rollOver) you want to call another function which duplicates the link button/mc where the from=the button name

Its a similar system to what i have running at http://www34.brinkster.com/blademonkey except mine is a 3 tier menu and the sub menus are activated on(release) not on(rollOver)

Hopefully this gives you an idea, else other peeps can bounce their ideas around.

Im away till monday, so if you still havent got a clear answer off anyone, then im happy to code you an example on monday.

Email me at jamie.briens@nats.co.uk

Regards,

Dravos