Hi Steven, If you are using XML, then by all means use Tracey's example. I am building something similar, but I am using objects in an ArrayCollection instead of XML. What I have done is add an "id" and "parent" field to my object. When I am building my ArrayCollection of objects, I make sure to assign the "parent" field to the correct "id" value.
Walking up the tree from a low level is simple. Just recursively (or in a while loop) find the next parent until the parent field is null. Cheers, Dom --- In flexcoders@yahoogroups.com, "Carpenter, Steven" <[EMAIL PROTECTED]> wrote: > > Hi all, > > I'm still learning with Flex, and I'm stuck on this problem: > > I have a Tree component and for any given selectedItem, I need to get a > list of parent nodes for that item - I'm not concerned with the children > of each parent, I just need to get a list or path of parent nodes for an > item, back up to the root node. I got as far as creating a method that > will take the selected item and get its parent node using > Tree.getParentItem(node) and ITreeDataDescriptor.isBranch() but I'm > struggling with building a recursive function that will let me walk back > up the tree. I've seen a great example of walking down a tree's > DataDescriptor using IViewCursor but not I'm stuck on creating something > that works in the other direction. Does anyone have any pointers/advice? > Thanks in advance! >