I need to change the background color of some items in the 
HorizontalList.  I thought the easiest way would be to create an 
itemRenderer such as below.  But I can't change the color this way.  
Does anyone know what the problem is here?  The setColor function 
will have much more to it once I get the setStyle to work.

Thanks

## In the Application##
<mx:HorizontalList id="hl" width="100%" height="50" 
dataProvider="{hListArray}" columnWidth="125" showScrollTips="true" 
scrollTipFunction="myScrollFunction" selectable="false" 
itemRenderer="com.radar.HListRenderer" />

## ItemRenderer ##
<?xml version="1.0" encoding="utf-8"?>
<mx:TextArea xmlns:mx="http://www.adobe.com/2006/mxml"; 
creationComplete="setColor()">
        <mx:Script>
                <![CDATA[
                        public var newColor:Number;
                        public function setColor():void {
                                trace("changing");
                                this.setStyle("Color", 0xFF0000);
                        }
                ]]>
        </mx:Script>
</mx:TextArea>

Reply via email to