2 Replies Latest reply on Mar 10, 2008 9:02 AM by jaimz22

    Tree, select leaf

    shuyg
      I use a xml-file in a Tree-component. The xml-files has nodes, and each node has some properties (type, id, label). I can use the code below to read the selected item in the tree.

      var xmlStr:String = myTree.selectedItem.toString();
      var xmlDoc:XMLDocument = new XMLDocument(xmlStr);
      var decoder:SimpleXMLDecoder = new SimpleXMLDecoder(true);
      var resultObj:Object = decoder.decodeXML(xmlDoc);
      id = resultObj.node.id;

      This works unless I am selecting an item at the end of the tree (the leaf). Then the object is empty.