# SWF inside another SWF

**URL:** <https://forum.kirupa.com/t/swf-inside-another-swf/265674>\
**Category:** flash\
**Created:** [July 11, 2008, 8:22am UTC](https://forum.kirupa.com/t/swf-inside-another-swf/265674 "2008-07-11T08:22:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jtstuedle](https://avatars.discourse-cdn.com/v4/letter/j/e9bcb4/32.png) [@jtstuedle](https://forum.kirupa.com/u/jtstuedle)\
**Post date:** [July 11, 2008, 8:22am UTC](https://forum.kirupa.com/t/swf-inside-another-swf/265674/1 "2008-07-11T08:22:16Z")

</div>

I’m pretty sure this has been covered a million times, but for the life of me, I can’t figure it out! I want to put an external .swf file inside the main page of another flash document…however everything I have read has just confused me! I have mainpage.swf and I want slideshow.swf (it’s a slideshow that loads its images from an xml file), to load within mainpage.swf…anyone point me in the right direction of doing this…I’m terrible with actionscript!

---

<div class="post-metadata">

**Author:** ![DiamondDog](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@DiamondDog](https://forum.kirupa.com/u/DiamondDog)\
**Post date:** [July 11, 2008, 2:39pm UTC](https://forum.kirupa.com/t/swf-inside-another-swf/265674/2 "2008-07-11T14:39:42Z")

</div>

Try putting the following code in frame 1 of your mainpage .fla file:

```auto
import flash.net.URLRequest;

var myrequest:URLRequest = new URLRequest("slideshow.swf");
var myLoader:Loader = new Loader();
myLoader.load(myrequest);
addChild(myLoader);

```

This code assumes that ‘slideshow.swf’ is going to be sitting in the same directory as your ‘mainpage.swf’. If that isn’t the case, you’ll need to add the appropriate path to that reference to ‘slideshow.swf’.

---

<div class="post-metadata">

**Author:** ![jtstuedle](https://avatars.discourse-cdn.com/v4/letter/j/e9bcb4/32.png) [@jtstuedle](https://forum.kirupa.com/u/jtstuedle)\
**Post date:** [July 11, 2008, 4:25pm UTC](https://forum.kirupa.com/t/swf-inside-another-swf/265674/3 "2008-07-11T16:25:29Z")

</div>

Man you are a genious.
