View Full Version : have flash load after the site

07-07-2005, 08:14 AM
Is there anyway to set it that the flash loads after the rest of the site?

07-07-2005, 08:25 AM
Why would you want to do this? You could I guess use some javascript that writes the object tags to the page. You could call an onload in the body tag though I'm not exactly sure when the onload actually loads.

07-07-2005, 08:26 AM
I would want to do it because it's a flash ad banner on the top and it is slowing down the whole page from loading.

07-07-2005, 08:53 AM
Place a span tag where you want the flash to appear.

<span id="the-ad"></span>
Then in your head tags add this

<script type="text/javascript">
function loadFlash(){
document.getElementById('the-ad').innerHTML='<object type="application/x-shockwave-flash" data="your-movie.swf" width="700" height="100">'
+'<param name="movie" value="your-movie.swf">'
And in your body tag add this

so your body tag looks like this

<body onload="loadFlash()">
or if you can don't even put the ad on the page.

07-18-2005, 09:54 PM
Look here:


12-30-2009, 12:44 AM
Thanx very much Aerospace!

Your script does the trick!

12-30-2009, 04:00 AM
My method is outdated and I recommend doing something different. I suggest you use swfobject 2.0

It has a function that you call when you want the flash to load. I suggest placing that function in a window.onload call. You will need swfobject 2.0 for this.

<script type="text/javascript">
var flashvars = {};
var params = {};
var attributes = {};
attributes.id = "myflash";
window.onload = function()
swfobject.embedSWF("myflash.swf", "theflash", "320", "240", "9.0.0", false, flashvars, params, attributes);
<div id="theflash">Alternate content</div>