Site help

Posted by Kaz on March 6, 2006, 3:15 p.m.

1.How would I get a random .swf file to play on my site? Ive tried a few things but none work. Heres what I came up with-

<a href="http://www.64digits.com/download.php?name=code.zip&id=3330">File</a>

Couldnt post code…

Nothing appears but a white box where the swf should be.

2.How would I get a scrolling table on the side of my site? Like when you scroll down the page the table follows the scren on the left.

Comments

firestormx 18 years, 8 months ago

Try something like this:

(If your files are named 1.swf, 2.swf […] 5.swf.)

[<]html[>]

[<]head[>]

[<]script type="text/javascript"[>]

function random_swf ()

{

var number = Math.floor(Math.random()*5); //Change the 5 to however many swfs

document.getElementById('my_swf').setAttribute('src', number+'.swf');

}

[<]/script[>]

[<]/head[>]

[<]body onload="random_swf()"[>]

[<]embed src="" quality="high" name="my_swf" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /[>]

[<]/body[>]

[<]/html[>]

That's just the basics of how it's done…I havn't tested it. And you'll have to clean up a lot of the stuff…And, yeah.

Kaz 18 years, 8 months ago

Yea…I cant get it. If you can help please tell me what I did wrong. Heres my html fle and the 2 banners.

<a href="http://www.64digits.com/download.php?name=site.zip&id=3337">File</a>

firestormx 18 years, 8 months ago

Hmmm, k, you had some stuff mixed up in your javascript there, but even after I fixed it, it still didn't work.

I guess dynamicaly setting an src of an embed doesn't work?

Kaz 18 years, 8 months ago

Crap..

Anyone have anything for number 2?