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