Dynamic Menu creation via a text file

Greetings all. I’m a Flash MX action scripting newbie. I’m trying to create a dynamic drop down menu system that reads a text file to create the items listed in the menu. I’ve been reading tutorials and trying to break down source fla files to understand how things work. I’m stuck on what the following block of code means.

Would it be possible for someone to break down the following code for me? It references menudata.txt to create the drop down menu. I can successfully modify menu.data.txt to create more menus and change the titles in each button, but creating sub-nav is totally kicking me in the arse.

If anything, could someone please tell me what “item_”+x means?

I’ve also attached my source files incase someone is willing to go further and help me build a sub-nav.

Thank you in advance.

The code follows:

item_spacing = 18;
x = 1;
while (x<=_root.menu_count) {

newName = "item_" + x
menu_template.duplicateMovieClip(newName, x);

this["item_"+x].menu_text = _root["menu_text_" + x]
this["item_"+x].menu_link = _root["menu_link_" + x]
this["item_"+x].gotoAndStop(_root["menu_state_" + x])
this["item_"+x]._y = this["item_"+x]._y + (item_spacing * (x-1))



The code has a loop in to loop through for each of the items referenced. This is the while bit. The code needs to refer to each of the parts ie item_1 item_2 etc. By using [“item_”+x] this recreates these in the loop as when it first runs x=1 giving item_1 and then the next time x=2 gives item_2.