import mx.events.ListEvent;
private function tree_itemClick(evt:ListEvent):void {
var item:Object = Tree(evt.currentTarget).selectedItem;
if (mytree.dataDescriptor.isBranch(item)) {
mytree.expandItem(item, !mytree.isItemOpen(item), true);
}
}
itemClick="tree_itemClick(event);" />
1 comment:
Thanks for the snippet; works like a charm! I tweaked it a bit, declaring "mytree" locally within the function.
private function tree_itemClick(evt:ListEvent):void {
var mytree:Tree = Tree(evt.currentTarget);
var item:Object = mytree.selectedItem;
if (mytree.dataDescriptor.isBranch(item)) {
mytree.expandItem(item, !mytree.isItemOpen(item), true);
}
}
Post a Comment