Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Random flash banner in a table cell

Reply
Thread Tools

Random flash banner in a table cell

 
 
terrhauf
Guest
Posts: n/a
 
      12-07-2004
I am trying to show a random flash banner in a table cell. I have 3
flash headers/banners. I can get it to open a page with a random
header using document.write(randomHeader) in the chooseHeader()
function, but I need an object reference in a table cell.

Does anyone know how this can be done in Javascript?

Thank you, Terry

<html>
<head>
<title>ACP - Healthcare/Long Term Care : About our Company</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<script language="JavaScript" type="text/JavaScript">
<!--
var headerCount = 3
flashHeader0= new Object();
flashHeader0.src =
('<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
width="750" height="95">
<param name="movie" value="aaa.swf"></object>');
flashHeader1= new Object();
flashHeader1.src =
('<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
width="750" height="95">
<param name="movie" value="bbb.swf"></object>');
flashHeader2= new Object();
flashHeader2.src =
('<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
width="750" height="95">
<param name="movie" value="ccc.swf"></object>');
randomBanner= new Object();

function chooseHeader(){
randomNum = Math.floor((Math.random() * headerCount));
randomBanner = eval("flashHeader" + randomNum + ".src");
// document.write(randomBanner);
}

//-->
</script>
<link href="style_sheets/acp_style.css" rel="stylesheet"
type="text/css" />
</head>
<body background="images/elements/bg_grid.gif" leftmargin="0"
topmargin="5" bottommargin="5" marginwidth="0" marginheight="0"
onLoad="chooseHeader();">

<table width="750" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr><td>
<table width="752" border="0" cellpadding="0" cellspacing="0"
bgcolor="#FFFFFF">
<tr>
<td width="1" rowspan="7" align="left" valign="top"
background="pxl_black.gif">
<img width="1" height="100%" />
</td>
<td>
<img src="pxl_black.gif" width="750" height="1" />
</td>
<td width="1" rowspan="7" align="left" valign="top"
background="pxl_black.gif" />
</tr>
<!--Explicit object reference works fine: -->
<!--tr>
<td>
<object
classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
width="750" height="95">
<param name="movie" value="aaa.swf">
<!--param name="quality" value="high"-->
<!--embed src="aaa.swf"
quality="high"

pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="750"
height="95">
</embed-->
</object>
</td>
</tr-->
<!--I need a random object reference: -->
<tr>
<td width="750" height="95" align="left" valign="top">
<embed name="randomBanner" border="0" />
<!--embed src=flashHeader0.src border="0" /-->
</td>
</tr>
</table>
</td></tr>
</table>
</body>
</html>

 
Reply With Quote
 
 
 
 
Terry Haufler
Guest
Posts: n/a
 
      12-07-2004
Nevermind, I figured it out!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Math.random() and Math.round(Math.random()) and Math.floor(Math.random()*2) VK Javascript 15 05-02-2010 03:43 PM
random.random(), random not defined!? globalrev Python 4 04-20-2008 08:12 AM
Adrotator and flash banner? DDK ASP .Net 1 10-25-2007 09:31 PM
Random flash banner in a table cell terrhauf Javascript 0 12-07-2004 08:18 PM
How do I have a table cell fetch another page to display within the cell? Phillip Roncoroni HTML 14 04-05-2004 05:58 PM



Advertisments