Optimise swf file size in Flash , reduce swf size August 21, 2010Posted by Tournas Dimitrios in Flash.
Flash is a powerful tool that can be used to deliver visually appealing information that’s small in size and also uses less resources in terms of CPU and memory as compared to other similar technologies like video or image animations. Besides being powerful while working in flash we come across the problem where we expect the size to be smaller or need to reduce the files size of our flash application. In this article I am trying to focus all the major areas which one should keep in mind while working with flash to achieve optimized flash size. Following are the points which should be taken care of to reduce flash file size while developing or should be applied to reduce the file size of an swf file:
Major optimization areas to reduce swf file size:
- Optimize Text: Breaking fonts apart is similar to drawing a vector shape so avoid using it where ever possible. Embed fonts certainly increase your file size a lot , use them wisely. Using device fonts is the best option because it stores fonts as ASCII codes rather than vector which is much much smaller than vector data..
- Optimize images: To compress JPG images in flash Goto –> Library –>select your image, right click on it. –> Select Properties. Properties window will appear , There you can see compression options which can be adjusted to reduce the image size , Test button can be used to see the results for desired settings. Avoid scaling image inside flash, its always better to resize the image in some image editing tool and then import to flash.
- Reduce size of audio: To reduce size of audio in flash file Goto –> Library –>select your image, right click on it. –> Select Properties . In the properties window adjust the compression settings and test it using test button to see lowest acceptable audio settings . However MP3 16kbps Fast is considered to be good setting.
- Reusing Objects: Keep track of reusable assets . Anything which can be reused should be converted to symbol and use the symbol again and again. It reduces the file size as well as the effort to create drawing again and again.
- Creating Library: If you have many swf files with common movieclips then you can create a symbol library and use that in all your swf files. The library swf will be downloaded once in browser cache and will be reused by all the swf files of your domain.
- Working with Vectors: To optimize vectors in your swf file GoTo –> Modify –> (Smooth, Straighten, Optimize). Repeat the actions until you are satisfied with the results.
- Publish settings: GoTo –> File –> Publish Settings –> Flash . In the Publish Settings window under Images and Sounds section you can find the global compression settings for Sound and Images. Modifying these settings will effect all the Sounds and Images inside the flash movie unless there compression settings are changed from inside library.
Other minor areas to reduce file size:
- Avoid embedding images , load images dynamically when required.
- Use optimize option for reducing the size and complexity of vectors.
- Use vectors rather than bitmaps where ever possible.
- While importing transparent images like png and gif make sure that transparent areas are cropped .
- Make sure you have checked the compress movies option in the Publish Movie window.
- Use bandwidth profiler (Ctrl+B)to see which frames are heavy.
- Enable Generate Size Report Option from Publish Settings to see who is taking how much size.
- You can split your swf into several swf files and load the parts when required.