Random Blog on Technology, Computers, Products, Reviews

Optomizing FLAs in Flash

It doesn’t matter if you design ads or a whole site in Flash, its always a good idea to optimize your Flash so it loads as quick as possible, this is probably even more important with ads as you don’t want them to be huge.

Optimize the images before you import them into Flash. Don’t be scared to use a GIF, PNG or a rather large 24-bit/32-bit PNG. I’ve seen Flash compress 200k PNG files down to 25k before.

Use vector art when possible. Its not always realistic but often times a good gradient, messy line stroke and an alpha transparency will pull off a good enough job.

Use static text rather than images. If you export for the Flash 8 Player you can get really nice anti-aliased fonts (assuming they are big enough), however to reach a larger audience of Flash users you probably will be exporting for something older and you wont have the option for anti-aliasing the text. Thats why so many people use bitmap and pixel fonts in Flash, even with Flash 8 sometimes the anti-aliasing is still too blurry for some people. Flash 8 also has filters for drop-shadow, glow, bevel and more. Usually what I do for a drop shadow is make a duplicate copy of the text, make it dark gray and offset it 1 pixel lower and 1 pixel to the right and below the original text.

Use Dingbat fonts if you need a symbol, icon or need to build something rather quickly in Flash.

Use symbols. Reusing a vector shape or a graphic will help you cut down the size of your file a lot. Plus when you use a symbol you can change the size, tint, and rotation of that symbol for a few bytes.

Make sure in Publish Settings you have Compress Movie checked (will only work when exporting for Flash 6 Player or higher.

If you have audio, you can set it to Mono and adjust the Bit rate in Publish Settings, of course this will reduce the quality but for short sound effects it should ok.

If you need to reduce the size of your FLA even more go into Publish Settings and check Generate size report. This will give you a TXT file with a breakdown of everything in your movie and can give you clues on what is making your movie so big.

Components are expensive. Components require ActionScript 2 classes, so if you can its a good idea not to use them. Ive seen tutorials from the Flash 5 days (components weren’t added until Flash MX : Flash 6) on how to build your own scrollbar and other tutorials on building your own FLV or MP3 player.

When all the above fails you can adjust the JPEG quality in Publish Settings and take it down a little more. Its best to take it down in increments of 5 and then see how it looks and check the file size.

With broadband internet access much higher than years ago, the Bandwidth Profiler is not used as much as it once was but its still a good idea to check it on bigger files. Keep the following in mind:

Flash does stream what it can and will start playing the time line as soon as it can, however it will “pause” when something is not done.

Flash will not play a movie clip until that entire movie clip is loaded.

ActionScript 2 classes can be delayed and set to load on another frame besides frame 1.

Sometimes its a good idea to stagger your items at the front of a flash movie. For example you might have a background color or gradient load on frame 1, the logo on frame 2, and your preloader on frame 3.