[Javascript] RE: Random file on page load... or at least that was the idea :(

Philip Mason mason-p at orange.net
Thu Feb 10 18:28:13 CST 2005


I have found this script that was posted a while back. 
https://lists.latech.edu/pipermail/javascript/2002-October/004251.html 
 
Thought it was a good idea and tried to test it.
 
I have copied the script into a text file and renamed it to an html file
however I cannot get it to play anything? I have the files 1-8.swf in the
same directory however nothing appears. The web page appears blank.
 
Am I making a simple mistake?
 
Here is the script:
<script language="JavaScript">
<!-- Random Flash Player by Raphael Pirker (www.nr1webresource.com)
 
/* Let's make the Array of movies and the height and width. This is the only
block
you'll need to modify! Insert the path to the movies (you can add or remove
movies
as you wish!) and enter their height and width (in pixels) 
That's all! You're ready to roll! */ 
 
var movies = new
Array("1.swf","2.swf","3.swf ","4.swf ","5.swf ","6.swf ","7.swf ","8.swf")
 
// Nothing needs to be edited here! Change at your own risk... :-) 
rnd = (Math.floor(Math.random() * movies.length));
 
// Output into the source:
document.writeln('<EMBED src="'+ movies[rnd] +'" quality=high
TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_
Version=ShockwaveFlash" WIDTH="610" HEIGHT="200">'); 
document.writeln('</EMBED>'); 
 
// End of Script -->
</script>
 
Thanks 
 
Philip
 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20050211/6983bb2d/attachment.htm>


More information about the Javascript mailing list