|
There should be an example in the
docs.
- use Loader; load in the bitmap
- cast the loader.content to Class
- pass that in as:
my_btn.setStyle("upSkin",
loadedContent);
----- Original Message -----
From: Lance
Linder
Sent: Monday, July 17, 2006 7:07 PM
Subject: RE: [flexcoders] Re: Change graphical skin of a button
control at runtime? Nice example. Only
thing is that you have to embed all resources even if they arent used. Also
adding resources would required a recompile. So far I have gotten to
the point that I can load in a CSS file at run time and change styles but I
havent figured out a way to load in even a JPG at runtime and use as a new skin
without embedding it in the application. Lance From:
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
-- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com YAHOO! GROUPS LINKS
|
- Re: [flexcoders] Re: Change graphical skin of a button contro... JesterXL

