Components Flex


    layout="absolute" creationComplete="initApp()">
    
        
        import mx.collections.XMLListCollection;
        [Bindable]
        private var treeData:XML =
        
            
                
                    
                    
                
                
                
            
            
                
                
                
                   
                   
                
            
        
;
        private var openSequence:Array = [1,2,3];
        private function initApp():void {
            var nodeList:XMLListCollection = myTree.dataProvider as XMLListCollection;
            var node:XMLList = nodeList.source;
            for(var i:int=0; i < openSequence.length; i++) {
                var j:int = openSequence[i];
                var n:XML = node[j];
                if( n.children() != null ) {
                    myTree.expandItem(n,true,false);
                    node = n.children();
                } else {
                    break;
                }
            }
            if( n != null ) myTree.selectedItem = n;
        }
      
    

            horizontalCenter="0" dataProvider="{treeData.node}"
        labelField="@label" />