Random

eyepro

Mitglied
Hi ,Wer kann mir helfen?
Hier habe Ich eine Randim Script es solte jedes mal nue movie abrufen bei hompage besuch.Aber es zeigt mir immer movie1,hmm eine fehler ist dabei aber wo?

gruß
eyepro

HTML:
<script language="JavaScript">
// Generate a Random Number
var randomnumber = Math.round(Math.random()*3);
// Select a movie and execute the corresponding function
if (randomnumber == 1)
{movie1();}
else if (randomnumber == 2)
{movie2();}
else {movie3();}
//mo2
//Functions to write out the correct flash movie resource.
function movie1(){
document.write("<object classid=\"clsid:27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0\" width=\"100\" height=\"100\"><param name=movie value=\"movie1.swf\"><param name=quality value=high><embed src=\"movie1.swf\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"100\" height=\"100\"></embed></object>")
}
function movie2(){
document.write("<object classid=\"clsid:27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0\" width=\"100\" height=\"100\"><param name=movie value=\"movie2.swf\"><param name=quality value=high><embed src=\"movie2.swf\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"100\" height=\"100\"></embed></object>")
}
function movie3(){
document.write("<object classid=\"clsid:27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0\" width=\"100\" height=\"100\"><param name=movie value=\"movie3.swf\"><param name=quality value=high><embed src=\"movie3.swf\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"100\" height=\"100\"></embed></object>")
}
</script>
 

Neue Beiträge

Zurück