Optimising File Size

If your files are going online, you may have to optimise the file size.

Publish Settings
To see the Publish Settings, click on the Edit button next to Profile in the Properties Panel.

Tip: If you have lost your properties panel, you can call it up with Apple-F3 (Mac) or Ctrl-F3 (Win).



Under "Flash", you can see all the publish settings. This is where you can edit the compression for the file as a whole.



Note the Audio Stream, where you can edit the sound settings. You can increase the quality to nearly no compression, or you can compress it really tiny within Flash.



For both image and sound, when it is left to flash to compress it, it can be very efficient but more quality may be lost than if you had individually optimised each and every asset.

Trace & Debug - File Size Report
Select Generate Size Report in Publish Settings. The next time you publish the file, some text will appear in the Output, and a text file like this will appear in the same folder. Use this to find out which elements are taking up space in the file.



Images - Compression in Flash


To give an example of compression, here is a photo that I took in Cornwall. Its initial size at 100% is 388kb.



If I literally just drop it into flash, the flash file containing this image will be exactly the same size as the image. Well done flash for not adding bulk to it! But, what if this is not small enough? What if we need to make it smaller.

You can start going crazy in Flash and compressing it there. In fact, the quality can get pretty terrible. Unless you like that "broken-digital-compression-artifacts-sort-of-aesthetic", but your clients might not be of the same mind... This is an example of compression where the final file size was just 16kb.



As you will notice, photos can look very terrible if they are overcompressed. Vector art does a lot better in flash, and is also much smaller, unless you have many many pokey bits and lines (this is obvious, because, it has to save more "vector points"). You should know the difference between the formats JPG, GIF, and PNG by now and why we use different formats for different files.


 * JPG - lossy format for photos
 * GIF - lossy format for flattened/compressed vectors
 * PNG - lossless format anything with transparency
 * Note: Vectors can also be copied in directly from illustrator to flash

The best method to compress the file is to start with a small file in the first place. The following is an example that is compressed first in photoshop, and then 80 compressed in Flash.



Behold, from a file size of 388 to 96. With negligible data loss.

Flash is getting smarter and smarter so as long as you press the test button while adjusting settings, you can also do it within Flash. But good practice would be to edit the source to make it streamlined, rather than having flash handle the compression.

Sound - Optimise the source asset
Although you can input sound in a variety of formats (WAV, AIFF, MP3) some of which can be pretty large, using just the MP3 does not degrade the quality too much. See for example this video: the sound was recorded as an MP3 (compressed format) on iPhone, and then imported in directly. I kept the quality high while publishing and the file size was not bloated in any way either.