Thanks, Alex! Your article was very helpful!

Just to document the one hole I fell into - I was trying to set the
text color using the UITextField's textColor property while setting
italics using the TextFormat object returned by
textField.getTextStyles(). This didn't work - I could get color OR I
could get italics, but not both.

The problem was that once I implemented getTextStyles, I had to set
the text color thru the textFormat.color property instead.

All works great now. :-)


--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Check out the examples on my blog
> http://blogs.adobe.com/aharui/2007/03/thinking_about_item_renderers_1.ht
> ml
> 
>  
> 
>  
> 
> ________________________________
> 
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of tsiesser
> Sent: Friday, April 13, 2007 1:49 PM
> To: [email protected]
> Subject: [flexcoders] Italics in datagrid cell
> 
>  
> 
> Hi - I'm trying to display italics in a datagrid cell based on certain
> row criteria. I've created a custom itemRenderer in AS3 that derives
> from UIComponent and that contains a UITextField as a child. (This
> might seem a little over-complex for what I'm describing, but I have
> other use for doing it this way... :-))
> 
> I override commitProperties and do the following:
> 
> override protected function commitProperties():void
> {
> super.commitProperties();
> 
> textField.text = ... // get text value from data (works okay)
> 
> if (data && data is MyClass && MyClass(data).notAvailable)
> {
> textField.textColor = textField.getStyle("disabledColor");
> textField.setStyle("fontStyle", "italic");
> }
> else
> {
> textField.textColor = textField.getStyle("color");
> textField.setStyle("fontStyle", "normal");
> }
> }
> 
> The result is that I *do* get the disabled color when appropriate, but
> I *don't* get the italics.
> 
> Does anyone have any idea what's going on? Thanks in advance for your
> help!
>

Reply via email to