# Loading pictures internally (ranom)

**URL:** <https://forum.kirupa.com/t/loading-pictures-internally-ranom/21782>\
**Category:** Uncategorized\
**Created:** [May 26, 2003, 9:22am UTC](https://forum.kirupa.com/t/loading-pictures-internally-ranom/21782 "2003-05-26T09:22:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nasu](https://avatars.discourse-cdn.com/v4/letter/n/e9bcb4/32.png) [@nasu](https://forum.kirupa.com/u/nasu)\
**Post date:** [May 26, 2003, 9:22am UTC](https://forum.kirupa.com/t/loading-pictures-internally-ranom/21782/1 "2003-05-26T09:22:22Z")

</div>

Hi,

I got 4 different pictures that I’d like to load randomly. The thing is that I don’t want to load the picture from an external .swf file. I’d rather load them inside the same .swf document that I’m working on.

---

<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:** [May 26, 2003, 4:01pm UTC](https://forum.kirupa.com/t/loading-pictures-internally-ranom/21782/2 "2003-05-26T16:01:19Z")

</div>

Put your clips in the library, give them linkage name, then set up an array and randomly attach one of the clips:

```auto
myClips = ["clip1","clip2","clip3"]; //linkage names
index = random(myClips.length);
this.attachMovie(myClips[index],"cl",0);

```

Something like that.
