...

View Full Version : have flash load after the site



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

_Aerospace_Eng_
07-07-2005, 07: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.

esthera
07-07-2005, 07: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.

_Aerospace_Eng_
07-07-2005, 07: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">'
+'</object>';
}
//-->
</script>
And in your body tag add this

onload="loadFlash()"
so your body tag looks like this

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

AshleyQuick
07-18-2005, 08:54 PM
Look here:

http://answers.google.com/answers/threadview?id=27907

leontb
12-29-2009, 11:44 PM
Thanx very much Aerospace!

Your script does the trick!

_Aerospace_Eng_
12-30-2009, 03: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);
}
</script>
<div id="theflash">Alternate content</div>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum