Adobe's docs on this are less than stellar, for they fail to mention that after
optimizing a SWF, you need to use the digest tool on the parent SWC again. To
help folks Goggling, here's how to create an RSL from a SWC and shrink it so it
loads quickly. (This is also at
http://flexamusements.blogspot.com/2009/04/how-to-make-swc-into-much-smaller-rsl.html
if you somehow prefer reading this silly post on Blogger)
Extract library.swf from the SWC
0. Let's refer to our SWC as {SWC} and its location on the file-system as {PATH}
1. Open {SWC} in your favorite unzip utility (7-zip works great and is free)
2. Extract library.swf to {PATH}
Run the Optimizer Tool against library.swf
3. Within /bin in your Flex SDK directory, you'll see optimized.exe, run that
and point it at {PATH}:
Example on my machine: {FLEX_SDK} = location of Flex SDK
{FLEX_SDK}\bin\optimizer
-keep-as3-metadata="Bindable,Managed,ChangeEvent,NonCommittingChangeEvent,Transient"
-input {PATH}\library.swf -output {PATH}\output.swf
(the output SWF is quite a bit smaller now, woohoo)
4. Delete DIR/library.swf and rename output.swf to library.swf
Run the Digest Tool (the docs kind of missed this re-digest step)
5. Since our SWF file changed, we need to update the digest info in our SWC
Example on my machine {FLEX_SDK} = location of Flex SDK
{FLEX_SDK}\bin\digest --digest.rsl-file {PATH}\library.swf --digest.swc-path
{PATH}\{SWC}
6. Modify your FlexBuilder projects and mxmlc ANT tasks to point to {SWC} as an
RSL with a URL of library.swf