header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Ramakrishna
Points:0
Posts:0

9/7/2010 2:33:18 AM

Title: Tree


Hi,

I have a tree(like parent nodes, children nodes). I want to insert a new parent node, whenever i insert a new node, the focus is on new node. How to do that?

How to set the focus on inserting a new node?



1
bob_senior
Points: 1300
Posts:0
9/7/2010 9:25:55 AM



to set focus for a particular node of tree component in flex you can use the following code . Use creationComplete event and set the index to be selected.

// 
private function initTree():void {
// expand the root
   XMLTree1.expandItem(myXMLCollection.getItemAt(0), true);
// select the index of the item to show selected  
 XMLTree1.selectedIndex = 2;
}
<mx:Tree id="XMLTree" width="150" height="170" creationComplete="initTree();">


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 1+1 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions