XML Parsers, Recursion problem


I am loading an xml and looping through it using a recursive function. The problem is that it only reads through the first tree and then quits…??


<root id="0">
<dir id="1" name="Lounge,_Chillout">
<dir id="2" name="Opera_Chillout_2003">
<dir id="3" name="CD1">
<dir id="4" name="CD2">
<dir id="5" name="Roger_Sanchez_-_First_Contact">
<dir id="6" name="Royksopp_-_Melody_a.m">
<dir id="7" name="Secret_Garden_-_Songs_from_a_Secret_Garden">
<dir id="8" name="Soundtracks">
<dir id="9" name="Army_Of_Darkness">
<dir id="10" name="Soundtrack_-_Reservoir_Dogs" /> 


loadXml = function (filename) {
summaryXml = new XML();
summaryXml.ignoreWhite = true;
summaryXml.onLoad = function(success) {
if (success) {
getDirs = function(xml, id)
currentNodes = xml.childNodes;
for (var i=0; i< currentNodes.length; i++) {
if (currentNodes*.attributes.id == id) {
	trace("bingo @ " + currentNodes*.attributes.name);
	} else {
	if (currentNodes*.hasChildNodes()) {
	 trace("search goes on @ id: " + currentNodes*.attributes.name);
	 getDirs(currentNodes*, id)
	 trace("no more childs");

the result is:

search goes on @ id: undefined
search goes on @ id: Lounge,_Chillout
search goes on @ id: Opera_Chillout_2003
search goes on @ id: CD1
search goes on @ id: undefined
no more childs

I found a similar problem in another thread. i tried the solution from that thread but it didn’t solve my problem…

Does anyone have an idea?

Anyone?? i’m going :krazy: :krazy: :krazy:

your AS is giving errors…i’m trying to test it all. upload a zip with the .xml and .fla

i don’t have time to zip it all… there are some classes and an xml and a .fla file… the problem is located in the function i posted.