2 Replies Latest reply on Dec 7, 2009 4:02 PM by viatropos

    Flex/Spark Theme Optimizations

    viatropos Level 1

      Hey there,


      I am getting ready to deploy an app using Spark.  I'm trying to learn as much as I can about RSLs, themes, modules, the compiler etc. to make the general flex user experience much smoother.


      I have a few pressing questions:


      1) How are you guys compiling the themes, and what size are they 'slash' how do you get them to be so small?  I've read lots on how to make them small and I've studied the source for months, so maybe you could shed some like on your exact method.


      2) Looking into SparkClasses.as, it looks as though you are compiling a default theme INTO the spark framework???  That doesn't seem quite right.  That means if I want to use an RSL, I have to create my own build of the framework, which isn't a problem but that dramatically decreases its usability:  now it's highly unlikely someone else will have the same rsl, so no sharing.  It seems like the SparkClasses.as Skins should be in the sparkSkins.swc, or at least separate from the core framework with my own theme without the overhead of this built in one.


      3) When compiling a theme, is it best-practice to include skins in the library, or are they automatically linked in based on the ClassReference in css (doesn't look like they are, but just checking)?  And since the skins use part of the flex/spark framework, if I specify to use the framework rsls, will they use it?


      Thanks for your help, it's been a journey trying to understand exactly how to optimize this stuff



        • 1. Re: Flex/Spark Theme Optimizations
          Glenn Ruehle Adobe Employee

          Hi Lance,



          1.  Our themes are built using compc, and specifying the framework swcs in the external-library-path arguments. This ensures that the framework classes are not included in the theme. For details on our exact method, look at the build.xml files in framework/projects/wireframe or framework/projects/halo.

          2.  The spark theme is being built into the spark framework. Yes, this does add a bit of overhead with the initial load of the RSL, but once it is downloaded it can be shared across all apps.

          3.  When compiling a theme, you must explicitly include your classes, and also do an include-file for your css file. Compc doesn't compile your css file, it simply includes it in your theme swc (with the include-file option). When using your theme with mxmlc, the css file from your theme is compiled and that is when the associated classes/skins are linked in. If you use external-library-path for the framework swcs, it will use the framework classes from the main app, which can either be statically linked or loaded from an rsl.



          • 2. Re: Flex/Spark Theme Optimizations
            viatropos Level 1

            Thank you Glenn, that was helpful.  Along those same lines, do you have a solution to this problem?




            There are a bunch of icons and resource bundles being included in the library swc and I would like to know how to remove the icons and share the resource bundles between all the libraries using them.


            And one last thing, when you have something like this in the frameworks/projects/spark/build.xml:


            <external-library-path dir="${FLEX_HOME}/frameworks/libs">

              <include name="player/${local.playerglobal.version}/playerglobal.swc"/>



            Is that automatically done when I create a library project?  I'm looking through the window for editing library paths in Flex Builder, and it's including tons of framework swcs.  Are these "external-library-path" items, or are they different?  I've attached an image of the screen.


            Thanks again,