Monday, October 03, 2005
Optimization tips.
Wow, have I been busy as of late. In hopes of maintaining food entering my body and a roof over my head I've been working like a dog as of late. Top that with Flash 8 coming out and I have been a busy boy.

Don't believe me?

Mishka NYC
Self Made TV

Ok, two sites for all this time of absence? I know it doesn't look like a lot, unfortunately, most of my recent work has been cleaning up after people's rather creative Flash skills. As a result I wanted to address some things that you can do to optimize your own work, this way I won't get a call to clean it up =) (wow that was really mean an cocky).

OK optimization:

1. Try to avoid using JPEGs. Its been my experience that JPEGs bloat file sizes. I am uncertain as to what is actually going on, if there is some sort of bug going on with the internal Flash compression battling the JPEG compression for dominance which results in bloated file sizes. Also to make your life easier its better to have a non-compressed file in the Flash movie, so you can adjust the compression across the file as opposed to on an individual basis.

Use PNG files, you'll see a difference. If you don't believe me, experiment for yourself, create two identical Flash files one with a JPEG and one with a PNG and play around with it.

My preference is for PNG files, and I've noticed a considerable size difference, but don't just trust me, see for yourself.

2. Crop and resize bitmap images to the exact size you need. Bitmap files bloat file sizes, the bigger the image, the bigger the file, so if you import a file and then reduce it 50% you still have the file weight if it was at 100%. Also file appearance degrades if you blow up or reduce files. Its best to have them at 100% and cropped. Try to avoid cropping images with masks.

3. Try to use a top left align for your symbols. Believe me, as someone who will have to clean up after you =) its easier for me if you use a top left registration. This will help you in the future when you begin scripting more, its easier to calculate the movieclips position if its registration is at 0,0. It'll take some getting used to but believe me you will appreciate it in the future.

4. Don't use graphic symbols. Graphic symbols have only one purpose I can see, and that is for doing synched animations. If you have a one frame symbol, make it a movieclip. It would also help to get in the habit of giving your movieclip instance names as well, this is more for scripting, since you can control any movieclip that has an instance name.

Graphic symbols are best used when you are hoping to synch audio with visual, for lip synching, or other time oriented animations. You can put all of your animation into a graphic symbol then put that symbol on the stage set to play once in the symbols property window.

5. Try to avoid embedding large audio files. Flash has pretty much mastered loading external MP3 files, take advantage of that. MP3 files can stream on loading, so you won't loose much by loading it as an mp3 file and you will keep the file size down. Loading mp3 files are actually pretty easy, reference the Sound object in the Flash help files.

6. Keep the actions on one layer and at the top. I'm an old school Director programmer, Director has its script channel at the top, it means all the code is in the exact same place all the time. Flash isn't the same.

Because you can put code on any layer, any frame, finding all the code sometimes can be frustrating. Its best to move it all to the top in a layer labeled "Actions" this way not only can you find it, but others will be able to locate it as well.

7. NEVER use gotoAndPlay() to go to a frame number, always give it a frame label. Frame numbers can change when you add or delete frames, once that happens all your code is useless, using frame labels allows you to add and delete frames without having to worry about any code that specifies a specific frame.

To be continued...
 


ARCHIVES


Powered by Blogger