# Loading random swf into movieclip

**URL:** <https://forum.kirupa.com/t/loading-random-swf-into-movieclip/230315>\
**Category:** flash\
**Created:** [June 25, 2007, 10:25am UTC](https://forum.kirupa.com/t/loading-random-swf-into-movieclip/230315 "2007-06-25T10:25:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zanga7](https://avatars.discourse-cdn.com/v4/letter/z/90ced4/32.png) [@zanga7](https://forum.kirupa.com/u/zanga7)\
**Post date:** [June 25, 2007, 10:25am UTC](https://forum.kirupa.com/t/loading-random-swf-into-movieclip/230315/1 "2007-06-25T10:25:12Z")

</div>

ok, let me start by saying I’m very new to AS3, and little confused as its sooooo different to AS2. So please go easy 🙂 I used to be able to do everything in Flash MX so easy now with new CS3, I feel like a retard!

Ok, All I am trying to load a bunch of random swf’s into a movieclip. This is an example of what I would have used in the past with AS2. What would I do now for AS3.

filename = [“1.swf”, “2.swf”, “3.swf”];  
path = [http://www.domain.com/swfs/banners;](http://www.domain.com/swfs/banners;)  
i = filename.length;  
k = Math.floor(Math.random()\*i);  
loadMovie(path+filename[k], placerMC);

Any hints?
