# Random Loader in Flash 5

**URL:** <https://forum.kirupa.com/t/random-loader-in-flash-5/35312>\
**Category:** flash\
**Created:** [November 12, 2003, 5:03pm UTC](https://forum.kirupa.com/t/random-loader-in-flash-5/35312 "2003-11-12T17:03:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![norm1252003](https://avatars.discourse-cdn.com/v4/letter/n/977dab/32.png) [@norm1252003](https://forum.kirupa.com/u/norm1252003)\
**Post date:** [November 12, 2003, 5:03pm UTC](https://forum.kirupa.com/t/random-loader-in-flash-5/35312/1 "2003-11-12T17:03:26Z")

</div>

I am trying to make a random image loader for a banner on a web page. I am using flash 5. I know how to write the script for a random loader in flash mx; however, the “switch” command will not copy over to flash 5. Help!!! I have no clue on how to accomplish this effect in flash 5.

---

<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:** [November 13, 2003, 3:52am UTC](https://forum.kirupa.com/t/random-loader-in-flash-5/35312/2 "2003-11-13T03:52:42Z")

</div>

```auto

pics=["pic1","pic2","pic3","pic4","pic5", "pic6"];
randpic = pics[random(pics.length)];
_root.container.loadMovie(randpic+".jpg");

```

that should work

---

<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:** [November 14, 2003, 3:28pm UTC](https://forum.kirupa.com/t/random-loader-in-flash-5/35312/3 "2003-11-14T15:28:37Z")

</div>

where do i place the script? In the main time!! and do i have to put the pics in a folder call “container”. I have yet to get the script to work. more explaination is needed… thanks…

---

<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:** [November 14, 2003, 5:14pm UTC](https://forum.kirupa.com/t/random-loader-in-flash-5/35312/4 "2003-11-14T17:14:35Z")

</div>

ok well

container = a blank movie clip used to hold our image, meaning a target for our image to load.

create a new symbol and give it an instance name container. then drag it onto your stage where you’d like your images to load.

in this case you would put your images in the same folder as your swf.

i can’t attach a FLA for you, you woun’t be able to open it up with flash 5.

---

<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:** [November 14, 2003, 6:27pm UTC](https://forum.kirupa.com/t/random-loader-in-flash-5/35312/5 "2003-11-14T18:27:23Z")

</div>

thanks for your help. I have another problem also. i am trying to re-create this effect so i can learn flash… the website is [www.dnastudio.com](http://www.dnastudio.com) the banner interests me on this website. I create a MC using mask that tween the random image MC off of the screen… so step one is done… now i am having a hard time making it loop without it going to a white screen or loading a new image… i can not get a smooth transition from one image to the next… if u could help me that would be great… i am losing my mind… please help… and thanks again for your help…

---

<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:** [November 14, 2003, 6:45pm UTC](https://forum.kirupa.com/t/random-loader-in-flash-5/35312/6 "2003-11-14T18:45:36Z")

</div>

ok your best bet is to post your fla, i really can’t tell you eactly what is wrong without seeing it. most likely you’ll just need to replay the movie.

---

<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:** [November 14, 2003, 6:54pm UTC](https://forum.kirupa.com/t/random-loader-in-flash-5/35312/7 "2003-11-14T18:54:58Z")

</div>

Here you go, I would like it to loop infinitely… I have tried everything I can think of. I hope u can help. Thanks
