I can change the Label color but cant change the background color, its anying. 
Can anybody suggest a solution.

<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"; 
                                xmlns:s="library://ns.adobe.com/flex/spark" 
                                xmlns:mx="library://ns.adobe.com/flex/mx" 
                                autoDrawBackground="true">
        
        <fx:Script>
                <![CDATA[
                        
                        override public function set data(value:Object):void
                        {
                                trace(value);
                                
                                if (value == "Option 7")
                                {
                                        
labelDisplay.setStyle("color","#FFFFFF");
                                        //bgRect.left = 10;
                                }
                                else
                                {
                                        
labelDisplay.setStyle("color","#000000");
                                        //bgRect.left = 0;
                                }
                        }
                        
                ]]>
        </fx:Script>
        
        <s:states>
                <s:State name="normal" />
                <s:State name="hovered" />
                <s:State name="selected" />
        </s:states>
        
        <s:Rect id="bgRect"
                        includeIn="normal,hovered,selected"
                        left="0" right="0" top="0" bottom="0">
                <s:fill>
                        <s:SolidColor
                                color = "#8080FF"
                                color.selected="#404080"
                                color.hovered="#5050A0"/>
                </s:fill>
        </s:Rect>

        <s:Label id="labelDisplay"
                         color="black"
                         color.hovered="red"
                         color.selected="white"
                         left="3" right="3" top="4" bottom="3"/>
        
</s:ItemRenderer>

Reply via email to