PDA

View Full Version : loading random extrenal movies



the chad
August 7th, 2003, 08:32 PM
Hi there,

Can someone please help me. This is really urgent.
I need to randomly load an external swf into the main movie each time the browser is refreshed. I have three external swfs so far.

when loading individual external swfs, I normally create an empty movie clip on the main movie and call the external swf by using the _root.emptymovieclip command

Is the same principal used for calling external swfs randomly?

Thanks heaps,

kirupa
August 7th, 2003, 09:22 PM
Hey chat,
Here is the code I use on the home page:
cn = 1+Math.round(Math.random()*6);

loadMovie("http://www.kirupa.com/random/home/content"+cn+".swf", _root.content);

Where the movie files are named content1.swf, content2.swf, etc. Hopefully this code helps you out.

Cheers!
Kirupa :}

the chad
August 7th, 2003, 11:08 PM
hey kirupa...

you're a legend... it works like a charm!

thanks so much!

I had tried several ways and none of them were working... thanks again!