Use Menu Bar to Control ViewStacks

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default Use Menu Bar to Control ViewStacks

    Does anyone know of an example of how I can use a menu bar to control a viewstack. I am at a lost right now trying to figure this out.
    rottmanja Guest

  2. Similar Questions and Discussions

    1. Menu control with Subcateogies
      Hi, My ASP.NET web application has a menu on the left side of the page which would show a list of all the categories. It is done using a web...
    2. Menu Control - Recommendations
      We are looking at developing a web application, that we wish to be menu driven (would like to have a drop down menu bar). Also the menu needs to be...
    3. menu items in control
      Hi, I want to have a simple menu in my custom server control, which I've developed in VB ton
    4. OS Control xtra ( menu)
      HELP !!!!!!!!!!!!!!!!!! My work just purchased the OS Control Xtra for me to create a menu with submenus for a project that I am working on in...
    5. OS Control Xtra (menu)
      My work just purchased the OS Control Xtra for me to create a menu with submenus for a project that I am working on in Director MX. I believe I...
  3. #2

    Default Re: Use Menu Bar to Control ViewStacks

    Here ya go:
    Tracy


    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
    <mx:Script><![CDATA[
    function menuHandler(oEvent:Object) {
    vs1.selectedIndex = oEvent.menuItem.getProperty("data");
    }
    ]]></mx:Script>
    <mx:MenuBar width="450" change="menuHandler(event)">
    <mx:dataProvider>
    <mx:XML>
    <menuitem label="View">
    <menuitem label="Not used" type="check" data="2A"/>
    <menuitem type="separator" />
    <menuitem label="Available Views" >
    <menuitem label="View 1" type="radio" groupName="one"
    data="0"/>
    <menuitem label="View 2" type="radio" groupName="one"
    data="1"/>
    <menuitem label="View 3" type="radio" groupName="one"
    data="2" />
    </menuitem>
    </menuitem>
    </mx:XML>
    </mx:dataProvider>
    </mx:MenuBar>
    <mx:ViewStack id="vs1" width="100%" height="100%" borderStyle="solid">
    <mx:VBox label="View 1" width="100%" height="100%"
    backgroundColor="#CCFF00" >
    <mx:Label text="This is View 1"/>
    </mx:VBox>
    <mx:VBox label="View 2" width="100%" height="100%" >
    <mx:Label text="This is View 2"/>
    </mx:VBox>
    <mx:VBox label="View 3" width="100%" height="100%"
    backgroundColor="#FF3399">
    <mx:Label text="This is View 3"/>
    </mx:VBox>
    </mx:ViewStack>
    </mx:Application>

    ntsiii Guest

  4. #3

    Default Re: Use Menu Bar to Control ViewStacks

    This doesn't work any more by Flash Builder 4 or Flex4. The problem is the root!
    hanya Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139