Calendar

January 2007
M T W T F S S
« Dec   Feb »
1234567
891011121314
15161718192021
22232425262728
293031  

Tag Cloud

Categories

Archives

Highest Rated

Most Viewed

Recent Posts

Recent Comments


« Missed 360, how about FlexManiacs | Main | FlexInABox.com »

Flex 2.0.1 Style Swapping

By Rich Tretola | January 19, 2007Print This Post Print This Post
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
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.

changeit.jpg

Click here to run the application

Rich

Share/Save/Bookmark

Topics: Flex 2, Tutorials |

8 Responses to “Flex 2.0.1 Style Swapping”

  1. ScaleNine Blog » Blog Archive » Flex 2.0.1 Runtime CSS Example Says:
    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 [...]

  2. ScaleNine Blog » Blog Archive » Theme Swapper Says:
    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. [...]

  3. everythingflex Says:
    January 21st, 2007 at 6:37 pm

    Glad the sample helped, your styles are excellent.

    Rich

  4. murugast Says:
    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

  5. murugast Says:
    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

  6. Cristian Nica Says:
    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

  7. Logan Says:
    November 20th, 2007 at 6:36 pm

    404 not found, can you fix?

  8. everythingflex Says:
    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.

Comments