This content has been marked as final. Show 3 replies
I think you need scrollToIndex
AH HAAAA... That's what I was looking for... But NOW the question is... How do I get the [int] that goes inside scrollToIndex(int). I tried myTree.selectedIndex... BUT I'm not clicking on a tree node.. In fact, I'm clicking on the ARROW beside the tree note to expand its children.
You will need to use the getChildIndex( item ) method.
Once you get the index then you can scrollToIndex method.
I also believe you might need to execute a myTree.validateNow() method after the scrollToIndex is done.
Not sure if this is really needed but if you see strange results after the scroll then try the validateNow.
Almost every Flex object that is based on a list and generates scroll bars has the getChildIndex and scrollToIndex.
If you were to put the tree or a tileList in a VBox and relied on the VBox scrollbars then you would not have this ability to scroll to view. It is more work.