Hi everybody,
I try to build a recursive function that searches an xml node for a
particular attribute name.
Each Node of my xml document has an attribute called "transition".
So basically what I want to do is pass an xml node to my function and
the name of the transition and in return I want to get the path to the
transition (which should be an array).
So for example if my xml node looks like this:
<node transition="mainTransition">
<node transition="subTransition"/>
</n>
And I'm looking for "subTransition", the function should
Return me an Array which looks like this:
"mainTransition,subTransition"
I managed to get it working to populate the array correctly.
However I can't figure out how to do the recursive call and "delay"
the return statement until all branches of my xml node have been looped
through.
Is there a standard approach how to set up recursive functions which return
values?
Any help is appreciated.
Robin
function returnPath(myXmlNode:XMLNode,toCheck:String):Array
{
var returnArray;
// here I would have my recursive call
//
return returnArray;
}
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders