You should use bindable variable so different components can share
this data.

Something like you have on adobe site


<?xml version="1.0" encoding="utf-8"?>
<!-- Tree control example. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>

    <mx:Script>
        <![CDATA[

            [Bindable]
            public var selectedNode:XML;

            // Event handler for the Tree control change event.
            public function treeChanged(event:Event):void {
                selectedNode=Tree(event.target).selectedItem as XML;
            }
        ]]>
    </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:Panel title="Tree Control Example" height="75%" width="75%"
        paddingTop="10" paddingLeft="10" paddingRight="10"
paddingBottom="10">

        <mx:Label width="100%" color="blue"
            text="Select a node in the Tree control."/>

        <mx:HDividedBox width="100%" height="100%">
            <mx:Tree id="myTree" width="50%" height="100%"
labelField="@label"
                showRoot="false" dataProvider="{treeData}"
change="treeChanged(event)"/>

This part you should change with you viewStack component

            <mx:TextArea height="100%" width="50%"
                text="Selected Item: {selectedno...@label}"/>
                </mx:HDividedBox>

    </mx:Panel>
</mx:Application>



On 30 ruj, 11:51, prajnith K <[email protected]> wrote:
> yeah i used selecteditemindex and viewstack tooo but how to get link between
> these too... and in viewstack i declared 1 panel.
> Prajnith
>
>
>
> On Wed, Sep 30, 2009 at 2:19 PM, Varun Bajaj <[email protected]> wrote:
> > On click of a tree item get the selectedItemIndex of tree, and according to
> > selected index put a viewstack index.
>
> > On Wed, Sep 30, 2009 at 12:51 PM, prajnith K <[email protected]> wrote:
>
> >> Hey all,
>
> >> I place a HDividedBox in my application and  VdivideBox, I place tree in
> >> first vBox, now i want that when any one click in any tree item, relevant
> >> page
> >> or content display in another vBox, how to do that?
>
> >> Prajnith- Sakrij citirani tekst -
>
> - Prikaži citirani tekst -

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to