Random flash banner in a table cell

Discussion in 'Javascript' started by terrhauf, Dec 7, 2004.

  1. terrhauf

    terrhauf Guest

    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="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    width="750" height="95">
    <param name="movie" value="aaa.swf"></object>');
    flashHeader1= new Object();
    flashHeader1.src =
    ('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    width="750" height="95">
    <param name="movie" value="bbb.swf"></object>');
    flashHeader2= new Object();
    flashHeader2.src =
    ('<object classid="clsid:D27CDB6E-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="clsid:D27CDB6E-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>
     
    terrhauf, Dec 7, 2004
    #1
    1. Advertising

  2. Nevermind, I figured it out!
     
    Terry Haufler, Dec 7, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DDK

    Adrotator and flash banner?

    DDK, Jun 25, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    3,317
    akino
    Oct 25, 2007
  2. Leon
    Replies:
    2
    Views:
    679
    Andy Lim
    Nov 15, 2004
  3. Wayne Wengert

    Banner Ads With Flash

    Wayne Wengert, Oct 24, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    225
    Scott Mitchell [MVP]
    Oct 28, 2005
  4. terrhauf

    Random flash banner in a table cell

    terrhauf, Dec 7, 2004, in forum: Javascript
    Replies:
    0
    Views:
    132
    terrhauf
    Dec 7, 2004
  5. Tony
    Replies:
    1
    Views:
    155
    Bart Van der Donck
    Aug 12, 2006
Loading...

Share This Page