Specific external swf question

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 {
var pMain:Loader = new Loader();
var url:URLRequest = new URLRequest(“portfolio.swf”);