2 Replies Latest reply on Dec 7, 2009 5:56 PM by viatropos

    Optimizing SWC Help

    viatropos Level 1

      Hey,

       

      I am trying to optimize a few library projects I have for deployment.  I have read Optimizing RSL SWF Files and have run this command on my decompressed library swc file folder (library.swc plus catalog.xml):

       

      optimizer -keep-as3-metadata="Bindable,Managed,ChangeEvent,NonCommittingChangeEvent,Transient" -input /path/to/swc_folder/library.swf  -output /path/to/swc_folder/output.swf

       

      It cut the swc file down in size by more than half, which is great!  Still haven't used it yet, that's the next mission.

       

      But my question is, how do I manage the assets/resource-bundles in the decompressed folder, many of which I don't want.  The unix command "ls -Rla" shows all the files in the decompressed swc:

       

      ./swc_folder:

       

      catalog.xml

      library.swf

      locale

      mx

      spark

       

      ./swc_folder/locale:

      en_US

       

      ./swc_folder/locale/en_US:

      base.properties

      collections.properties

      components.properties

      controls.properties

      core.properties

      effects.properties

      layout.properties

      logging.properties

      messaging.properties

      rpc.properties

      skins.properties

      sparkEffects.properties

      styles.properties

      textLayout.properties

       

      ./swc_folder/mx:

      controls

       

      ./swc_folder/mx/controls:

      Button.png

      HScrollBar.png

      Image.png

      List.png

      SWFLoader.png

      TextInput.png

      Tree.png

      VScrollBar.png

       

      ./swc_folder/spark:

      components

       

      ./swc_folder/spark/components:

      Button.png

      DataGroup.png

      Group.png

      HGroup.png

      HScrollBar.png

      Label.png

      List.png

      Panel.png

      RichEditableText.png

      Scroller.png

      SkinnableContainer.png

      SkinnableDataContainer.png

      TextArea.png

      ToggleButton.png

      VScrollBar.png

       

      First, I am not using any of those pngs in my project, so how do I get rid of them?  And second, for the resource bundles, if I have 5 library projects all using the same bundles (plus a few of their own), how do I extract them out of this swf/swc and make them all reference the same one, so I can cut down on size/duplication?  Can't seem to find this kind of detail anywhere.

       

      Thanks so much for your help, really looking forward to some good compression/optimization

       

      Best,

      Lance

        • 1. Re: Optimizing SWC Help
          Glenn Ruehle Adobe Employee

          Hi Lance,

           

          The first step is understanding the difference between SWC and SWF files.

           

          SWC files are for authoring - they contain all possible information needed by tooling and for authoring. This includes debug symbols, icons for the components panel, embedded resources, etc.

           

          SWF files are for deployment - they only contain the minimal information needed at runtime.You can choose more information, like debug symbols and/or line information, which will affect the size of the SWF. The optimzier tool can be used to strip this extra information out of a SWF file.

           

          RSLs are just SWF files that are loaded at runtime. SWZ files are just signed RSLs.

           

          I would not be concerned about the size of SWC files. SWF files are a different story, and should be made as small as possible.

           

          Hope this helps,

          Glenn

          • 2. Re: Optimizing SWC Help
            viatropos Level 1

            Mmm.. I see, thanks.  So the stuff outside the library.swf is just stuff required for flex builder and debugging.  Not included in the swf.  Got it