0 Replies Latest reply on Apr 9, 2010 5:05 PM by josh_on

    [Embed] meta tag includes much more code in recent SDKs

    josh_on

      Not sure if this is the right forum for this - please point me to the correct one if it is not.

       

      I have a very simple actionscript project which compiles at 2.7k with flex_sdk_4.0.0.13210

      and over ten times larger at 28.8k with flex_sdk_4.1.0.15082

       

      I have isolated the code that triggers the problem.  When you embed assets in an actionscript project you need to include -static-link-runtime-shared-libraries so that BitMapAsset is properly imported. However, the latest releases seem to bring in a lot more baggage with them, and it is bloating the size of what should be very small files.  This is a BIG expense for wanting to simply attach an asset.

       

      Here is the code that I am using:

       

      package

      {

      import flash.display.Bitmap;

      import flash.display.Sprite;

       

      public class EmbedTest extends Sprite

      {

      [Embed(source='/image_assets/ui/x.gif')]

      private static var x_icon :Class;

       

       

      public function EmbedTest()

      {

      var x:Bitmap = new x_icon() as Bitmap;

      addChild(x);

      }

      }

      }

       

      If this can be fixed with different compiler options or a different Embed method I would like to know, thanks.

       

      Here is a link to the whole project with assets and Ant files - you would have to change the sdk paths.

      http://theyrule.net/test/EmbedTest.zip

       

      I am using the nightly builds because I am using the TextLayout Framework which is constantly improving.