override updateDisplayList It should look something like this: override protected function updateDisplayList(w:Number, h:Number):void { if (owner.isItemSelected(data)) setStyle("color", getStyle("textSelectedColor")); if (owner.isItemHighlighted(data)) setStyle("color", getStyle("textRollOverColor")); super.updateDisplayList(w, h) }
________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of lhy90936 Sent: Friday, August 31, 2007 9:08 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Changing text color of item renderer in datagrid Hi Alex, Can you explain how can I subclass the TextInput to implement the textRolloverColor & textSelectedColor? Does it mean that I need to implements the ListBase class since it has these 2 styles declaration? Thank you very much for your help. Regards, hy --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "Alex Harui" <[EMAIL PROTECTED]> wrote: > > That's right, you have to subclass TextInput to implement those color > styles. > > > > ________________________________ > > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> ] On > Behalf Of lhy90936 > Sent: Thursday, August 30, 2007 7:10 PM > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > Subject: [flexcoders] Re: Changing text color of item renderer in > datagrid > > > > Hi, > > I've tried the textRollOverColor but that did not work. > My itemrenderer still doesn't change colors when rollover. > > Regards, > hy > > --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders% 40yahoogroups.com> > , "lhy90936" <lhy90936@> wrote: > > > > Hi Alex, > > > > Thank you. > > > > What about the selection: textSelectedColor? > > > > When I checked the Reference for TextInput class, I could not find > > anything about this textRollOverColor, or selection color.... > > Can I know where can we find all this info? > > > > Thank you > > > > hy > > > > --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > <mailto:flexcoders%40yahoogroups.com> , "Alex Harui" <aharui@> wrote: > > > > > > textRollOverColor > > > > > > > > > > > > ________________________________ > > > > > > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > <mailto:flexcoders%40yahoogroups.com> > > [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > <mailto:flexcoders%40yahoogroups.com> ] On > > > Behalf Of lhy90936 > > > Sent: Thursday, August 30, 2007 9:20 AM > > > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders% 40yahoogroups.com> > > > > Subject: [flexcoders] Changing text color of item renderer in > > datagrid > > > > > > > > > > > > Hi, > > > > > > I have the following datagrid: > > > <mx:DataGridColumn field="name" ......... /> > > > <mx:DataGridColumn itemRenderer="myRenderer" ...... /> > > > > > > In myRenderer, I extend from the TextInput class; with the text > > > color:WHITE > > > > > > My question is: > > > When I do a mouse rollover/selection on any row of the datagrid, > > how > > > can I change the text color of my renderer? > > > If I add the rollover/selection event listener for my renderer, > it > > > will only change the color when my mouse is over its column. > > > However, I want it to change colour whenever the datagrid row is > > > selected/ rollover. > > > > > > Thank you very much. > > > > > > Regards, > > > hy > > > > > >