4.1. Loading a Style Sheet at Runtime
In Flex 3, you can compile a CSS file as a SWF (pronounced “swif”) and load it at runtime. With this feature you could allow users to customize the look of an application with the click of a button or change the appearance of an application based on specific information, like login credentials. In this walkthrough, you will create two simple but different style sheets, compile them as SWFs, and then implement a way to switch between them at runtime.
- Create a new MXML application called RuntimeStyling.mxml.
- Create two new CSS files called red.css and blue.css (File > New > CSS file).
- In both CSS files, you will be creating styling for a button. One will be red and the other blue. Open red.css and use a ...