# Loading multiple SWF into a single MC

**URL:** <https://forum.kirupa.com/t/loading-multiple-swf-into-a-single-mc/295507>\
**Category:** Uncategorized\
**Created:** [August 31, 2009, 3:37pm UTC](https://forum.kirupa.com/t/loading-multiple-swf-into-a-single-mc/295507 "2009-08-31T15:37:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stupidwebguy](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@stupidwebguy](https://forum.kirupa.com/u/stupidwebguy)\
**Post date:** [August 31, 2009, 3:37pm UTC](https://forum.kirupa.com/t/loading-multiple-swf-into-a-single-mc/295507/1 "2009-08-31T15:37:24Z")

</div>

Hi

First, I’m new to AS3. Please take pity. Here’s what I’m trying to do:

I have multiple buttons on the stage, each calling a different SWF (that will has a FLV file in it) and trying to load it to a single MC “myLoader”. The idea is that is as you click on each button, it will replace the playing SWF with a new SWF, but instead it seems as if it plays over the SWF (instead of replacing it). The code Im working with:

portBtn1.addEventListener(MouseEvent.MOUSE\_DOWN, newvid1);  
portBtn2.addEventListener(MouseEvent.MOUSE\_DOWN, newvid2);

function newvid1(event:MouseEvent) {  
var loadit = new Loader();  
myLoader.addChild(loadit);  
loadit.load(new URLRequest(“port1.swf”));  
}

function newvid2(event:MouseEvent) {  
var loadit = new Loader();  
myLoader.addChild(loadit);  
loadit.load(new URLRequest(“port2.swf”));  
}

Do I need to unload the MC? Any insight is appreciated.

Thanks!
