# Loading a xml swf into a swf?

**URL:** https://forum.kirupa.com/t/loading-a-xml-swf-into-a-swf/262709
**Category:** Uncategorized
**Created:** [June 9, 2008, 12:26pm UTC](https://forum.kirupa.com/t/loading-a-xml-swf-into-a-swf/262709 "2008-06-09T12:26:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![wdv](https://avatars.discourse-cdn.com/v4/letter/w/9fc29f/32.png) [@wdv](https://forum.kirupa.com/u/wdv)
#### Post date: [June 9, 2008, 12:26pm UTC](https://forum.kirupa.com/t/loading-a-xml-swf-into-a-swf/262709/1 "2008-06-09T12:26:49Z")

</div>

Hi,  
Im trying to load xml slideshow swf into a swf. My instructions were to use the code below but Im not sure where to put it, and what to action script to assign to the empty movie clip. Pleae helppppfp meeeee!!!

[FONT=Monaco][SIZE=1][FONT=Monaco][SIZE=1][LEFT]function loadingFinished(target:MovieClip):Void {[/LEFT]  
[/SIZE][/FONT][/SIZE][/FONT][FONT=Monaco][SIZE=1][FONT=Monaco][SIZE=1][LEFT]var monoslideshow:Object = new Monoslideshow(target, “monoslideshow.xml”);  
monoslideshow.start(Stage.width, Stage.height, true);  
}  
var listener:Object = new Object();[/LEFT]  
[/SIZE][/FONT][/SIZE][/FONT][FONT=Monaco][SIZE=1][FONT=Monaco][SIZE=1][LEFT]var movieClipLoader:MovieClipLoader = new MovieClipLoader();[/LEFT]  
[/SIZE][/FONT][/SIZE][/FONT][FONT=Monaco][SIZE=1][FONT=Monaco][SIZE=1][LEFT]listener.onLoadInit = loadingFinished;[/LEFT]  
[/SIZE][/FONT][/SIZE][/FONT][FONT=Monaco][SIZE=1][FONT=Monaco][SIZE=1][LEFT]movieClipLoader.addListener(listener);[/LEFT]  
this.createEmptyMovieClip(“holder”, this.getNextHighestDepth(  
[/SIZE][/FONT][/SIZE][/FONT]

---

<div class="post-metadata">

### Author: ![itbkris](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@itbkris](https://forum.kirupa.com/u/itbkris)
#### Post date: [June 9, 2008, 1:33pm UTC](https://forum.kirupa.com/t/loading-a-xml-swf-into-a-swf/262709/2 "2008-06-09T13:33:58Z")

</div>

Use the following code, put it wherever you want the swf to appear at:

[AS]  
var request:URLRequest = new URLRequest(“ADDRESS OF YOUR SWF”);  
var loader:Loader = new Loader();  
loader.load(request);  
loader.contentLoaderInfo.addEventListener( Event.INIT , loaded)

```
    function loaded(event:Event):void {
        var targetLoader:Loader = Loader(event.target.loader);
        targetLoader.x = 0;
        targetLoader.y = 0;
        addChild(targetLoader);
    }

```

[/AS]

You can change the x/y position of the loaded swf as well. Let me know if that wasn’t what you were looking for.

---

<div class="post-metadata">

### Author: ![wdv](https://avatars.discourse-cdn.com/v4/letter/w/9fc29f/32.png) [@wdv](https://forum.kirupa.com/u/wdv)
#### Post date: [June 9, 2008, 1:47pm UTC](https://forum.kirupa.com/t/loading-a-xml-swf-into-a-swf/262709/3 "2008-06-09T13:47:03Z")

</div>

hey itbkris,  
thanks but it didnt work, i have attached the xml slideshow swf and my main swf. Can you please take a look.
