Its a bit hackish, but you could try something like this:
function openTree(t:mx.controls.Tree):Number { var i:Number=0; var node:mx.controls.treeclasses.TreeNode=t.getTreeNodeAt(i); while (node != undefined){ if (t.getIsBranch(node) && ! t.getIsOpen(node)){ t.setIsOpen(node,true); } i++; node=t.getNodeDisplayedAt(i); } return i; }
This will open all the nodes, and return the total number of nodes throughout the tree. You'd have to work it a bit more to do this and not open them all.
At 01:23 PM 2/24/2005, you wrote:
I’m using the PrintDemo.mxml example to do the same thing for a Tree, but the TreeDataProvider does not have a length property.
I think I can write a recursive function that finds the last Child…last child, then getDisplayIndex.
But first, am I missing any property/method on Tree or TreeDataProvider that will give me a total row count?
Tracy
Yahoo! Groups Sponsor ADVERTISEMENT <http://us.ard.yahoo.com/SIG=129hlpapj/M=298184.6018725.7038619.3001176/D=groups/S=1705007207:HM/EXP=1109354828/A=2593423/R=0/SIG=11el9gslf/*http://www.netflix.com/Default?mqso=60190075> click here
----------
Yahoo! Groups Links
* To visit your group on the web, go to:
* <http://groups.yahoo.com/group/flexcoders/>http://groups.yahoo.com/group/flexcoders/
*
* To unsubscribe from this group, send an email to:
* <mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED]
*
* Your use of Yahoo! Groups is subject to the <http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
<<inline: f8bf0d0.jpg>>