Thanks for your response and all the info about the way the SWF is
compiled.  I am looking for an obfuscator, but all the 3rd party tools
out there are still in development.

If the comments are not complied into the SWF then there must be
something else that is causing the size difference - like line numbers
issue you spoke to.  

I am working on 'lite' version of Cairngorm.swc.  To do so I made a
new Library project and put in all the com.adobe.caringorm.* source
code (v2.1)

I removed the business package and the SWC size drops to 8364 bytes
I then remove all the comments the the SWC size drops to 8302 bytes

The 64 bytes must just be the difference in line numbers.  I just
assumed that the comments were added in like in AS2.

Perhaps I should remove all the extra line breaks in the code ... 



--jason



--- In flexcoders@yahoogroups.com, "Gordon Smith" <[EMAIL PROTECTED]> wrote:
>
> Comments are not compiled into the SWF; no source code is. The debug
> version of the SWF has opcodes which have file paths and line numbers.
> So there is a tiny effect from comments affecting the line numbers
> (possibly to have more digits) which can then change the SWF
> compression. But this is insignificant.
> 
>  
> 
> Names like getVideoPlayer only appear once in the SWF (in the "constant
> pool") no matter how many times you call this method, but the constant
> pool can still be sizable. A SWF obfuscator would presumably shorten the
> names (as well as make them unreadable), but Adobe haven't developed one
> and I'm not sure 3rd-party ones are available for Player 9 SWFs.
> 
>  
> 
> - Gordon
> 
>  
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Jason Hanson
> Sent: Friday, February 09, 2007 10:40 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] remove comments on compile - strip comments -
> optimize SWF size - reduce size
> 
>  
> 
> Is there a way to remove comments or strip comments out of the AS3
> code during compiler preprocessing? I have noticed that the SWF size
> is larger if comments are left in. It is not a huge amount of added
> size, but it can add up to 10-20 KB for a large project. 
> 
> I am working on an AS3 project (not mxml) and I am trying to get the
> final size down to less then 40KB. I am looking for a way to remove
> comments to make the SWF smaller. I would also like to run a tool
> that will shorten all the class, property, and method names. I could
> go in and manually optimize the code, but it makes development much
> harder when you have no comments and you methods are named gvp()
> gvpl() instead of getVideoPlayer() and getVideoPlaylist(). I would
> much rather find a precompile process of some kind.
> 
> Any ideas?
> 
> Thanks
> 
> --jason
> 
> key words:
> remove comments on compile
> strip comments
> optimize SWF size
> reduce size
> file size
>


Reply via email to