XML Menu instance names and on click event

I’ve been trying to add some necessary details to hga77’s XML menu and I’ve run into some interesting problems.

  1. All the dynamically created instances are assigned numbers for names. Problem is, AS won’t let you target an object/instance called “menu.4.arrow” (For example: “_root.menu.4.arrow._visible = false;” You’ve got to use a string and not just a number for the instance name. If I try to change hga77’s code to use something like “item”+i to create names, the menus break. I haven’t been able to figure out why this is so. I could use some help changing the created instance names to a string with number attached.

  2. I’ve been trying to figure out some way to have an arrow appear when I click on a menu item. Right now, it works when you click on a top level menu item that contains no submenu, but if you click on the item “perspective” (which contains a submenu), no arrow appears. and I haven’t figured out how to get the arrow to attach to the submenu items either. Another approach would be to add an arrow inside the attached menu clip and control the visibility of the arrow, but due to problem #1 above, I can’t target the arrow instance.

Thanks for your help - files can be found here:
http://www.tornedgedesign.com/_test/2level_menu.zip