Flash : Save and Compact
March 18th, 2007
Just a quick tip for those of you working away in Flash. You've probably noticed that the source fla files get really big, really fast. In fact, Here's a fun little exercise for you.
- Create a new, blank .fla file and save it.
- Note the filesize.
- Add a bunch of sound files to it, some components, a couple symbols... now resave, and note the new file size. It should be bigger (d'uh!)
- Now remove all that crap. Resave, and note the new file size.
Your instincts would tell you that since you removed all that information, that the file should be smaller, but in fact, its the opposite, the file has grown even larger then it was when you had the sound and symbols in there! This is not a bug, and in fact, its probably the behaviour you want. Rather then take the time to restructure the file, and add re-optimizing it, Flash simply appends the changes to the file at the end of the already saved information. Thus, every time you save it, it just appends the new information to the back of the file, and it get's bigger, and bigger and bigger. This "quick save" is ideal when you're working with the file (who wants to wait 30 seconds to save the file), but it can lead to massive .fla files.
The simple trick to taming this beast is to use file > save and compact. This will restructure the file, and optimize it. It'll also remove all "history" in the file though, so you'll be killing your ability to undo before the save... so use it for "milestone" saves, and not as a matter of course. From Adobe:
You can use several options to save a file: Save, Save As, and Save and Compact. When you save a file, Flash does not analyze all the data before creating an optimized version of the document. Instead, the changes you make to the document are appended to the end of the FLA file's data, which shortens the time it takes to save the document. When you select Save As and type a new name for the file, Flash writes a new and optimized version of the file, which results in a smaller file size. When you select Save and Compact, Flash creates a new optimized file (removing the undo history) and deletes the original file.
More information is available from the Adobe Developer Center.
This entry was made on March 18th, 2007 @ 12:49 and filed into How-To.
