# Completely removing externally loaded swf's

**URL:** https://forum.kirupa.com/t/completely-removing-externally-loaded-swfs/233255
**Category:** flash
**Created:** [July 22, 2007, 12:21am UTC](https://forum.kirupa.com/t/completely-removing-externally-loaded-swfs/233255 "2007-07-22T00:21:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![lfdesign](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/lfdesign/32/3892_2.png) [@lfdesign](https://forum.kirupa.com/u/lfdesign)
#### Post date: [July 22, 2007, 12:21am UTC](https://forum.kirupa.com/t/completely-removing-externally-loaded-swfs/233255/1 "2007-07-22T00:21:37Z")

</div>

Hi!

I have a new problem in the development of my site…

I have a main swf that loads external swf’s using this code:

```auto
var swfLoader:Loader = new Loader();
swfLoader.load(new URLRequest(swfArr[numArr]));
addChild(swfLoader);

```

Nothing wrong here… Just Checking…

The problem is that in my main swf I have an Event Listener for stage resize… And inside each external swf too… So, when after I’ve loaded a 2nd external swf it’s still listening for the 1st swf event listener!! It throws the error: “TypeError: Error #1009: Cannot access a property or method of a null object reference.”

How can I prevent this from happening??
