6 Replies Latest reply on Jan 7, 2009 10:01 AM by ntsiii

    Unable to show menu within panels

    celestethecat
      I am just learing flex....I used the simple menu tutorial: http://livedocs.adobe.com/flex/3/html/help.html?content=menucontrols_5.html which works fine on its own but once I try to use this within panels using an icon menu does not show? I am trying to add the icon on the panel top area....this does not work only when it is within the panel. Any help welcomed.

      Thanks,
        • 1. Re: Unable to show menu within panels
          matthew horn Level 3
          Please post a code example of what you've tried that doesn't work.

          matt horn
          flex docs
          • 2. Re: Unable to show menu within panels
            celestethecat Level 1
            I have added code to original message...

            Thanks
            • 3. Re: Unable to show menu within panels
              celestethecat Level 1
              I have added code to original message...

              Thanks
              • 4. Re: Unable to show menu within panels
                matthew horn Level 3
                Can you simplify this example to a single icon or something similar? As written, is has about a dozen images that I don't have and would have to create before trying it.

                m
                • 5. Re: Unable to show menu within panels
                  celestethecat Level 1
                  I think the issue is I want to add button to the top panel area....with my css I am able to add icons here...when I remove everything css images etc and just use button it does not show up ...sorry I am new at this and do not see a z-index.

                  <?xml version="1.0"?>
                  <!-- menus/SimpleMenuControl.mxml -->
                  <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" >

                  <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(10, 10);
                  }
                  ]]>
                  </mx:Script>

                  <!-- Define the menu data. -->
                  <mx:XML format="e4x" id="myMenuData">
                  <root>
                  <menuitem label="MenuItem A" >
                  <menuitem label="SubMenuItem A-1" enabled="fFalse"/>
                  <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 width="820" height="184" layout="absolute" title="Quick Trade" horizontalScrollPolicy="off" verticalScrollPolicy="off" horizontalAlign="left" verticalAlign="top">
                  <mx:Button id="myButton"
                  label="Open Menu"
                  click="createAndShow();" x="701" y="-28"/>
                  </mx:Panel>



                  </mx:Application>
                  • 6. Re: Unable to show menu within panels
                    ntsiii Level 3
                    You can work with the DisplayList to control overlapping.

                    I would simply declare the menu in mxml tags AFTER the Panel, with visibility=false. Then I would have the button set visible=true.

                    Tracy