1 Reply Latest reply on Sep 15, 2008 3:34 AM by SujitG

    Linkbar and Viewstack

    josh_aries Level 1
      Hi All,
      I have this piece of code between my <mx:Application> tags.

      Based on some conditions I want the user to have access to menu2 ( the second page on the linkbar)

      How do I do it. If I do enable= false the item is disabled but the user can still access the page when they click on it.



      <mx:LinkBar verticalGap="0" color="#FFFFFF" width="100%" selectionColor="#FFFFFF" backgroundColor="#000000" fontSize="11" horizontalGap="30" id="Menu" dataProvider="{vs}"></mx:LinkBar>
      <Comp:login label="Login" width="100%" height="100%" id="loginMenu" />
      <mx:ViewStack change="saveIndex();" verticalGap="0" id="vs" width="100%" height="100%">
      <Comp:menu1 label="menu 1" id="menuOne" width="100%" height="100%" />
      <Comp:menu2 label="menu2" id="menuTwo" width="100%" height="100%" />
      </mx:ViewStack>


        • 1. Re: Linkbar and Viewstack
          SujitG Level 2
          Hi,

          Please try using Link Buttons instead of LinkBar and set the selectedIndex or the selectedChild of the ViewStack based on the condition
          or invoke a script on the show and creationComplete event of the menu1 and menu2 and change the selectedIndex or the selectedChild property of the ViewStack based on the conditions.

          Hope this helps.