1 Reply Latest reply on Jan 14, 2009 12:44 PM by matthew horn

    Export File Size to Large

    pasta_Primavera
      A long time ago I asked this question. I really didn't get a good solution and at the time it was not all that important as I needed to get it working more than shrinking the file size.
      I work with embedded controllers, much like what are in you routers, high end switches and internet connected things that when plugged into you LAN will serve up a web page when you connect to it to allow you to customize the device. In most of these things there is not all that much room to place files. Typically there is only about 256k to 512k of memory space to not only stick the code that makes it work but the web site as well.

      Now that I have been using Flex for a while, I think its just dam awesome!!! However it does do one thing that I cannot figure out how to get around. Whenever I simply create a new project and then just export it the file size is 160k. Now that's 160k without anything in there, no buttons, sliders, nothing. the last web site I made for an embedded device was 220k. Yet the same thing in when I did it in FLASH was only 25k. So what's up with that ?

      My questions is this, what can I do to decrease this file size.
      Also, why is there such a huge difference between FLASH and FLEX files sizes doing the same things.







        • 1. Re: Export File Size to Large
          matthew horn Level 3
          Well, a couple of things:

          1) The default compilation is to include debug code. So be sure you are selecting Export Release Build when you build in Flex Builder, or disabling debug on the command line. That should reduce it a little.

          2) Use RSLs (runtime shared libraries). Specifically, RSLs are designed to reduce the app size, especially if the user has already downloaded the signed framework RSL. More info: http://livedocs.adobe.com/flex/3/html/help.html?content=rsl_09.html

          3) Every app has a lot of built in framework code -- even the simplest app has alot of framework classes that it must include (such as managers and layouts). If you add components, though, the increase in file size will be minimal. So an app by itself might be 150K, but if you add 10 buttons and 10 labels, the app might only increase a few K, if that much.

          There's some doc that mentions additional techniques on reducing SWF file size here: http://livedocs.adobe.com/flex/3/html/performance_06.html#208825

          hth,
          matt horn
          flex docs