I see.  I wonder if you could do something like this:

var children:Array  = formItem.getChildren();
for each(child:DisplayObject in children)
{
   if(child is Label)
   {
      child.setStyle...
   }
}

Just a thought... but, there is likely some easier way.

Scott

Scott Melby
Founder, Fast Lane Software LLC
http://www.fastlanesw.com



diehlryan wrote:

I'm not trying to set it on a Label per se, I'm trying to set the
style on the label that gets generated in a FormItem.

<mx:FormItem id=... label="User Id:" >

I've tried setting the fontWeight style on the FormItem itself, but
that will style the control as well as the label.

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>, Scott - FastLane <[EMAIL PROTECTED]> wrote:
>
> If you only want to set it for one label, can't you just set it on the
> label declaration i.e. <mx:Label fontWeight="bold" text="Your Label
Text"/>
>
> hth
> Scott
>
> Scott Melby
> Founder, Fast Lane Software LLC
> http://www.fastlanesw.com <http://www.fastlanesw.com>
>
>
>
> diehlryan wrote:
> >
> > I can style a FormItemLabel to be bold using a global style, but I
> > can't figure out how to style a Form on a single component only and
> > not affect the other forms throughout the application. I can get it
> > working via ActionScript and using the StyleManager, but again, this
> > affects all instances of FormItemLabel throughout the application:
> >
> >
StyleManager.getStyleDeclaration("FormItemLabel").setStyle("fontWeight",
> > "bold");
> >
> > It does work if I do the previous line on init, and then reset it when
> > the user leaves the form, but it feels kinda hacky, and there is a
> > noticeable delay while the styles are regenerated at runtime. Does
> > anyone know of a nice way to do this? I suppose I could subclass
> > FormItem or FormItemLabel, but that seems like overkill just to set a
> > style. Thanks.
> >
> >
>

Reply via email to