# Loaded swf

**URL:** https://forum.kirupa.com/t/loaded-swf/252942
**Category:** Uncategorized
**Created:** [February 25, 2008, 7:02pm UTC](https://forum.kirupa.com/t/loaded-swf/252942 "2008-02-25T19:02:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![craig\_clayton](https://avatars.discourse-cdn.com/v4/letter/c/ee59a6/32.png) [@craig\_clayton](https://forum.kirupa.com/u/craig_clayton)
#### Post date: [February 25, 2008, 7:02pm UTC](https://forum.kirupa.com/t/loaded-swf/252942/1 "2008-02-25T19:02:36Z")

</div>

Ok so I have a main.swf that loads in swfs (home.swf, about.swf, etc). When I first load in home.swf and I click about. How do I get that to load in to main.swf. I have looked everywhere for this here is my code:

```auto

var request:URLRequest = new URLRequest("home.swf");
var loader:Loader = new Loader();
var loader_mc:mcLoader = new mcLoader();

addChild(loader_mc);
loader_mc.x = 441.3;
loader_mc.y = 257.8;

loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);

function loadProgress(event:ProgressEvent):void {
    var percentLoaded:Number = event.target.bytesLoaded/event.target.bytesTotal;
    loader_mc.bar_mc.scaleX = percentLoaded;
    loader_mc.myTextField_txt.text = Math.round(percentLoaded*100)+"%"
}

function loadComplete(event:Event):void {
    trace("Complete");    
}

//function loadComplete2(event:Event):void {
// trace("Complete");    
//}

loader.contentLoaderInfo.addEventListener(Event.COMPLETE, alldone);
function alldone(myevent:Event):void {
    addChild(loader);
    removeChild(loader_mc)
}

    
loader.load(request);
addChild(loader);

```

Everything works fine but my main issue is being able to click on a button in the home.swf removing home.swf and loading in the new swf in its place. If anyone can point me in the right direction I would appreciate it I have been looking for weeks now and still cant find anyone running into the same problem. Thanks in advanced.

Craig
