Thanks Alex

Maybe I'm misunderstanding. I would not how to get to the top level
objects, but what about the sub-level objects? Say I dont know how
many levels the collection is nested?

Let's say this is my function:

private function expandTree(event:CollectionEvent):void {
                if(event.kind == CollectionEventKind.REFRESH) {
                        var parentItems:XMLList = 
sessionsByDateTree.dataProvider.children();
                
                        doExpand(parentItems);
                        
                        function doExpand(items:XMLList):void {
                                var len:int = items.length();
                                
                        // loop through collection backwards
                                for (var i:int = len-1; i >= 0; i--) {
                                        var childList:XMLList = 
items[i].children();
                                 
                                 //sessionsByDateTree.expandChildrenOf(*what 
object am i
passing in?*, true);
                                                        
                            //if this node has children, let's recurse!
                            if (childList.length() > 0) {
                                doExpand(childList);
                            }
                                }
                        }
                }


as you can see, my recursor is completely ignorant of what level it is
currently in. Will I need to track that?

Reply via email to