One option you could do is set the style inside your custom component. That way wherever it’s used afterwards that style will apply.

Alternatively you *can* do the following as well …and should work:

 

<mx:Application

xmlns:mx="http://www.adobe.com/2006/mxml"

xmlns:custom="*"

layout="absolute">

<mx:Style>

MyButton { font-size: 30; }

</mx:Style>

<custom:MyButton />

</mx:Application>

 

Cheers,

Stace

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Kevin Newman
Sent: Wednesday, September 27, 2006 2:08 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex 2.0 unkown issue

 

It sounds like you are looking for a CSS Selector that will not apply to
every Button instance, but only vanilla ones. Is there a selector that
does that?

Alternatively, can you make your own custom Button Element (MyButton),
by extending (inheriting from) the base Button class, then apply the CSS
rule to your own custom Button?

I'm actually very interested in the answers to these questions, since I
haven't had the time to play much with Flex 2.0 yet :-)

Example of what I'm saying:
<mx:Style>
MyButton {
icon:Embed(source="icon.png");
}
</mx:Style>
<mx:MyButton />

or is something like this possible to set up?

<mx:Style>
MyNS|Button {
icon:Embed(source="icon.png");
}
</mx:Style>
<MyNS:Button />

Thanks,

Kevin N.

Igor Costa wrote:
> Hi Guys
>
>
> I was trying to apply some CSS on application at my development cycle
> and discovered a new unknown issue for Flex 2.0
>
> Here we go.
>
> When I create a new Style tag at the root of my Application.mxml here
> we have
>
> <mx:Style>
> .MyCostumButton {
> icon:Embed(source="icon.png");
> }
> </mx:Style>
>
> So applying directly to my button by attribute
> styleName="MyCostumButton" does properly works.
>
> <mx:Button styleName="MyCostumButton" label="Costum icon by CSS"/>
>
> But in when we try to apply directly to a Button tag in CSS tag style
> doesn't really work perfectly due to If I add a new component like
> RichTextEditor every single button or any one who also has an costum
> Button wrote by Actionscript our even MXML will appear the Icon in
> each of them.
>
> Here we have, take a try
>
> <mx:Style>
> Button {
> icon:Embed(source="icon.png");
> </mx:Style>
>
> <!-- Now add whatever component you want that has some nativly events
> like DateChooser, RichTextEditor, colorChooser, comboBox. ... -->
>
> <mx:RichTextEditor>
> </mx:RichTextEditor>
> <mx:Button/>
> <mx:DateChooser>
> </mx:Datechooser>
>
>
> So, please Adobe Flex team fix this dude.
>
>
> Regards
>
>
> --
> ----------------------------
> Igor Costa
> www.igorcosta.com <http://www.igorcosta.com>
>

AVIS IMPORTANT

WARNING

Ce message électronique et ses pièces jointes peuvent contenir des renseignements confidentiels, exclusifs ou légalement privilégiés destinés au seul usage du destinataire visé. L’expéditeur original ne renonce à aucun privilège ou à aucun autre droit si le présent message a été transmis involontairement ou s’il est retransmis sans son autorisation. Si vous n’êtes pas le destinataire visé du présent message ou si vous l’avez reçu par erreur, veuillez cesser immédiatement de le lire et le supprimer, ainsi que toutes ses pièces jointes, de votre système. La lecture, la distribution, la copie ou tout autre usage du présent message ou de ses pièces jointes par des personnes autres que le destinataire visé ne sont pas autorisés et pourraient être illégaux. Si vous avez reçu ce courrier électronique par erreur, veuillez en aviser l’expéditeur.

This electronic message and its attachments may contain confidential, proprietary or legally privileged information, which is solely for the use of the intended recipient. No privilege or other rights are waived by any unintended transmission or unauthorized retransmission of this message. If you are not the intended recipient of this message, or if you have received it in error, you should immediately stop reading this message and delete it and all attachments from your system. The reading, distribution, copying or other use of this message or its attachments by unintended recipients is unauthorized and may be unlawful. If you have received this e-mail in error, please notify the sender.

__._,_.___

--
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

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to