# Loading multiple swfs using XML

**URL:** https://forum.kirupa.com/t/loading-multiple-swfs-using-xml/309777
**Category:** Uncategorized
**Created:** [May 24, 2010, 8:04pm UTC](https://forum.kirupa.com/t/loading-multiple-swfs-using-xml/309777 "2010-05-24T20:04:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![danny\_brooks](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@danny\_brooks](https://forum.kirupa.com/u/danny_brooks)
#### Post date: [May 24, 2010, 8:04pm UTC](https://forum.kirupa.com/t/loading-multiple-swfs-using-xml/309777/1 "2010-05-24T20:04:51Z")

</div>

I have been searching and experimenting with few tutorials on this. i have so far manged to read my xml correctly and trace all the values. however i am now trying to load my SWF files but seem to be having problems. i am quite new to this so sorry if this is easy and i am just being daft.

i know i am missing something as the AS i have doesnt have anything to identify which node i want to load. any help would be great thanks

my AS so far is this:

var myXML:XML = new XML();  
myXML.ignoreWhite = true;  
myXML.load(“myXML.xml”);  
myXML.onLoad = function(success) {  
if (success) {  
var mySWF = myXML.firstChild.childNodes;  
for (i=0; i\<mySWF.length; i++) {  
var slideNumber = i+1;  
var slideName = mySWF\*.attributes.name;  
var slideURL = mySWF\*.firstChild.nodeValue;  
trace (slideNumber + " " + slideName + " " + slideURL)  
createContainer();  
}  
}  
};

function createContainer() {  
\_root.createEmptyMovieClip(“myContainer\_mc”,\_root.getNextHighestDepth());

myContainer\_mc.loadMovie(slideURL);  
}

\*\*\*slideURL is going to load an swt and then need a next button to load the next and so on

XML format is this if it helps:

\<gallery\>  
\<slide name=“Introduction”\>introduction.swf\</slide\>  
\<slide name=“About Us”\>About\_Us.swf\</slide\>  
\<slide name=“Overview”\>Overview.swf\</slide\>  
\</gallery\>
