ActionScript 2.0 Components Language Reference |
|
|
|
| Tree component > Tree.getIsOpen() | |||
Flash Player 6 (6.0.79.0).
Flash MX Professional 2004.
treeInstance.getIsOpen(node)
node An XMLNode object.
A Boolean value that indicates whether the tree is open (true) or closed (false).
Method; indicates whether the specified node is open or closed.
|
NOTE |
Display indices change every time nodes open and close. |
The following example adds two nodes to a Tree called my_tr, opens the second node, and then calls getIsOpen() to display the state of the second node.
You must first add an instance of the Tree component to the Stage and name it my_tr; then add the following code to Frame 1.
/**
Requires:
- Tree component on Stage (instance name: my_tr)
*/
var my_tr:mx.controls.Tree;
my_tr.setSize(200, 100);
var trDP_xml:XML = new XML("<node label='1st Local Folders'><node label='Inbox' data='0'/><node label='Outbox' data='1'/></node><node label='2nd Local Folders'><node label='Inbox' data='2'/><node label='Outbox' data='3'/></node>");
my_tr.dataProvider = trDP_xml;
my_tr.setIsOpen(my_tr.getTreeNodeAt(1), true);
var isOpen:Boolean = my_tr.getIsOpen(my_tr.getTreeNodeAt(1));
trace("2nd node is a open: " + isOpen);
|
|
|
|