1 Reply Latest reply on Nov 22, 2007 12:05 AM by Giribabums

    How to change application background color dynamically

    Giribabums
      Hi All,

      In my project I am loading mxml components based on User Roles and Rights. For each mxml component i have used different colors and displaying the component in centered screen.

      like
      If the user= Manager [background color = blue ] I am loading manager related component
      If the user= Seller [backgound color = green ] I am loading Seller related component and etc.,

      My main.mxml application is background is different [default color]
      When i load component it should reflect the color [change the background color] in main.mxml application. how can i achieve this
        • 1. Re: How to change application background color dynamically
          Giribabums Level 1
          I got the solution. ;)

          [code]
          private function LoadComponent(licensetype:String):void
          {
          var screen:UIComponent;
          switch (licensetype)
          {
          case "Manager": // Load Manager Component
          screen = new Manager();
          addChild(screen);
          this.setStyle('backgroundColor','#9E9A41');
          break;
          case "Seller": // Load SellerComponent
          screen = new Seller();
          addChild(screen);
          this.setStyle('backgroundColor',"#408080");
          break;
          default:
          // show default screen with information
          break;
          }
          }
          [/code]
          :)