2 Replies Latest reply on Sep 17, 2007 3:18 PM by Sparkerman1711

    open folders in tree componet

    Sparkerman1711
      How can I set my tree component so the when flash loads, all my folders are open by default? I understand how to make the first child folders to open but It is the nested folders within that I can't figure out how to open. Below is a part of my code. It will open 2 folders. What is the code to open the folders that are nested inside?

      var xml:XML = new XML();
      xml.ignoreWhite = true;
      xml.onLoad = function() {
      theTree.dataProvider = xml;
      theTree.setIsOpen(theTree.getTreeNodeAt(0), true);
      theTree.setIsOpen(theTree.getTreeNodeAt(1), true);
      };
      xml.load("tree.xml");
        • 1. Re: open folders in tree componet
          RossRitchey Level 4
          usually, you can concatenate tree nodes on here

          theTree.setIsOpen(theTree.getTreeNodeAt(0).getTreeNodeAt(0),true);

          That should open a folder that is the first child of the first folder.

          For example

          :::::::::::::::::::::::::::

          var xml:XML = new XML("<node label='1st Local Folders'><node label='nested Folder'><node label='Inbox' data='0'/><node label='Outbox' data='1'/></node></node><node label='2nd Local Folders'><node label='Inbox' data='2'/><node label='Outbox' data='3'/></node>");

          theTree.dataProvider = xml;
          theTree.setIsOpen(theTree.getTreeNodeAt(0), true);
          theTree.setIsOpen(theTree.getTreeNodeAt(1), true);
          theTree.setIsOpen(theTree.getTreeNodeAt(0).getTreeNodeAt(0), true);
          • 2. Re: open folders in tree componet
            Sparkerman1711 Level 1
            Problem solved!

            Thanks!