header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Inder
Points:3010
Posts:0

Steps to optimise swf file size, reduce swf size. How to
Posted On: 2/28/2010 8:39:06 AM

/ Views: 24689



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:

  1. 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..
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. Fonts: Avoid using many types of Embedded fonts, since each font type when embedded is added to file. Device fonts can be used to avoid embedding of fonts where ever possible.

Other minor areas to reduce file size:

  1. Avoid embedding images , load images dynamically when required.
  2. Use optimize option for reducing the size and complexity of vectors.
  3. Use vectors rather than bitmaps where ever possible.
  4. While importing transparent images like png and gif make sure that transparent areas are cropped .
  5. Make sure you have checked the compress movies option in the Publish Movie window.
  6. Use bandwidth profiler (Ctrl+B)to see which frames are heavy.
  7. Enable Generate Size Report Option from Publish Settings to see who is taking how much size.
  8. You can split your swf into several swf files and load the parts when required.

You might be interested in these articles:
Optimize Flex SWF filesize performance loading


Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions