SWF inside another SWF

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!

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

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’.

Man you are a genious.