I have been working with view stacks, and trying to control them with
a menubar. However I am unable to get it to work together. Does anyone
know how this can ben done.

When i am clicking "Manu1" from menubar i need to show  - homeInfo
(viewstack)

Menu2 - Menu Iteam  2-A  = Program Info

Menu3 - Thread Info

Menu 4 - idead Info

Any help would be greatly appreciated

My Code
------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute">
        <!--<mx:Script>
                <![CDATA[
                        import mx.controls.Alert;

                        private function reply():void
                        {
                                msg.visible = true;
                                post.visible = true;
                                cancel.visible = true;
                        }
                ]]>
        </mx:Script>
<mx:VBox>
        <mx:Label text="Prabu"/>
        <mx:Button label="Reply" click="reply()"/>
        <mx:TextArea width="500"  height="50" id="msg" visible="false"/>
        <mx:HBox ><mx:Button label="post" id="post"
click="{Alert.show(msg.text)}" visible="false"/>
        <mx:Button label="Cancel" id="cancel" visible="false"/> </mx:HBox>
</mx:VBox>-->
<!--<mx:Script>
        <![CDATA[

                [Bindable]
                public var TAP_ARRAY:Array = [{label:"Home"},{label:"Program"},
{label:"Thread"},{label:"Idea"},{label:"lasttap"}];

        ]]>
</mx:Script>

<mx:TabBar color="0x323232">
        <mx:dataProvider>{TAP_ARRAY}</mx:dataProvider>
</mx:TabBar>-->
<mx:Script>
        <![CDATA[
            // Import the Menu control.
            import mx.controls.Menu;

            // Create and display the Menu control.
            private function createAndShow():void {
                var myMenu:Menu = Menu.createMenu(null, myMenuData,
false);
                myMenu.labelField="@label";
                myMenu.show(90, 68);
            }
        ]]>
    </mx:Script>
    <mx:XML format="e4x" id="myMenuData">
        <root>
            <menuitem label="MenuItem A" >
                <menuitem label="SubMenuItem A-1" enabled="false"/>
                <menuitem label="SubMenuItem A-2"/>
            </menuitem>
            <menuitem label="MenuItem B" type="check" toggled="true"/>
            <menuitem label="MenuItem C" type="check" toggled="false"/
>
            <menuitem type="separator"/>
            <menuitem label="MenuItem D" >
                <menuitem label="SubMenuItem D-1" type="radio"
                    groupName="one"/>
                <menuitem label="SubMenuItem D-2" type="radio"
                    groupName="one" toggled="true"/>
                <menuitem label="SubMenuItem D-3" type="radio"
                    groupName="one"/>
            </menuitem>
        </root>
    </mx:XML>
<mx:Panel title="MSC Container" layout="vertical" color="0xffffff"
borderAlpha="0.15" height="100%" width="100%"
         paddingTop="10" paddingRight="10" paddingBottom="10"
paddingLeft="10">

            <mx:HBox borderStyle="solid" width="100%" color="0x323232"
            paddingTop="5" paddingLeft="5" paddingRight="5"
paddingBottom="5">

                    <mx:Button id="homeButton" label="Home"
                        click="myViewStack.selectedChild=homeInfo;"/>
                    <mx:Button id="progamButton" label="Program"
                        click="myViewStack.selectedChild=programInfo;"/>
                    <mx:Button id="threadButton" label="Thread"
                        click="myViewStack.selectedChild=threadInfo;"/>
                    <mx:Button id="ideaButton" label="Idea"
                        click="myViewStack.selectedChild=ideaInfo;"/>
                    <mx:Spacer width="75%"/>
                    <mx:Button id="ideaButton1" label="My Profile"
                        click="myViewStack.selectedChild=ideaInfo;"/>
                    <mx:Button id="ideaButton2" label="Logout"
                        click="myViewStack.selectedChild=ideaInfo;"/>
                </mx:HBox>


        <mx:ViewStack id="myViewStack" borderStyle="solid"
width="100%" height="80%" color="0x323232" borderColor="0xFFF000">

            <mx:HBox id="homeInfo" label="Home"
backgroundColor="0xDCDCDC" width="100%" height="100%"
fontWeight="bold" paddingLeft="25" paddingTop="10" >
                <mx:Accordion width="60%" height="50%">
                        <mx:VBox label="Accordion Button 1">
                                <mx:Label text="Accordion container 1"/>
                        </mx:VBox>
                        <mx:VBox label="Accordion Button 2">
                                <mx:Label text="Accordion container 2"/>
                        </mx:VBox>
                        <mx:VBox label="Accordion Button 3">
                                <mx:Label text="Accordion container 3"/>
                        </mx:VBox>
                        <mx:VBox label="Accordion Button 4">
                                <mx:Label text="Accordion container 4"/>
                        </mx:VBox>
                        <mx:VBox label="Accordion Button 5">
                                <mx:Label text="Accordion container 5"/>
                        </mx:VBox>
                </mx:Accordion>
                <mx:Spacer width="12%"/>
                <mx:Panel width="25%" height="50%" paddingRight="25"
title="Advisor's blog">
                        <mx:VBox>
                                <mx:Label text="New Post"/>
                        </mx:VBox>
                </mx:Panel>

            </mx:HBox>

            <mx:VBox id="programInfo" label="Program"
backgroundColor="0xDCDCDC" width="100%" height="100%"
fontWeight="bold" horizontalAlign="center" >
                <mx:Label text="Program Info" width="100%"
textAlign="center" paddingTop="10" />
            </mx:VBox>

            <mx:VBox id="threadInfo" label="thread Info"
backgroundColor="0xDCDCDC" width="100%" height="100%"
fontWeight="bold" >
                <mx:Label text="Thread Info" width="100%"
textAlign="center" paddingTop="10" />
            </mx:VBox>

            <mx:VBox id="ideaInfo" label="idead Info"
backgroundColor="0xDCDCDC" width="100%" height="100%"
fontWeight="bold" >
                <mx:Label text="idead Info" width="100%"
textAlign="center" paddingTop="10" />
            </mx:VBox>

        </mx:ViewStack>
        <mx:HBox horizontalAlign="center">
                <mx:Button label="FOOTER"/>


        </mx:HBox>
    </mx:Panel>
</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.

Reply via email to