PDA

View Full Version : Problem with loading a random swf. into a target



bubba1
August 3rd, 2003, 02:23 PM
Hello,
I am trying to load 1 of 4 swf. files randomly into a holder on a home page.

the code I'm using doesn't work.
here is the actionScript:

loadMovie("image" add random(3) + 1 add ".swf", "_root.holder1")
stop();

my swf files are named:
image1.swf
image2.swf
image3.swf
image4.swf

when I test the movie I get an error message that it can't find the movie.
As an example, the code is adding a 1
to the name of the swf.
image11.swf

Any insight would be greatly appreciated,
thx

claudio
August 3rd, 2003, 02:31 PM
loadMovie("image"+(Math.floor(Math.random()*4)+1)+".swf","_root.holder1");

bubba1
August 3rd, 2003, 02:38 PM
claudio,
It works! Thank you so much for your help.

claudio
August 3rd, 2003, 02:41 PM
No problem ;)