4 Replies Latest reply on Aug 12, 2009 12:10 PM by toddcoulson

    Horizontal Menu right aligned

    toddcoulson Level 1

      I have seen this link:

      http://dougmccune.com/blog/2007/01/25/vertical-menubar-component/

      To allow for vertical menus, but how can we get a menu to align on the right side? My menu always fills the entire space, so calling right="10" does nothing, because the Menu fills the space anyway. I want the menu to be right aligned and fill the length of the menu. Does that make sense? Should I add onto what Doug has to build a menu that is horizontal and right?

       

      TIA

        • 1. Re: Horizontal Menu right aligned
          Gregory Lafrance Level 6

          Actually, I cannot visualize what problem you are facing. Perhaps you can describe it again.

          • 2. Re: Horizontal Menu right aligned
            toddcoulson Level 1

            The menuBar component starts from the left in a container and fills in each item one by one from left to right. I want it to fill in items from left to right, but filling the space of the container from the right to the left. I looked at the MenuBar in design view and it fills the entire container, so when I add the property right="10" it doesn't place the menu items 10 pixels from the right side of the container, but instead stays left aligned.

             

            <mx:ApplicationControlBar id="toolbar" width="100%" top="0" >
                 <mx:SWFLoader source="@Embed(skinClass='garmin_logo')" width="148" height="41"/>
                 <menu:MainMenu id="mainMenu" right="10" />
            </mx:ApplicationControlBar>
            
            • 3. Re: Horizontal Menu right aligned
              Kenny Yates Level 2

              Todd,

               

              If I am understanding your dilema here, you want the menu to align right while the SWFLoader is left??

              Or perhaps the everything in your Application Control Bar to align right.

               

              I usually don't recommend using "right=10" or such.

               

              Try wrapping your menu in a HBox this gives you the ability to use the horizontalAlign property to manipulate your menu's layout location.

               

              <mx:ApplicationControlBar id="toolbar" width="100%">
                   <mx:SWFLoader source="@Embed(skinClass='garmin_logo')" width="148" height="41"/>

                   <mx:HBox width="100%" horizontalAlign="right">

                        <menu:MainMenu id="mainMenu"/>

                   <mx:HBox/>

              </mx:ApplicationControlBar>

               

              HTH,

              Kenny Yates

              • 4. Re: Horizontal Menu right aligned
                toddcoulson Level 1

                That fixed the problem, thanks

                 

                Also, frankly, I have had more success with right, left, top, bottom than I have with horizontalAlign in the past. But that is just me.