# \*.swf random or by order

**URL:** <https://forum.kirupa.com/t/swf-random-or-by-order/22831>\
**Category:** flash\
**Created:** [June 9, 2003, 12:28pm UTC](https://forum.kirupa.com/t/swf-random-or-by-order/22831 "2003-06-09T12:28:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ach](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@ach](https://forum.kirupa.com/u/ach)\
**Post date:** [June 9, 2003, 12:28pm UTC](https://forum.kirupa.com/t/swf-random-or-by-order/22831/1 "2003-06-09T12:28:13Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 9, 2003, 2:06pm UTC](https://forum.kirupa.com/t/swf-random-or-by-order/22831/2 "2003-06-09T14:06:36Z")

</div>

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:

```auto

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](http://KIRUPA.COM).

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 10, 2003, 6:40am UTC](https://forum.kirupa.com/t/swf-random-or-by-order/22831/3 "2003-06-10T06:40:37Z")

</div>

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 ?  
[AS]  
\<html\>  
\<head\>  
\<title\>Document\</title\>  
\</head\>  
\<body bgcolor="#FFFFFF"\>  
\<object classid=“clsid:3540000” codebase=“[http://download.macromedia.com/#version=4,0,2,0](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](http://www.macromedia.com/hockwaveFlash)” type=“application/x-shockwave-flash” width=“585” height=“133”\>  
\</embed\>  
\</object\>  
\</body\>  
\</html\>  
[/AS]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 10, 2003, 1:48pm UTC](https://forum.kirupa.com/t/swf-random-or-by-order/22831/4 "2003-06-10T13:48:00Z")

</div>

What he meant is that everything happens in the swf, not in the HTML. This code is Actionscript, not Javascript 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 10, 2003, 1:48pm UTC](https://forum.kirupa.com/t/swf-random-or-by-order/22831/5 "2003-06-10T13:48:46Z")

</div>

oh i was assuming you were trying to load the movie from within a flash movie. that code i gave you was actionscript.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 10, 2003, 6:44pm UTC](https://forum.kirupa.com/t/swf-random-or-by-order/22831/6 "2003-06-10T18:44:55Z")

</div>

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 :_( ;(
