devinm
asked on
Random
I need a random thing for my page. I need to have like 4 random events that can happen.
For each random event, I need a random picture displayed out of a list of 4 pictures. Can someone explain to me how to do this???
For each random event, I need a random picture displayed out of a list of 4 pictures. Can someone explain to me how to do this???
ASKER
Sorry, need more of an explaination. This is 600 points ya know...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Here is how I would do this:
Every n seconds we generate a random number. If the random number equals 1, 2, 3, or 4 then we will display the appropriate image. If the random number generated is 5 or higher, then do nothing.
Since it is a little lengthy, I have posted an example on line instead of pasting it all here. It is at:
http://www3.onanalysis.com/dev/rand/
View the source... hopefully this is what you are looking for.