I have been working at this for a few hours now. I have seen examples for
several list controls other than just mx:List.
I thought this example was the most promising to accomplish what I am trying to
do.
<mx:itemRenderer>
<mx:Component>
<mx:HBox paddingLeft="2">
<mx:Script>
<![CDATA[
override public function set data( value:Object ) :
void {
super.data = value;
var today:Number = (new Date()).time;
var pubDate:Number = Date.parse(data.date);
if( pubDate > today )
setStyle("backgroundColor",0xff99ff);
else setStyle("backgroundColor",0xffffff);
}
]]>
</mx:Script>
<mx:Image source="{data.image}" width="50" height="50"
scaleContent="true" />
<mx:Text width="100%" text="{data.title}" />
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
But this example is from a dataGrid and the var value has no value when using
this method in
a mx:List control.
All I want to do is change the bacground color of the mx:HBox dependent on
another value from
data.
Any ideas?