Definitely look at what Amy is offering.  I am pretty sure I myself have
never written the "best code ever written", but I have solved a lot of
problems anyway!

 

My suggestion would be a component that takes a node and uses the xml
children to build its child list. Each child gets a ref to its node, and
then uses it to build its children, etc.  I am personally a big fan of
mx:Repeater for this kind of stuff.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Amy
Sent: Thursday, August 07, 2008 2:40 PM
To: [email protected]
Subject: [flexcoders] Re: XML Document and Navigation

 

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Patrick J. Jankun" <[EMAIL PROTECTED]> wrote:
>
> Hello Everyone,
> 
> I run into a problem, something that probably a lot of people here 
> knows how to solve.
> But after sitting for 2 days building nestes for loops, i can't 
see 
> the light by the end of the tunnel :-)
> 
> So, here is a problem:
> 
> I have to build an xml based navigation, so far, quite simple and 
> clear. Made it already a few times,
> but, now, this is a bit more complicated, because i got a much 
deeper 
> nested sub levels, and i really
> don't know how to efficient traverse the document and build the 
> navigation out of it :|
> 
> The most complex navigation i made had 2 levels, so it wasn't 
really 
> hard to imagine the code for this task:
> 2 for loops done the nav creation and that's it, but i got now, an 
> "undefined" deep, and i don't know how to
> bite the code that will build the nav, that goes a bit deeper then 
one- 
> sub level.
> 
> Do you guys got any examples or thoughts on how to solve the task?
> Im pretty sure that i got an logical error in my approach, since i 
> will use some nested for loops, but i can't
> think the "formula" since i don't know how deep each of the nodes 
> goes, and this task gives me headaches.
> 
> any kind of help and pinpointing to right direction would be VERY 
> appreciated

You might want to look at Eli Greenfield's RandomWalk 
http://www.quietlyscheming.com/blog/components/randomwalk-component/
<http://www.quietlyscheming.com/blog/components/randomwalk-component/> 

If that doesn't do what you want, post back. I have some code I 
don't feel comfortable posting publically but that I could share off 
list. It's not the best code ever written, but it does work.

HTH;

Amy

 

Reply via email to