# as3 loading xml movie inside swf movie

**URL:** <https://forum.kirupa.com/t/as3-loading-xml-movie-inside-swf-movie/328544>\
**Category:** flash\
**Created:** [May 24, 2012, 8:43pm UTC](https://forum.kirupa.com/t/as3-loading-xml-movie-inside-swf-movie/328544 "2012-05-24T20:43:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashman2006](https://avatars.discourse-cdn.com/v4/letter/f/82dd89/32.png) [@flashman2006](https://forum.kirupa.com/u/flashman2006)\
**Post date:** [May 24, 2012, 8:43pm UTC](https://forum.kirupa.com/t/as3-loading-xml-movie-inside-swf-movie/328544/1 "2012-05-24T20:43:48Z")

</div>

i downloaded a ready made as3 xml application which uses xml to load photos and info  
i am trying to load this movie inside my main move but i fail

my main movie is site.swf , i want to load gallery.swf (which uses xml) into sites.swf

when i try to do this i found nothing happened i think it is related to the xml file located inside a folder in the main folder as

site.swf is loading gallery.swf which is inside a folder called gallery which contains also the xml file

i am stuck at this problem for days

this is my code to load the swf file :

```auto
// This is the Loader instance that will load your SWF.var swfLoader:Loader = new Loader(); // URLRequest points to your external SWFvar swfFile:URLRequest = new URLRequest("sites.swf"); //create the container Movie Clip to load swfvar container:MovieClip= new MovieClip(); // Assign an event listener so that Flash informs you when the SWF has been loaded. swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoadedHandler); function swfLoadedHandler(e:Event):void { trace("swf loaded");} swfLoader.load(swfFile); //just add the loaded swf to containercontainer.addChild(swfLoader);//add container to the stage and make it visibleaddChild(container);

```
