4 Replies Latest reply on Sep 1, 2011 9:12 PM by drkstr_1

    Flex Stylesheet

    mihksoft Level 1


      Could anyone help me with some answers?
      I have Flash Builder 4.5 and a flex 3.x project.
      I have in src.assets the file style.css and in main mxml(located in defaul
      package) file
      <mx:Style source="assets/style.css"/>.
      1. Why style.css is not in bin-debug after build the application?
      2. If I change something in style.css, the changes are not made in the project.

      Best Regards,

        • 1. Re: Flex Stylesheet
          Flex harUI Adobe Employee

          CSS files are "compiled" into the SWF.  They are not loaded at runtime like

          they are in HTML.


          If you change the css file and re-compile the SWF and changes are not having

          any effect, you will have to find a way to figure out why.  If you can

          reduce it down to a small test case, post the test case.

          1 person found this helpful
          • 2. Re: Flex Stylesheet
            mihksoft Level 1

            If I re-compile the swf, changes are visible.

            Is there any solution to have a css file near swf, change it and changes take effect without recompiile the swf?



            • 3. Re: Flex Stylesheet
              Flex harUI Adobe Employee

              Flex does not come with the capability to parse a CSS file at runtime and

              use it.


              I have an example on my blog in the Flex and HTML post that parses some

              limited CSS at runtime and converts it, but it can only handle simple CSS.


              There might be some 3rd party solutions as well.



              Alex Harui

              Flex SDK Team

              Adobe System, Inc.


              • 4. Re: Flex Stylesheet
                drkstr_1 Level 4

                F*CSS is a pretty solid CSS implementation for Actionscript. You will not be able to embed assest or make class references though.


                Is your goal simply to load styles at runtime? Because you can do that by compiling the stylesheet (unless your targeting an iOS app). This would not require you to recompile the application SWF.