tags:

views:

250

answers:

3

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>
A: 

Don't you need to specify a height and width of the rectangle?

www.Flextras.com
I just copy the skin file that Flex generate for me, and I don't think I need to specify it. Thanks though.
Jerry
+2  A: 

Try :

        <s:fill>
        <s:SolidColor color="0xFF0000"/>
    </s:fill>

Edit:

    <s:Rect id="background" left="1" top="1" right="1" bottom="1">
    <s:fill>
        <s:SolidColor id="backgroundFill" color="0xFF0000"/>                
    </s:fill>
</s:Rect>

I have tried the above code. It works well.

michael
thanks for the reply, but not luck....:(
Jerry
Thanks for the editing. Did you really put that code under/<!-- layer 2: background fill --/> tag inside the skin file and work? As far as I know, I could always use "red", "black" as my color. Change the color to 0x won't change anything. :( +1 for helping me twice though
Jerry
I do not put the code under /<!-- layer 2: background fill --/> tag, it seems it is a comment, but there is one more slash in front of the comment symbol. I do not try the "red" word.If they are not typing mistakes in here, I think there many wrong comment indication in your code.
michael
allright...thx for the help...
Jerry
http://forums.adobe.com/message/2887339#2887339 FYI...The correct answer is here...:P
Jerry
A: 

I had the same problem.

The solution is to remove line in overrided updateDisplayList function: backgroundFill.color = getStyle("backgroundColor");

Maybe it could be helpful for other searchers. :)

igu