Click to See Complete Forum and Search --> : Actionscript for random play on re-load


tfnj4847
02-22-2008, 10:18 AM
I would like to randomly display new content on my index page each time the page is loaded. The content is 3 different Flash movies. Alternatively, a method of rotating the page itself would work. I have a script for a random image loader, but it only works with jpg's or gif's. Any ideas? Actionscript?

paulcalabro
02-23-2008, 10:41 AM
There's probably a bunch of accomplishing this. Two ways I'm sure that would work are using: (1) Javascript (2) PHP

What you would be doing is creating a variable with a random value between 0 and the # of videos you have. It might be something like this:

var movie = random(0,10);


Don't quote me on this. I haven't taken the time to actually lookup the syntax. Each language does it differently.But that should be a simple task for you.

Then...

Wherever the filename is specified in your code, place the variable there.


That's the basics of it....