views:

365

answers:

4

I really like the Flex framework, however I routinely deal with SWF files that are ~ 500KB.

I don't know at what point a file considered to be "too big" to be served on the internet, but I would assume that a 500KB download just to use a web application would certainly annoy some users.

Are there any tips or techniques on reducing the size of compiled SWFS?

As a side note, the 500KB SWF file really isn't that big of application...

+1  A: 

This answer is a little more general than you're probably looking for (it applies to all web apps, whether Flash/Flex-based or HTML/CSS/JS based or whatever), but...

It depends a lot on the use case for your application. Is it an application that will be loaded all day and pull in updates as necessary (like Gmail) or is it something that will be launched, used, then closed?

If the former, besides reducing resource size, you are probably alright here. It makes more sense to get the downloading all out of the way at once, rather than to expect the user to tolerate delays at every turn.

If the latter, you should lazy-load as much as possible. In other words, for example, instead of embedding all of the application's graphics into the SWF, load them with URLRequests or whatever method necessary when they are needed. A quicker launch will "feel" faster and more than make up for the increased HTTP requests over a short time.

eyelidlessness
+3  A: 

This might help you: http://www.onflex.org/ted/2008/01/flex-3-framework-caching.php

Chances are the user has already encountered the packaged framework before, so it would be cached. At the very least they won't have to load it from your site again.

UltimateBrent
+1  A: 

I can think of two things to try.

First don't EMBED images, fonts, and other SWF files. This will cause them to be loaded at runtime instead, so this could affect performance when the page loads, but the SWF will be smaller.

Also try splitting the application into several Modules. I know this improves the performance of the initial load time, but I don't know if it reduces the size of the top-level SWF.

Randy Stegbauer
A: 

Here I found many ways to reduce flex swf file size Check out on this link :
http://askmeflash.com/article/9/optimize-flex-swf-filesize-performance-loading

Bryson