Or look at the examples on my blog (blogs.adobe.com/aharui)

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Mark
Sent: Tuesday, April 03, 2007 7:23 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: need a little help with itemRenderer



Thank you, this is working much better than what I had :)

-Mark

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Tim Hoff" <[EMAIL PROTECTED]> wrote:
>
> 
> Hi Mark,
> 
> Try something like this: (make sure that your itemRenderer is a
> container that supports the backgroundColor style property. You 
can
> change the text color this way as well, using "color".
> 
> override public function set data(value:Object):void
> {
> super.data = value;
> 
> if( value != null )
> {
> if ( value.myProperty == "myCondition" )
> {
> this.setStyle("backgroundColor","red");
> }
> else
> {
> this.setStyle("backgroundColor","#FFFFFF");
> }
> 
> super.invalidateDisplayList();
> }
> }
> 
> -TH
> __________________________________
> 
> Tim Hoff
> Cynergy Systems, Inc.
> http://www.cynergysystems.com <http://www.cynergysystems.com> 
> Office <http://www.cynergysystems.comoffice/
<http://www.cynergysystems.comoffice/> > : 866-CYNERGY
> 
> --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> , "Mark" <pusateri02@> wrote:
> >
> > 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
<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