is it possible to expand all nodes in flex tree using timer?
private function openAllNodes(event:TimerEvent):void {
//Alert.show(event.target.currentCount);
var index:int =event.target.currentCount - 1;
myTree.openItems = treeData..node[index] ;
}开发者_如何学运维
public function start_timer():void
{
timer.start();
}
private function closeAllNodes():void {
myTree.openItems = [];
}
public var timer:Timer = new Timer(1000,19);
public function init():void
{
timer.addEventListener(TimerEvent.TIMER, openAllNodes);
}
In my project I want to show the video like growing flex tree. So I tried flex timer based to expand node one by one. But if I open the first node then automatically close second time. If there is any other way to expand nodes one by one then let me know.
If you could post your dataProvider it will be easier to determine the best approach for your problem. Of the top of my head I think you could use the method expandItem() and pass in the the item using for example (@id==index).
精彩评论