SWC And Large Component File Size

While working with Flash components (creating my own), I noticed the size was ridiculously high when using the exported SWC’s in other files. Being who I am, I knew there was something I could do to fix this, and I wouldn’t stop until I at least found out the culprit.

For instance, I would have a pure AS component, and when I placed that into a new fla, it exported to over 10k! Some people may not notice or care, but for no graphics or symbols, that’s pretty high.

So I tried various things, like deleting huge chunks of my AS class code and re-exporting the SWC and it dropped size less than 1k, which is correct. So just for the hell of it, I deleted everything else in my fla that I made the component in. Every symbol, instance on stage, text, everything besides the component, gone. I followed by re-exporting and replacing the component back into the test fla.

Voila, 3k!

Going from 10k to 3k with the exact same functionality is pretty damn exciting, no? Now note that the actual SWC file didn’t change size, but the exported swf that was using the component. So the solution is to delete everything in your movie and library before exporting a SWC.

Or is it?

Funny thing is, nothing in trace variables showed up different; the large example swf seemed to have the exact same classes etc in it as the small one. The fla I used to create the original component exported a 40k (with other things that were in there), so it’s not like Flash exported the whole library with the SWC. I’m baffled.

If anybody can shed some light on this, that would be great. I don’t know the internals of Flash, or why it does things, I just use it.

One Response to “SWC And Large Component File Size”

  1. Kenneth Says:

    Just a short note to say I like your blog.

    Good job and keep up the great work!

    Kenneth

Leave a Reply