# Calling Childnodes from XML driven drop down menu

**URL:** <https://forum.kirupa.com/t/calling-childnodes-from-xml-driven-drop-down-menu/262746>\
**Category:** flash\
**Created:** [June 9, 2008, 4:53pm UTC](https://forum.kirupa.com/t/calling-childnodes-from-xml-driven-drop-down-menu/262746 "2008-06-09T16:53:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivank](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@ivank](https://forum.kirupa.com/u/ivank)\
**Post date:** [June 9, 2008, 4:53pm UTC](https://forum.kirupa.com/t/calling-childnodes-from-xml-driven-drop-down-menu/262746/1 "2008-06-09T16:53:22Z")

</div>

Hello everyone,

I would just like to say that this online community here is probably the most helpful one i’ve ever encountered. Thanks for all the help!

Anyhow, heres my problem. I am trying to use Kirupa’s XML drop down menu(action script 2.0): aka: [http://www.kirupa.com/developer/actionscript/xml\_dropdown\_menu.htm](http://www.kirupa.com/developer/actionscript/xml_dropdown_menu.htm), however I cannot have it output the childNode. This is because it is using a for loop with the curr\_item variable. when I try to trace the for loop count variable, it just returns the last for loop variable. I basically want it so that when I click on a button on the 3rd tier submenu, I want it to output all the prior tiers that the button belongs in. Can anyone help me with that? thanks in advance

\_Ivan

---

<div class="post-metadata">

**Author:** ![ivank](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@ivank](https://forum.kirupa.com/u/ivank)\
**Post date:** [June 10, 2008, 12:55am UTC](https://forum.kirupa.com/t/calling-childnodes-from-xml-driven-drop-down-menu/262746/2 "2008-06-10T00:55:23Z")

</div>

I really can’t figure this out, so the loops using childNodes.length as the # of loops, however I can’t return the loop#. For example if the childNodes.length is 3, when I try to access the current items counter, it will return 3 because it will complete the for loop before returning any values. Is there anyway to detect on which loop the menu item belongs to and return it? I tried to use if statements, but it will always return the final loop value. Thanks in advance

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [June 10, 2008, 8:37am UTC](https://forum.kirupa.com/t/calling-childnodes-from-xml-driven-drop-down-menu/262746/3 "2008-06-10T08:37:05Z")

</div>

search the forums, plus look at the code more:P
