views:

250

answers:

2

I'm trying to embed a flash file from my site, but for some reason it looks like the entire swf file (often up to 1mb in size) is downloaded before anything is displayed. In the mean time a white box is displayed for anything up to 20 seconds.

The same swf file on other websites shows the first frame of the swf file almost instantly then continues the loading (shows a loading bar).

Are there any steps I can take to avoid this white box being show?

Note: All of the swf files I've tried have their own built in preloader, but still take many seconds to show up initially.

Thanks! -James

p.s I'm using mostly amazon s3 (sometimes apache) to host these swf files Here's an example of the embed code I'm using:

<embed src="http://my.long.url/game.swf" menu="false" quality="high" width="640" height="480" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

A: 

is it possible, that you have most of your assets/graphics in the first frame?

the most simple thing is to use a preloader ... i mean, not built-in, just a small swf loading your main content ... also, it will modularize your game ...

back2dos
+1  A: 

your embed markup looks fine to me, except I would recomend using swfobject if you can.

The first thing I would usually do in this situation, is to find out what is actually going on. There are a few thing you can do to learn more about what is going on:

Bandwidth Profiler:

Use this tool to test how your Flash file is dowloaded and played back on different internet speeds. You will be able to see from the graph how much of your SWF file must be downloaded before it can start playing. There is a really good, in-depth guide here: Using the Bandwidth Profiler - Part 1 & part 2. I would definitly read both of those, because it explains a lot of things about what Flash and Flash Player is doing, and ways to optimise you Flash content.

Generate Size Report:

This is a powerful, but often overlooked publish setting. It will give you a breakdown of exactly how the filesize is being used. So you will be able to see how much of the files size is being used by fonts, sounds, graphics, etc.

If nothing sticks out from using these two tools, then I would surgest having an external pre-loader to load in your main SWF.

TandemAdam
Thanks, great advice.
loopj