Eric,
Couldn't get your code to work at first. Made some slight modifications to
get it to work in a single frame based code structure.
This code works great for relatively small tree structures. Took around
10-15 seconds to open 1500 nodes. Meanwhile it just sits there without
feedback.
function ExpandNode (myTree, myTreeNode:XMLNode):Void {
// Open passed in node.
myTree.setIsOpen (myTreeNode, true);
// Check to see if current node has children
if (myTreeNode.childNodes.length > 0) {
// If current node has children spawn a new process that will
"recurse" throuhg all child nodes.
// Effectively opening all nodes in tree.
var j:Number;
for (j = 0; j < myTreeNode.childNodes.length; j++) {
var myTreeSubNode:XMLNode = myTreeNode.childNodes[j];
this.ExpandNode (myTree, myTreeSubNode);
}
}
}
// This executes the initial opening...
// First attribute is the instance name of the tree component
// Second attribute is the root node of the tree component
ExpandNode (main.myBM, main.myBM.getTreeNodeAt (0));
Thanks for all the help!
Martin :)
On 10/28/05 12:01 PM, "Martin Schafer" <[EMAIL PROTECTED]> wrote:
> Looks like it would work but I can't seem to figure out how to bind it
> to a Tree Component. How to do you get "this" to refer to the tree
> component instance without having an attribute inside of the ExpandAll
> function?
>
> Thanks for the info!
>
> Martin :)
>
> Éric Thibault wrote:
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders