Hi Guys,
You can change styles at run-time by changing the styleName property, or by using setStyle(). Styles can be mxml tags or declared in CSS.
<mx:Style> .myCustomButton1 {overIcon:Embed("overIconImage1.gif");
upIcon:Embed(source="upIconImage1.gif");
downIcon:Embed(source="downIconImage1.gif"); } </mx:Style>
<mx:Style> .myCustomButton2 {overIcon:Embed("overIconImage2.gif");
upIcon:Embed(source="upIconImage2.gif");
downIcon:Embed(source="downIconImage2.gif"); } </mx:Style>
<mx:Button id="myButton" label="Icon Button" styleName="myCustomButton1"/>
Change in AS at run-time:
myButton.styleName = "myCustomButton2";
-TH
--- In flexcoders@yahoogroups.com, "Lance Linder" <[EMAIL PROTECTED]> wrote:
>
> I have been looking into this exact same thing for the last couple of
> days and I haven't found a way to do it yet either. Seems like this
> isn't possible but maybe there is some obscure way of doing it that I
> haven't tried yet?
>
>
>
> ________________________________
>
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of user_abcxyz
> Sent: Monday, July 17, 2006 3:34 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Change graphical skin of a button control at
> runtime?
>
>
>
> Is it possible? I want to allow the user at runtime can change the
> existent graphical skin of a button, however I am not sure if it's
> possible in Flex. Please help and give me some snippet code to
> demonstrate.
>
> Thank you.
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Web site design development | Computer software development | Software design and development |
Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.