I have worked it out, finally...

I was declaring my styles within a panel control that constituted one of the views of my app.

Once I moved the styles into the Application tag they work fine with the type selector syntax.

Thanks for you help all the same.

Graham
Blog 

--- In flexcoders@yahoogroups.com, "grahampengelly" <[EMAIL PROTECTED]> wrote:
>
> Firstly, apologies if there was a more or less duplicate post prior to
> this one... I got a bit impatient waiting for the first one to show up
> and assumed it hadn't landed.
>
> I have now just realised that when I try to apply styles to the standard
> components e.g. Button with the syntax I am trying it doesn't work
> either so perhaps the problem doesn't lie with my component and lies
> with the way I am trying to apply the styles.
>
> Shouldn't this work and change all instances of the Button component to
> have red text?
>
> <mx:Style>
> Button
> {
> color:#FF0000;
> }
> </mx:Style>
>
> Thanks again...
>
> Graham
> Blog <http://goingspare.wordpress.com>
> --- In flexcoders@yahoogroups.com, "grahampengelly" graham@ wrote:
> >
> > Hi Tim
> >
> > Thanks for your quick reply... Both of those suggestions work. The
> > problem I have is that it is actually some child components of the
> > AnswerButtonPanel that I want to be able to style. In order to do this
> > with the class name identifier in CSS I would have to hard code the
> > styleName when I create the child controls and then always use that in
> > the stylesheet as I don't explicitly create the children in MXML (they
> > are created by the AnswerButtonPanel) and so can't specify it there.
> >
> > I was hoping, and it appears that you can in the docs, to be able to
> > just set a style for all 'AnswerButton' components (the children of
> the
> > AnswerButtonPanel) and it be picked up.
> >
> > As it stands, neither the AnswerButtonPanel or AnswerButton are
> picking
> > up the style info if I use the format in my original post.
> >
> > Thanks again for your help...
> >
> > Graham
> > Blog <http://goingspare.wordpress.com>
> > --- In flexcoders@yahoogroups.com, "Tim Hoff" TimHoff@ wrote:
> > >
> > > Hi Graham,
> > >
> > > Have you tried this:
> > >
> > > AnswerButtonPanel.setStyle('headingFontColor', '#FF0000');
> > >
> > > Or use a CSS file:
> > >
> > > CSS:
> > >
> > > myStyle {
> > > headingFontColor:#FF0000;
> > > }
> > >
> > > MXML:
> > >
> > > <uiComponents: AnswerButtonPanel styleName="myStyle"/>
> > >
> > > -TH
> > >
> > > --- In flexcoders@yahoogroups.com, "grahampengelly" <graham@>
> > > wrote:
> > > >
> > > > Hi
> > > >
> > > > I have created a custom component that derives from Box. I have
> > > added a
> > > > couple of style decarations within the code for the component. The
> > > > following is an example:
> > > >
> > > > [Style(name="headingFontColor", type="uint", format="Color",
> > > > inherit="no")]
> > > >
> > > > ...and then I access this using getStyle("headingFontColor"),
> > > well, I
> > > > wrap that with a default value function but that is the cut of it.
> > > >
> > > > So it works if I set the style within the component tag in the
> > > MXML like
> > > > this:
> > > >
> > > > <uiComponents: AnswerButtonPanel headingFontColor="0xFF0000" />
> > > >
> > > > but if I try to set it as such:
> > > >
> > > > <mx:Style>
> > > > AnswerButtonPanel
> > > > {
> > > > headingFontColor:#FF0000;
> > > > <!-- I have also tried "#FF0000", 0xFF0000 and "0xFF0000"
> > > here,
> > > > as per some examples that I have found, but none work -->
> > > > }
> > > > </mx:Style>
> > > >
> > > > it doesn't get set. Do I have to do something to get this
> > > functionality?
> > > >
> > > > Thanks for your help in advance.
> > > >
> > > > Graham
> > > >
> > >
> >
>
__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to