ActionScript 2.0 Components Language Reference |
|
|
|
| Tree component > Tree.setIsOpen() | |||
Flash Player 6 (6.0.79.0).
Flash MX Professional 2004.
treeInstance.setIsOpen(node,open[,animate[,fireEvent]])
node An XML node.
open A Boolean value that opens a node (true) or closes it (false).
animate A Boolean value that determines whether the opening transition is animated (true) or not (false). This parameter is optional.
fireEvent A Boolean value that determines whether the nodeOpen and nodeClose events are dispatched (true) or not (false) when the tree node is opened or closed. This parameter is optional. The default value is false.
Nothing.
Method; opens or closes a node.
The following example creates two nodes in a Tree instance called my_tr and calls the setIsOpen() method to open the second node.
/**
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;
// Set 2nd node open.
my_tr.setIsOpen(my_tr.getTreeNodeAt(1), true);
|
|
|
|