# Load and unload external swf files?

**URL:** https://forum.kirupa.com/t/load-and-unload-external-swf-files/323665
**Category:** flash
**Created:** [July 11, 2011, 9:54pm UTC](https://forum.kirupa.com/t/load-and-unload-external-swf-files/323665 "2011-07-11T21:54:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![lazerbrains](https://avatars.discourse-cdn.com/v4/letter/l/b19c9b/32.png) [@lazerbrains](https://forum.kirupa.com/u/lazerbrains)
#### Post date: [July 11, 2011, 9:54pm UTC](https://forum.kirupa.com/t/load-and-unload-external-swf-files/323665/1 "2011-07-11T21:54:11Z")

</div>

I have a site that I am trying to break apart into multiple smaller SWF files for ease of loading. However, I am having a small problem.

I have 3 files: Main.swf, external1.swf, and external2.swf.

Main is the main SWF (obviously), and I have external1.swf loading successfully into it using the following code:

```auto

var external1:Loader = new Loader();  
addChild(external1);  
var url:URLRequest = new URLRequest("external1.swf");  
external1.load(url);

```

It works perfectly. However there is a button inside of “external1.swf” that I need to trigger the next SWF to load. And also unload itself.

Basically when you click the button inside of “external1.swf”, I want “external2.swf” to load and “external1.swf” to unload.

How can I do this from the external SWF, not the Main.swf timeline?
