# Audio from unloaded swf keeps playing

**URL:** https://forum.kirupa.com/t/audio-from-unloaded-swf-keeps-playing/289281
**Category:** Uncategorized
**Created:** [May 28, 2009, 1:01pm UTC](https://forum.kirupa.com/t/audio-from-unloaded-swf-keeps-playing/289281 "2009-05-28T13:01:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bhnh](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@bhnh](https://forum.kirupa.com/u/bhnh)
#### Post date: [May 28, 2009, 1:01pm UTC](https://forum.kirupa.com/t/audio-from-unloaded-swf-keeps-playing/289281/1 "2009-05-28T13:01:24Z")

</div>

I’m trying to load a successive series of swf, each containing audio, into a loader. As each ends, it’s unloaded and the next one loads. I’m using the following code:

```auto
var ldr:Loader = new Loader();
var c:int = 0;
var clips:Array = new Array("dmt1.swf","dmt2.swf","dmt3.swf","dmt4.swf")
addChild(ldr);
ldr.load(new URLRequest(clips[0]));
addEventListener(Event.ENTER_FRAME, loading);
function loading(e:Event){
 if((MovieClip(ldr.content) != null)&&(c < 4)){
  if(MovieClip(ldr.content).currentFrame == MovieClip(ldr.content).totalFrames){
   ldr.unload();
   removeChild(ldr);
   ldr = null;
   /c ++;
   ldr.load(new URLRequest(clips[c]));
  }
 }
}

```

Each swf loads just fine, but the audio from the previously loaded swf start playing again, so there’s a layered audio mishmash. What am I doing wrong here??

Many thanks!
