views:

260

answers:

2

My CMS system allow people to post some swf on the homepage, however, sometime there is video which is included in swf, not two files swf+flv. When the swf video load, it near used up the bandwidth and so the page seems not response for a while ... Can I use jQuery to control all the swf in a page that they load after the others done or maybe just load it after 3s or what?

Thanks!!

+1  A: 

Use AJAX to fetch the .swf and add to the page dynamically. or,


Place the html for .swf just before the </body> tag with style as display:none and using JavaScript, add it to the proper node.

$.ready(function(){
   //move swf to proper place
});
N 1.1
A: 

Perhaps you should wrap your flash file in a div tag

<div id="image" align="center"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="281" height="28">
<param name="movie" value="whatever.swf">
<param name="quality" value="high">
<embed src="contactb.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="281" height="28"></embed>
</object>
</div> 

and use the following CSS code:

.image {
display: none;
} 

then call at your last image declartion an onload event that will display the swf block

<img onload="document.getElementById('image').style.display = 'block'" src="whatever" />

Good luck!

iTayb