1 Reply Latest reply on Dec 7, 2006 6:34 PM by ntsiii

    global object

    ljonny18 Level 1

      I have an application that has different users types defined by a global variable.

      I have an interface created in Flex 2 - the interface contains a dataGrid with buttons (functionalities) below….

      The buttons displayed are different for each user type – e.g.:

      Admin Users can view, add, delete and modify – so they can see an:
      - view button
      - add button
      - delete button
      - modify button

      Whereas, a general user can only view and add – so they can only see:
      - view button
      - add button


      currently I have this view as 2 separate views (mxml components) where if the user type is an “Adim User” then they are directed to the: adim_homepage.mxml and if the user type is a “Gernaeral User” then they are directed to the general_homepage.mxml etc………..

      what I want to do (as more user type could emerge in the near future) is to have one homepage component (homPage.mxml) and then contain the buttons within something like a global object – so if the user is an “Admin User” then the object containing the admin buttons is displayed and so on etc….. making the application more dynamic….

      Is what I want to do possible within Flex 2 ??? and is my thinking about the way to go about doing it along the correct lines ??? or is there a better method available???

      Could someone offer me some advice on this one?

        • 1. Re: global object
          ntsiii Level 3
          Sure. ViewStack is probably the easiest. Put in HomePage.mxml, with Admin and General as child views, and set the selectedIndex according to the user type. Or, if you want, dynamically instantiate the controls conditionaly using AS.

          There are lots of ways to do this. Also look at states.