Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

load random image and .swf files on refresh

Status
Not open for further replies.

justiceyoungs

Technical User
Sep 14, 2007
3
GB
Hey guys sorry if this is one of the less technical questions, but im new to this and only need a script to load images AND flash files randomly, i have 5 images (jpg and gif) and 3 movies (.swf). Can anyone help me with this?

btw i have looked at hotscripts etc, there is only ones for images OR movies. been looking all morning -_-...
 
sorry this is this code i have just tried, i made it myself and have VERY little knowledge. Can someone please have a look.

<script language="JavaScript">


var randomnumber = Math.round(Math.random()*8);


if (randomnumber == 1)

{movie1();}

else if (randomnumber == 2)

{movie2();}

else if (randomnumber == 3)

{movie3();}

else if (randomnumber == 4)

{image1();}

else if (randomnumber == 5)

{image2();}

else if (randomnumber == 6)

{image3();}

else if (randomnumber == 7)

{image4();}

else {image5();}
function movie1(){
document.write("<object width=\"600\" height=\"100\">
<param name=\"movie\" value=\"<embed src=\" width=\"600\" height=\"100\" alt=\"europrinter\">
</embed>
</object>")
}

function movie2(){
document.write("<object width=\"600\" height=\"100\">
<param name=\"movie\" value=\"<embed src=\" width=\"600\" height=\"100\" alt=\"C6500\">
</embed>
</object>")
}

function movie3(){
document.write("<object width=\"600\" height=\"100\">
<param name=\"movie\" value=\"<embed src=\" width=\"600\" height=\"100\" alt=\"Web Design\">
</embed>
</object>")
}

function image1(){
document.write("<img src=\" width=\"600\" height=\"100\" alt=\"250 Business Card

Offer\">")
}

function image2(){
document.write("<img src=\" width=\"600\" height=\"100\" alt=\"Business Pack\">")
}

function image3(){
document.write("<img src=\" width=\"600\" height=\"100\" alt=\"Calendar Offer\">")
}

function image4(){
document.write("<img src=\" width=\"600\" height=\"100\" alt=\"Charity Offer\">")
}

function image5(){
document.write("<img src=\" width=\"600\" height=\"100\" alt=\"Small business

pack\">")
}

</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top