# Loading XML

**URL:** <https://forum.kirupa.com/t/loading-xml/215599>\
**Category:** Uncategorized\
**Created:** [February 8, 2007, 3:47pm UTC](https://forum.kirupa.com/t/loading-xml/215599 "2007-02-08T15:47:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JayFranchize](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@JayFranchize](https://forum.kirupa.com/u/JayFranchize)\
**Post date:** [February 8, 2007, 3:47pm UTC](https://forum.kirupa.com/t/loading-xml/215599/1 "2007-02-08T15:47:44Z")

</div>

First I’m trying to get this XML file to load, but it’s coming up undefined. Here’s the actionscript:

var MyX:XML=new XML();  
MyX.ignoreWhite=true;

var urls:Array=new Array();  
var captions:Array=new Array();

MyX.onLoad=function(){  
var photos:Array=this.firstChild.childNodes;

```
 for(i=0;i&lt;photos.length;i++){
     urls.push(photos*.attributes.url);
 captions.push(photos*.attributes.caption);

```

}  
}

holder.loadMovie(urls[0]);  
caption.text =captions[0];

MyX.load(“funky.xml”);

Now, here’s the XML file:

\<?xml version=“1.0” encoding=“iso-8859-1”?\>

\<slideshow\>  
\<photo url=“m51.jpg” caption=“M5 power, untouchable” /\>  
\</slideshow\>

I have a movieclip and text field on the stage with the instance names “holder” and “caption” respectively.

I’m using Flash 8, ActionScript 2.0
