« Missed 360, how about FlexManiacs | Main | FlexInABox.com »
Flex 2.0.1 Style Swapping
| By Rich Tretola | January 19, 2007 | Print This Post
|
| 158 views |
One of the cool new features of Flex 2.0.1 is the ability to compile your style sheets to swf and then do real time style changes of your application. This sample creates 2 style sheet swfs and then uses the StyleManager to swap them. Full source is available.
Click here to run the application
Rich









January 21st, 2007 at 4:07 pm
[...] found a great example by Rich Tretola on how to switch styles at runtime in Flex 2.0.1. I think I might try to put [...]
January 21st, 2007 at 6:05 pm
[...] on Rich Tretola’s example mentioned in my last post, I created a Theme Swapper app using the Flex 2.0.1 runtime CSS feature. [...]
January 21st, 2007 at 6:37 pm
Glad the sample helped, your styles are excellent.
Rich
February 9th, 2007 at 12:48 am
Hai,
Its find Great
But I am getting Follwoing Error
—–
Error: Unable to load style(SWF is not a loadable module):
at MethodInfo-636()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at ::ModuleInfoProxy/::moduleEventHandler()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at ::ModuleInfo/initHandler()
Murugan
February 9th, 2007 at 12:55 am
Hai
I Have tried the vith the Source proivide also i am getting the following error
Error: Unable to load style(Error #2124: Loaded file is an unknown type. URL: file://D/NewStyleDec/bin/style2.css): style2.css.
at MethodInfo-636()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at ::ModuleInfoProxy/::moduleEventHandler()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at ::ModuleInfo/errorHandler()
I can found the Css files are existing in Bin folder
can u expalin me what might be the Pblm
Thanks
Murugan
March 27th, 2007 at 3:26 pm
Murugast, for that, you must compile CSS to swf. To do that, right click on the css file from the navigator pane and choose compile css to swf.
If you’ll do that, everithing will be fine
November 20th, 2007 at 6:36 pm
404 not found, can you fix?
November 21st, 2007 at 7:50 am
Sorry, that was a case sensitivity issue that was missed when I moved to a Linux box. It should be fine now.