Tree.getisbranch() - MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference

Components language reference
Table of Contents

Advertisement

Tree.getIsBranch()

Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
treeInstance.getIsBranch(node)
Parameters
An XMLNode object.
node
Returns
A Boolean value that indicates whether the node is a branch (
Description
Method; indicates whether the specified node has a folder icon and expander arrow (and is
therefore a branch). This is set automatically when children are added to the node. You only
need to call
Tree.setIsBranch()
Example
The following example creates two nodes in a tree and calls
whether the second one is a branch.
You must first add an instance of the Tree component to the Stage and name it
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;
var isBranch:Boolean = my_tr.getIsBranch(my_tr.getTreeNodeAt(1));
trace("2nd node is a branch: " + isBranch);
to create empty folders.
) or not (
true
false
to determine
isBranch()
my_tr
Tree.getIsBranch()
).
; then
1293

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents