# AAARGH! Loading RANDOM flash movies INTO movie?

**URL:** <https://forum.kirupa.com/t/aaargh-loading-random-flash-movies-into-movie/19341>\
**Category:** Uncategorized\
**Created:** [April 26, 2003, 11:12pm UTC](https://forum.kirupa.com/t/aaargh-loading-random-flash-movies-into-movie/19341 "2003-04-26T23:12:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajreynol](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@ajreynol](https://forum.kirupa.com/u/ajreynol)\
**Post date:** [April 26, 2003, 11:12pm UTC](https://forum.kirupa.com/t/aaargh-loading-random-flash-movies-into-movie/19341/1 "2003-04-26T23:12:34Z")

</div>

Ok guys…here’s one with a (hopefully) obvious solution. I have a flash movie that loads one of 27 flash movies randomly into the main movie via a container called “nsbe” using this action script:

* * *

## i = random(27)+1; loadMovie(“nsbe”+i+".swf", “nsbe”);

Simple, right? Works like a breeze when i publish in flash 5 or 6…but I would like to go lower…to flash 4. And when I do, I get this error message

* * *

## Error opening URL “file:///D|/My%20Webs/NSBE%20Region%204/11”

Essentially, Flash 4 seems to only recognize the randomly generated number, totally forgetting about the “nsbe\_\_.swf” (in the above case, number “11”)!

I tested just loading one specified movie and that worked in Flash 4…but the random thing just isn’t cooperating, so i’m confident the cluprit is the “loadMovie” command. I’ve tried messing with the script more, but no good.

Is there a better code to use that will make this thing load my random movies in Flash 4? Is there something really basic i’m missing?

Thanks in advance, guys!

Adrian J.

---

<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:** [April 27, 2003, 1:24am UTC](https://forum.kirupa.com/t/aaargh-loading-random-flash-movies-into-movie/19341/2 "2003-04-27T01:24:49Z")

</div>

In Flash 4 you were only able to use “+” to add numbers, not strings. You will probably have to use “add” to concatenate your string.  
[AS]i = random (27) + 1;  
loadMovie (“nsbe” add i add “.swf”, “nsbe”);[/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:** [April 27, 2003, 5:37am UTC](https://forum.kirupa.com/t/aaargh-loading-random-flash-movies-into-movie/19341/3 "2003-04-27T05:37:18Z")

</div>

It worked! Thank you so much…you saved me a lot of time.

Adrian J.
