# Specific external swf question

**URL:** <https://forum.kirupa.com/t/specific-external-swf-question/244616>\
**Category:** flash\
**Created:** [November 20, 2007, 8:05am UTC](https://forum.kirupa.com/t/specific-external-swf-question/244616 "2007-11-20T08:05:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![beet](https://avatars.discourse-cdn.com/v4/letter/b/eada6e/32.png) [@beet](https://forum.kirupa.com/u/beet)\
**Post date:** [November 20, 2007, 8:05am UTC](https://forum.kirupa.com/t/specific-external-swf-question/244616/1 "2007-11-20T08:05:42Z")

</div>

Hello! Having read through lots of threads on a variety of sites I found some script to help me load external swfs into my main document of a website. I’ve since found several other suggested ways of doing this, and so I’m not sure if I’m using the most efficient as. However, my main problem is how to unload an swf, so that when I click on the next button I won’t get several clips overlapping. I’d be really grateful if someone could show me what ‘unLoad’ script to use and where to put it.

thanks in anticipation.

portfolio.addEventListener(MouseEvent.CLICK, clickHandler1);

function clickHandler1(event:MouseEvent):void {  
gotoAndStop(4);  
var pMain:Loader = new Loader();  
addChild(pMain);  
var url:URLRequest = new URLRequest(“portfolio.swf”);  
pMain.load(url);

}
