Do you want random or alternating? Random is easier but, with random, there can easily be a string of repeats, especially if the pool of choices is limited.
I'm no expert on Flash but, its Action Script is very much like javascript so, there may be a way to get a single swf to branch randomly each time it is loaded and in essence appear differently on different loads. Javascript may also be used to write out the object tag, selecting a random swf from an array:
Code:
<script type="text/javascript">
(function(){
var theSwf=["swf1.swf", "swf2.swf", "swf3.swf", "swf4.swf"];
theSwf.sort(function() {return 0.5 - Math.random();})
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"\n\
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"\n\
width="362" height="287">\n\
<param name="movie" value="'+theSwf[0]+'"> \n\
<param name="quality" value="high">\n\
<param name="wmode" value="transparent">\n\
<param name="menu" value="false">\n\
<!--[if !IE]> <-->\n\
<object data="'+theSwf[0]+'"\n\
width="362" height="287" type="application/x-shockwave-flash">\n\
<param name="quality" value="high">\n\
<param name="wmode" value="transparent">\n\
<param name="menu" value="false">\n\
<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer">\n\
FAIL (the browser should render some flash content, not this).\n\
</object>\n\
<!--> <![endif]-->\n\
</object>\n');
})();
</script>
If you make it an external script, you get the added benefit of avoiding the 'click to activate' feature.
Bookmarks