random swf display
- Started
- Last post
- 6 Responses
- seatown
client wants an html home page with 1 flash animation in it - easy enough. However, they want to create 10 different animations that are randomly served up, so a viewer gets a different one every visit.
Is this possible? What type of script controls such a function?
- BZZZP0
without getting too technical about what's really random, and whether a visitor -MUST- see all 10 on 10 subsequent visits, just have an array in a main .swf that holds the names of 10 content swfs, and select one at random at load.
- ldww0
cookies?
but it would be alot easier to just make it completly random, but the viewer would not see a different one each time gauranteed
- Neuarmy0
use yer resources, theres plenty of tutorials out there, but im too lazy to find it for you...
- ********0
for sure it can be done. do some searching both here in this dB and actionscripting sites. ;)
- donal0
something like this
function loadinswf () {
var pickPicture = movies.Rnd();
loadMovie ("folderwithmovies/"+"movie"+(6... _root.body);and to make sure you dont get the smae one twice;
Number.prototype.Rnd = function () { var num = this;var newRnd = Math.round(Math.random()*(num-1... (newRnd == this.Rnd.old) {newRnd = Math.round(Math.random()*(num-1... (this.Rnd.old=newRnd);};
i didn't write this and the guy who did isn't in today so don't ask me to elaborate!
- donal0
i for got, you need to make a holder movie and call your other movies in from there.
our site uses this code.