7 Replies Latest reply on Sep 17, 2009 9:28 AM by Flex harUI

    Why the resource module size is so big

    Tunied

      i try to make a resource module so that i can loading the resource at run time.

       

       

      what i do is

       

       

      1` make a lang.properties (1kb) only one key-value in it  just for test

       

      2` run mxmlc -locale=en_US -source-path=locale/{locale} -include-resource-bundles=lang -output en_US_resources.swf

       

       

      the en_US_resources.swf  i got is 18kb

       

      why is the file so big?? 

       

      is there some way to reduce the file size?

       

      thanks

        • 1. Re: Why the resource module size is so big
          Flex harUI Adobe Employee

          Maybe.  Generate a -link-report and see what is in it that is already in the main app

           

          Alex Harui

          Flex SDK Developer

          Adobe Systems Inc.

          Blog: http://blogs.adobe.com/aharui

          • 2. Re: Why the resource module size is so big
            Tunied Level 1

            Hi Alex

             

            in the report i found a lot of things has been generate

             

            how can i not generate it those things , only keep the lang.properties which i want ?

             

            thanks.

            • 3. Re: Why the resource module size is so big
              Flex harUI Adobe Employee

              Some stuff, like module factories, have to be generated.  Post the link-report.

               

              Alex Harui

              Flex SDK Developer

              Adobe Systems Inc.

              Blog: http://blogs.adobe.com/aharui

              • 4. Re: Why the resource module size is so big
                Tunied Level 1
                <report>
                  <scripts>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\flex.swc(mx/core/IFlexModule)" mod="1241571407898" size="560" optimizedsize="188">
                      <def id="mx.core:IFlexModule" />
                      <pre id="Object" />
                      <dep id="mx.core:IFlexModuleFactory" />
                      <dep id="AS3" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\flex.swc(mx/events/ModuleEvent)" mod="1241571477630" size="1302" optimizedsize="728">
                      <def id="mx.events:ModuleEvent" />
                      <pre id="flash.events:ProgressEvent" />
                      <dep id="flash.events:Event" />
                      <dep id="mx.modules:IModuleInfo" />
                      <dep id="AS3" />
                      <dep id="mx.core:mx_internal" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\locale\en_US\automation_agent_rb.swc(mx/core/mx_in ternal)" mod="1243060225853" size="188" optimizedsize="109">
                      <def id="mx.core:mx_internal" />
                      <dep id="AS3" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\locale\en_US\automation_agent_rb.swc(mx/resources/ IResourceBundle)" mod="1243060231806" size="736" optimizedsize="221">
                      <def id="mx.resources:IResourceBundle" />
                      <pre id="Object" />
                      <dep id="AS3" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\flex.swc(mx/events/ResourceEvent)" mod="1241571477349" size="1029" optimizedsize="570">
                      <def id="mx.events:ResourceEvent" />
                      <pre id="flash.events:ProgressEvent" />
                      <dep id="flash.events:Event" />
                      <dep id="AS3" />
                      <dep id="mx.core:mx_internal" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\flex.swc(mx/core/Singleton)" mod="1241571408351" size="1073" optimizedsize="554">
                      <def id="mx.core:Singleton" />
                      <pre id="Object" />
                      <dep id="AS3" />
                      <dep id="mx.core:mx_internal" />
                      <dep id="Error" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\flex.swc(mx/core/IFlexModuleFactory)" mod="1241571407008" size="591" optimizedsize="182">
                      <def id="mx.core:IFlexModuleFactory" />
                      <pre id="Object" />
                      <dep id="AS3" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\flex.swc(mx/resources/ResourceManager)" mod="1241571505676" size="938" optimizedsize="517">
                      <def id="mx.resources:ResourceManager" />
                      <pre id="Object" />
                      <dep id="mx.resources:IResourceManager" />
                      <dep id="AS3" />
                      <dep id="mx.resources:ResourceManagerImpl" />
                      <dep id="mx.core:Singleton" />
                      <dep id="mx.core:mx_internal" />
                      <dep id="Error" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\flex.swc(mx/core/RSLListLoader)" mod="1241571407586" size="2291" optimizedsize="1113">
                      <def id="mx.core:RSLListLoader" />
                      <pre id="Object" />
                      <dep id="flash.events:Event" />
                      <dep id="mx.core:RSLItem" />
                      <dep id="AS3" />
                      <dep id="mx.core:mx_internal" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\flex.swc(mx/modules/ModuleBase)" mod="1241571501239" size="597" optimizedsize="287">
                      <def id="mx.modules:ModuleBase" />
                      <pre id="flash.events:EventDispatcher" />
                      <dep id="AS3" />
                      <dep id="mx.core:mx_internal" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\textLayout.swc(flashx/textLayout/compose/ITex tLineCreator)" mod="1241690522957" size="330" optimizedsize="330">
                      <def id="flashx.textLayout.compose:ITextLineCreator" />
                      <pre id="Object" />
                      <dep id="flash.text.engine:TextBlock" />
                      <dep id="AS3" />
                      <dep id="flash.text.engine:TextLine" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\flex.swc(mx/modules/ModuleManagerGlobals)" mod="1241571501270" size="508" optimizedsize="211">
                      <def id="mx.modules:ModuleManagerGlobals" />
                      <pre id="Object" />
                      <dep id="AS3" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\locale\en_US\automation_agent_rb.swc(mx/utils/Stri ngUtil)" mod="1243060234337" size="2766" optimizedsize="1458">
                      <def id="mx.utils:StringUtil" />
                      <pre id="Object" />
                      <dep id="AS3" />
                      <dep id="mx.core:mx_internal" />
                      <dep id="RegExp" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\flex.swc(mx/core/FlexModuleFactory)" mod="1241571407695" size="8579" optimizedsize="5357">
                      <def id="mx.core:FlexModuleFactory" />
                      <pre id="mx.core:IFlexModuleFactory" />
                      <pre id="flashx.textLayout.compose:ITextLineCreator" />
                      <pre id="flash.display:MovieClip" />
                      <dep id="flash.events:Event" />
                      <dep id="flash.text:TextFieldAutoSize" />
                      <dep id="trace" />
                      <dep id="mx.core:mx_internal" />
                      <dep id="mx.resources:ResourceManager" />
                      <dep id="flash.system:ApplicationDomain" />
                      <dep id="Error" />
                      <dep id="mx.resources:IResourceManager" />
                      <dep id="flash.text.engine:TextBlock" />
                      <dep id="mx.core:RSLItem" />
                      <dep id="AS3" />
                      <dep id="mx.core:RSLListLoader" />
                      <dep id="flash.text:TextField" />
                      <dep id="flash.text.engine:TextLine" />
                      <dep id="mx.events:ModuleEvent" />
                      <dep id="flash.utils:Timer" />
                      <dep id="mx.core:Singleton" />
                      <dep id="flash.events:TimerEvent" />
                      <dep id="flash.events:ErrorEvent" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\flex.swc(mx/modules/ModuleManager)" mod="1241571501255" size="10433" optimizedsize="5538">
                      <def id="mx.modules:ModuleManager" />
                      <pre id="mx.modules:IModuleInfo" />
                      <pre id="flash.events:EventDispatcher" />
                      <pre id="Object" />
                      <dep id="flash.events:Event" />
                      <dep id="flash.utils:ByteArray" />
                      <dep id="flash.system:Security" />
                      <dep id="flash.net:URLRequest" />
                      <dep id="flash.events:IOErrorEvent" />
                      <dep id="mx.core:mx_internal" />
                      <dep id="flash.display:Loader" />
                      <dep id="flash.system:ApplicationDomain" />
                      <dep id="flash.events:SecurityErrorEvent" />
                      <dep id="Error" />
                      <dep id="mx.core:IFlexModuleFactory" />
                      <dep id="flash.utils:getQualifiedClassName" />
                      <dep id="mx.modules:ModuleManagerGlobals" />
                      <dep id="flash.system:SecurityDomain" />
                      <dep id="flash.events:ProgressEvent" />
                      <dep id="AS3" />
                      <dep id="mx.events:ModuleEvent" />
                      <dep id="flash.system:LoaderContext" />
                      <dep id="flash.utils:Dictionary" />
                      <dep id="flash.events:ErrorEvent" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\flex.swc(mx/resources/ResourceManagerImpl)" mod="1241571505708" size="11226" optimizedsize="5941">
                      <def id="mx.resources:ResourceManagerImpl" />
                      <pre id="mx.resources:IResourceManager" />
                      <pre id="flash.events:EventDispatcher" />
                      <pre id="Object" />
                      <dep id="mx.resources:LocaleSorter" />
                      <dep id="flash.events:Event" />
                      <dep id="flash.events:IEventDispatcher" />
                      <dep id="mx.resources:IResourceModule" />
                      <dep id="trace" />
                      <dep id="mx.utils:StringUtil" />
                      <dep id="mx.resources:ResourceBundle" />
                      <dep id="mx.core:mx_internal" />
                      <dep id="flash.system:ApplicationDomain" />
                      <dep id="Error" />
                      <dep id="mx.modules:ModuleManager" />
                      <dep id="mx.modules:IModuleInfo" />
                      <dep id="flash.system:SecurityDomain" />
                      <dep id="AS3" />
                      <dep id="mx.resources:IResourceBundle" />
                      <dep id="mx.events:ModuleEvent" />
                      <dep id="flash.system:Capabilities" />
                      <dep id="mx.events:ResourceEvent" />
                      <dep id="flash.utils:Timer" />
                      <dep id="flash.events:TimerEvent" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\flex.swc(mx/resources/LocaleSorter)" mod="1241571505567" size="9891" optimizedsize="6828">
                      <def id="mx.resources:LocaleSorter" />
                      <pre id="Object" />
                      <dep id="AS3" />
                      <dep id="mx.core:mx_internal" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\flex.swc(mx/events/RSLEvent)" mod="1241571478005" size="1199" optimizedsize="689">
                      <def id="mx.events:RSLEvent" />
                      <pre id="flash.events:ProgressEvent" />
                      <dep id="flash.events:Event" />
                      <dep id="flash.net:URLRequest" />
                      <dep id="AS3" />
                      <dep id="mx.core:mx_internal" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\locale\en_US\automation_agent_rb.swc(mx/resources/ ResourceBundle)" mod="1243060231900" size="3585" optimizedsize="1665">
                      <def id="mx.resources:ResourceBundle" />
                      <pre id="mx.resources:IResourceBundle" />
                      <pre id="Object" />
                      <dep id="AS3" />
                      <dep id="mx.utils:StringUtil" />
                      <dep id="mx.core:mx_internal" />
                      <dep id="flash.system:ApplicationDomain" />
                      <dep id="Error" />
                    </script>
                    <script name="D:\WorkGround\Flex\Flex_Localization\locale\en_US\lang.properties" mod="1253029355921" size="284" optimizedsize="258">
                      <def id="en_US$lang_properties" />
                      <pre id="mx.resources:ResourceBundle" />
                      <dep id="AS3" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\flex.swc(mx/modules/IModuleInfo)" mod="1241571501380" size="1712" optimizedsize="531">
                      <def id="mx.modules:IModuleInfo" />
                      <pre id="flash.events:IEventDispatcher" />
                      <pre id="Object" />
                      <dep id="mx.core:IFlexModuleFactory" />
                      <dep id="flash.system:SecurityDomain" />
                      <dep id="flash.utils:ByteArray" />
                      <dep id="AS3" />
                      <dep id="mx.events:ModuleEvent" />
                      <dep id="flash.system:ApplicationDomain" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\flex.swc(mx/resources/IResourceModule)" mod="1241571505708" size="539" optimizedsize="178">
                      <def id="mx.resources:IResourceModule" />
                      <pre id="Object" />
                      <dep id="AS3" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\flex.swc(mx/resources/IResourceManager)" mod="1241571505723" size="3588" optimizedsize="1031">
                      <def id="mx.resources:IResourceManager" />
                      <pre id="flash.events:IEventDispatcher" />
                      <pre id="Object" />
                      <dep id="flash.system:SecurityDomain" />
                      <dep id="AS3" />
                      <dep id="mx.resources:IResourceBundle" />
                      <dep id="flash.system:ApplicationDomain" />
                    </script>
                    <script name="C:\Documents  and Settings\Administrator\Local  Settings\Temp\Adobe\Flex\GeneratedResourceModules\GeneratedResourceModule8535864096961026 432.as" mod="1253144696968" size="766" optimizedsize="674">
                      <def id="GeneratedResourceModule8535864096961026432" />
                      <pre id="mx.resources:IResourceModule" />
                      <pre id="mx.modules:ModuleBase" />
                      <dep id="en_US$lang_properties" />
                      <dep id="AS3" />
                      <dep id="mx.resources:ResourceBundle" />
                      <dep id="flash.utils:getDefinitionByName" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\flex.swc(mx/utils/LoaderUtil)" mod="1241571434429" size="1975" optimizedsize="1168">
                      <def id="mx.utils:LoaderUtil" />
                      <pre id="Object" />
                      <dep id="AS3" />
                      <dep id="Math" />
                      <dep id="flash.display:LoaderInfo" />
                      <dep id="mx.core:mx_internal" />
                    </script>
                    <script name="GeneratedResourceModule8535864096961026432_mx_core_FlexModuleFactory.as" mod="1253144700140" size="1250" optimizedsize="1145">
                      <def id="GeneratedResourceModule8535864096961026432_mx_core_FlexModuleFactory" />
                      <pre id="mx.core:FlexModuleFactory" />
                      <pre id="mx.core:IFlexModuleFactory" />
                      <dep id="AS3" />
                      <dep id="mx.core:IFlexModule" />
                      <dep id="flash.system:ApplicationDomain" />
                    </script>
                    <script name="D:\FlashBuilder4\sdks\4.0.0\frameworks\libs\flex.swc(mx/core/RSLItem)" mod="1241571406820" size="2490" optimizedsize="1510">
                      <def id="mx.core:RSLItem" />
                      <pre id="Object" />
                      <dep id="mx.utils:LoaderUtil" />
                      <dep id="flash.events:Event" />
                      <dep id="flash.net:URLRequest" />
                      <dep id="trace" />
                      <dep id="mx.events:RSLEvent" />
                      <dep id="flash.events:IOErrorEvent" />
                      <dep id="flash.display:Loader" />
                      <dep id="mx.core:mx_internal" />
                      <dep id="flash.events:SecurityErrorEvent" />
                      <dep id="flash.system:ApplicationDomain" />
                      <dep id="flash.events:ProgressEvent" />
                      <dep id="AS3" />
                      <dep id="flash.system:LoaderContext" />
                      <dep id="flash.events:ErrorEvent" />
                    </script>
                  </scripts>
                  <external-defs>
                     <ext id="flash.utils:ByteArray" />
                    <ext id="Math" />
                    <ext id="RegExp" />
                    <ext id="flash.system:ApplicationDomain" />
                    <ext id="flash.events:Event" />
                    <ext id="AS3" />
                    <ext id="flash.net:URLRequest" />
                    <ext id="flash.events:IOErrorEvent" />
                    <ext id="flash.display:LoaderInfo" />
                    <ext id="flash.events:IEventDispatcher" />
                    <ext id="flash.system:Capabilities" />
                    <ext id="flash.utils:Dictionary" />
                    <ext id="flash.events:ErrorEvent" />
                    <ext id="trace" />
                    <ext id="Error" />
                    <ext id="flash.events:EventDispatcher" />
                    <ext id="flash.system:SecurityDomain" />
                    <ext id="flash.events:SecurityErrorEvent" />
                    <ext id="flash.events:ProgressEvent" />
                    <ext id="flash.text:TextField" />
                    <ext id="flash.text.engine:TextBlock" />
                    <ext id="Object" />
                    <ext id="flash.display:MovieClip" />
                    <ext id="flash.utils:Timer" />
                    <ext id="flash.events:TimerEvent" />
                    <ext id="flash.display:Loader" />
                    <ext id="flash.system:LoaderContext" />
                    <ext id="flash.system:Security" />
                    <ext id="flash.utils:getQualifiedClassName" />
                    <ext id="flash.text.engine:TextLine" />
                    <ext id="flash.utils:getDefinitionByName" />
                    <ext id="flash.text:TextFieldAutoSize" />
                  </external-defs>
                </report>
                • 5. Re: Why the resource module size is so big
                  Flex harUI Adobe Employee

                  Yeah, I think that's as good as it is going to get.  We need a certain amount of code to glue the new resources into the ResourceManager.  You can file an enhancement request if you want.  We might be able to perform radical surgery in a future release.

                   

                  Alex Harui

                  Flex SDK Developer

                  Adobe Systems Inc.

                  Blog: http://blogs.adobe.com/aharui

                  • 6. Re: Why the resource module size is so big
                    Tunied Level 1

                    Thanks , waiting for the new SDK then.

                     

                    meantime i will wrote some code to use the xml file for the  multi-language things.

                     

                    hope it can working fine

                    • 7. Re: Why the resource module size is so big
                      Flex harUI Adobe Employee

                      By future, I mean after Flex 4.

                       

                      Alex Harui

                      Flex SDK Developer

                      Adobe Systems Inc.

                      Blog: http://blogs.adobe.com/aharui