4 Replies Latest reply on Jun 11, 2010 6:36 AM by David_F57

    Flex Panel Content Background Color

    jerry98225 Level 1

      Hello guys. I am trying to set the gradient background color for my panel via skins.

      I try to change my code but nothing seems to change. Not sure what to do. Thanks for any reply.

       

       

      My skin file

       

      /<!-- layer 2: background fill --/>

              <!--- Defines the appearance of the PanelSkin class's background. -->
              <s:Rect id="background" left="1" top="1" right="1" bottom="1">
                  <s:fill>
                      <!--- @private
          Defines the  PanelSkin class'
      s background fill. The default color is 0xFFFFFF. -->
                 
      <s:SolidColor id="backgroundFill" color="red"/>  //Change to red but                
                                                                 
      //nothing happen....
                 
      </s:fill>
              </
      s:Rect>

       


        • 1. Re: Flex Panel Content Background Color
          David_F57 Level 5

          hi,

           

          two things to do to fix this

           

          find the following 2 lines in your update function in the skin and comment them out

           

                      //backgroundFill.color = getStyle("backgroundColor");

                     // backgroundFill.alpha = getStyle("backgroundAlpha");

           

          then replace your background rect--

           

                  <!-- layer 2: background fill -->

                  <!--- Defines the appearance of the PanelSkin class's background. -->

          <s:Rect id="background" left="0" right="0" top="0" bottom="0">

          <s:fill>

          <s:LinearGradient>

          <s:GradientEntry color="0xE5E5E5" />

          <s:GradientEntry color="0xB8B8B8" />

          <s:GradientEntry color="0xE5E5E5" />

          </s:LinearGradient>

           

          </s:fill>

          </s:Rect>

           

                  <!-- layer 3: contents -->

          David.

          • 2. Re: Flex Panel Content Background Color
            jerry98225 Level 1

            nice one. Thank you!

            • 3. Re: Flex Panel Content Background Color
              jerry98225 Level 1

              Would you mind to explain why comment two line would fix this? I couldn't find the answer on my book.."backgroundcolor" is a style??????

              • 4. Re: Flex Panel Content Background Color
                David_F57 Level 5

                hi,

                 

                You could set the style if you wanted but as you are creating a background in a new skin its easier to remove alpha and background color so they don't interfere with your gradient. (call it a quick fix , for me I try to strip custom skins to the absolute minimum requirements more efficient etc...).

                 

                David.

                1 person found this helpful