Make changes which i colored
public function showRoot(evt:Event):void {
var myNode:XML = Tree(evt.target).selectedItem as
XML;
/* csv1.selectedIndex = evt.target.instanceIndices;
*/
csv1.selectedIndex = treedata.selectedit...@id;
}
]]>
</mx:Script>
<mx:XMLList id="treeData">
<node label="Mail Box" id="1">
<node label="Inbox" id="2">
<node label="Marketing" id="3" />
............change for the remaining nodes also...........
</mx:XMLList>
Hope it works
Bye.....
On 4/26/09, Srinivasan Sudharsanam <[email protected]> wrote:
>
>
> Hi
>
> When i click a tree, i need to open viewstack.
> Can you please reply asap
>
> <?xml version="1.0"?>
> <!-- itemRenderers\MainTlistThumbnailRenderer.mxml -->
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
> xmlns:comp="component.*" >
> <mx:Script>
> <![CDATA[
> import mx.controls.Tree;
> import mx.controls.Alert;
>
> public function showRoot(evt:Event):void {
> var myNode:XML = Tree(evt.target).selectedItem as
> XML;
> /* csv1.selectedIndex = evt.target.instanceIndices;
> */
>
> csv1.selectedIndex = treedata.selectedit...@label;
>
> }
> ]]>
> </mx:Script>
>
> <mx:XMLList id="treeData">
> <node label="Mail Box">
> <node label="Inbox">
> <node label="Marketing" />
> <node label="Product Management"/>
> <node label="Personal"/>
> </node>
> <node label="Outbox">
> <node label="Professional"/>
> <node label="Personal"/>
> </node>
> <node label="Spam"/>
> <node label="Sent"/>
> </node>
> </mx:XMLList>
>
>
> <mx:VBox width="100%" height="100%">
>
> <mx:HDividedBox width="100%" height="100%"
> backgroundColor="0x00CCC">
> <mx:HBox width="20%" height="100%"
> paddingRight="5"
> backgroundColor="#CCCCCC">
> <mx:Tree labelField="@label"
> showRoot="false" width="100%"
> height="100%" textRollOverColor="0x2B333C"
> textSelectedColor="0x2B333C"
> dataProvider="{treeData}"
> change="showRoot(event)" />
> </mx:HBox>
>
> <mx:HBox width="75%" height="100%"
> backgroundColor="0xFFFFFF">
> <mx:ViewStack id="csv1" width="100%"
> height="100%"
> selectedIndex="0">
> <mx:VBox width="100%"
> height="100%" >
> <comp:GridExamples/>
> </mx:VBox>
>
> <mx:VBox width="100%"
> height="100%">
>
> <comp:textComp />
> </mx:VBox>
>
> </mx:ViewStack>
> </mx:HBox>
>
> </mx:HDividedBox>
>
>
> </mx:VBox>
>
>
> </mx:Application>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---