PDA

View Full Version : *.swf random or by order



ach
June 9th, 2003, 08:28 AM
Hello
I have some *.swf files, and I want that they upload in page in random order or by order.
Its easy to make with JS when we have *.gif. I want to make the same with *.swf.

But i dont know how to make it.
Maybe anybody help me :)

thoriphes
June 9th, 2003, 10:06 AM
you can put a number after each swf then have flash randomly choose a number and load the corresponding movie. for example if you named all the movies fish1.swf, fish2.swf, fish3.swf...etc, you can have flash load a random movie using this script:


movie = "fish"+random(10)+".swf";
loadMovie(movie, "randommovie", 0);


hope that helps.

ps. if you didn't notice, kirupa has a similar thing going on at the top banner. when you reload a page, he has a different icon next to KIRUPA.COM.

ach
June 10th, 2003, 02:40 AM
Thankyou for your script, it is good for me, i need the same type to do.
Where i have to write this script,or HTM ?

<html>
<head>
<title>Document</title>
</head>
<body bgcolor="#FFFFFF">
<object classid="clsid:3540000" codebase="http://download.macromedia.com/#version=4,0,2,0" width="585" height="133">
<param name=movie value="fish1.swf">
<param name=quality value=high>
<embed src="fish.swf" quality=high pluginspage="http://www.macromedia.com/hockwaveFlash" type="application/x-shockwave-flash" width="585" height="133">
</embed>
</object>
</body>
</html>

pom
June 10th, 2003, 09:48 AM
What he meant is that everything happens in the swf, not in the HTML. This code is Actionscript, not Javascript :)

thoriphes
June 10th, 2003, 09:48 AM
oh i was assuming you were trying to load the movie from within a flash movie. that code i gave you was actionscript.

ach
June 10th, 2003, 02:44 PM
Thank you for your help, but it dont work.
Maybe i did a mistake? :sigh: I see only blank *.swf. :-\
I atached this file, please maybe you can find out what is incorect :*( ;(