By:Mark Angeletti, Published:2004-10-15

So you want your Flash Website to load faster? Of course you do!

This article will share a raft of useful techniques that can be implemented to decrease the file size of your Flash movies, and thus have them load faster.

This is not intended to be a ‘how-to’ article, but rather, to provide information about what you can do to decrease the size of your Flash movies. Once you’re aware of the available techniques, you can then pursue their implementation yourself.

1. Use symbols, animated or otherwise, for every element that appears more than once in your movie.

A symbol is a reusable element found in the library of your movie. When you place a symbol on the stage or inside another symbol, you’re working with an instance of that symbol. Unlike using individual graphics, you can use many instances of a given symbol, with almost no addition to the file size of your movie.

Converting all artwork to symbols will ultimately save you bandwidth. Because Flash refers to a singular symbol to generate multiple instances, the user only has to download the graphic once, even if you use it a hundred times in your site.

In addition, symbols can save you time and trouble when it comes to making changes to your movie. This is because the changes you make to a symbol are reflected in each instance of that symbol throughout your movie.

2. Use very few — if any — raster graphics.

Although Flash has no problem allowing you to add raster graphics to your movies, it really isn’t the preferred graphic choice. Flash would be much happier if you used vector graphics.

A very brief definition of vector vs. raster graphics for those who are not familiar: vector graphics are simply mathematical definitions of shapes and lines that are used to construct your graphic. Because your graphics are created from numbers and equations, you maintain a completely scalable image. Raster file formats like BMP, JPEG, and GIF, on the other hand, are defined not by mathematics, but by a series of pixels lined up in rows with color values applied to each individual pixel (or dot).

Because vector graphics are essentially just mathematical equations that, when formulated, produce a graphic they take up very little storage space, and add little to the overall file size of your movie.

While this may be old news to some, hopefully this information will help the new Flash user avoid making that grave mistake of taking their honed Photoshop skills and trying to drop all those raster graphics into Flash. In short, a nice raster graphic used occasionally is probably ok, just don’t try and build your entire Flash site from raster graphics.

3. Change the quality of jpg images.

So you totally disregarded the statement above, and went ahead and added that .jpg to your Flash movie? Well, let’s at least trim it down.

Open up your library by hitting CTRL + L, and locate your imported .jpg. Right-click on it and go to properties. Uncheck ‘use imported JPEG data’ and you’ll find that you can adjust the image quality. You will have to play with the quality setting until you find a happy medium of appearance vs. file size. I always adjust this setting — it alone can make a huge difference to your file size.

4. Load images dynamically.

A great new feature of MX is that it gives you the ability to load .jpg graphics dynamically. This is achieved in the same way you would load an external .swf — using the loadMovie() action. Add a MovieClip to the stage and give it and instance name of "imageholder". Then add the following actionscript to a keyframe:


Warning! Progressive JPEG images do not appear when loaded dynamically using the loadMovie action.

5. Other useful tips to optimize images.

Using the Modify — Smooth, Straighten and Optimize commands found on the menu bar to refine shapes and lines may also help to reduce the overall size of your swf. You can use these commands repeatedly on a shape until you are satisfied with the level of optimization, or the look of the graphic.

Also in the Modify menu is the Trace Bitmap command. This command will convert a bitmap to a vector image, and often does a good job — though, usually, the quality of conversion depends on the complexity of the image. Typically .gifs convert better than .jpgs. You may want to play with this command and see how it affects different graphics.

6. Limit the number of special line types such as dashed, dotted, ragged, and so on.

Solid lines are smaller. Lines created with the pencil tool require less memory than brush strokes.

mulberry sale spyder womens jacket cheap new balance 574 mulberry outlet cheap new balance 574 arcteryx outlet mulberry sale spyder womens jacket mulberry sale spyder womens jacket mulberry outlet mulberry outlet new balance 574

Popular Articles

Top 10 Commentators

Subscribe to this feed! Subscribe by Email!

Random Bits Podcast

You need to download the Flash player from Adobe

Other Sites