Hi,

check the two solutions which ever you feel is best you can use that [ 
expanding and collapsing treeview]. 

<mx:LinkButton toolTip="Expand All" id="LBTreeExpand" x="0" y="0" 
icon="@Embed(source='../../images/arrow-down.gif')" height="18" paddingLeft="0" 
      paddingRight="0" paddingTop="0" paddingBottom="0" click="ExpandTree();"/>

 private function ExpandTree():void
      {
       
       if(LBTreeExpand.toolTip.toString() == "Expand All")
       {
        LBTreeExpand.setStyle("icon", CollapseIcon);
        LBTreeExpand.toolTip = "Collapse All";
        for(var i:int=0; i<TreeData.length.valueOf(); i++)
        {
         listTree.expandChildrenOf(TreeData.getItemAt(i), true);
        }
       }
       else if(LBTreeExpand.toolTip.toString() == "Collapse All")
       {
        LBTreeExpand.setStyle("icon", ExpandIcon);
        LBTreeExpand.toolTip = "Expand All";
        for(var i:int=0; i<TreeData.length.valueOf(); i++)
        {
         listTree.expandChildrenOf(TreeData.getItemAt(i), false);
        }
       }
      }
----------------------------
simple approach
private function ExpandTree():void
      {
       myTree.expandChildrenOf(treeData.getItemAt(0), true);
      }
      
      private function CollapseTree():void
      {
       myTree.expandChildrenOf(treeData.getItemAt(0), false);
      } 

Regards
Girish


      Forgot the famous last words? Access your message archive online at 
http://in.messenger.yahoo.com/webmessengerpromo.php

Reply via email to