2 Replies Latest reply on Oct 31, 2010 11:57 PM by Flex harUI

    Raw *.CSS files in Runtime

    AJet1234 Level 1

      I have seen in a blog ( http://www.onflex.org/ted/2007/01/flex-201-understand-runtime-css.php) that you can compile a CSS file into SWF and then load it dynamically in runtime using the StyleManager class.

      This is however not exactly what I'd like to do. I want to just place the "raw" (source) CSS file on a specific path and have the SWF app load it automatically by reference to that path. So, if I change the css file, the appearance of the application will also change, without the need to recompile anything. In other words, I want it to operate exactly in the same way as HTML documents use links to external CSS files. Is this possible?

      I have performed an experiment and I am confused with the results. In compile time, I added the following tag to my mxml file: <mx:Style source="mystyles.css" />, then compiled the SWF, ran it and then changed the CSS. Sometimes the appearance changed and sometimes not. I can't understand how it works. What is the path it checks for the CSS file? What happens if the CSS file is not found? Will it work just in the same way without the IDE, in deliverables? I haven't found anything in the Help regarding this issue.