# Trouble calling XML from Flash

**URL:** <https://forum.kirupa.com/t/trouble-calling-xml-from-flash/299177>\
**Category:** flash\
**Created:** [October 31, 2009, 3:28am UTC](https://forum.kirupa.com/t/trouble-calling-xml-from-flash/299177 "2009-10-31T03:28:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jumpsuit1](https://avatars.discourse-cdn.com/v4/letter/j/65b543/32.png) [@jumpsuit1](https://forum.kirupa.com/u/jumpsuit1)\
**Post date:** [October 31, 2009, 3:28am UTC](https://forum.kirupa.com/t/trouble-calling-xml-from-flash/299177/1 "2009-10-31T03:28:26Z")

</div>

Does anyone know why the I am receiving the error when I try to load an xml image:

```php
Error opening URL 'file:///Macintosh%20HD/Users/Desktop/Temporary/undefined'

```

I am saving my xml in the same folder as the flash so I don’t think its a directory issue.

This is the code I’m using:

```auto
spacing = 8;
containerMC._alpha = 0;
var pArray = new Array();
var tArray = new Array();
var cur = 0;
MovieClip.prototype.loadPic = function(pic) {
	cur = pic;
	containerMC._alpha = 0;
	this.loadMovie(pArray[pic]);
	this._parent.onEnterFrame = function() {
		var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
		bar._visible = 1;
		per = Math.round((l/t)*100);
		if (t != 0 && Math.round(l/t) == 1 && containerMC._height != 0) {
			var w = containerMC._width+spacing, h = containerMC._height+spacing;
			border.resizeMe(w, h);
			bar._visible = 0;
			picinfo.info.text = tArray[pic];
			delete this.onEnterFrame;
		} else {
			bar._width = per;
			//gives the bar a max width 100 
			picinfo.info.text = per+" % loaded";
		}
	};
};
MovieClip.prototype.resizeMe = function(w, h) {
    var speed = 3;
    this.onEnterFrame = function() {
        this._width += (w-this._width)/speed;
        this._height += (h-this._height)/speed;
// this is where i'm trying to code the repositioning of the caption
		picinfo._y = border._y+244;
		
		picinfo._x = border._x-148;
		if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1) 
//finish
        if (Math.abs(this._width-w)<1) {
            this._width = w;
            this._height = h;
            containerMC._x = this._x-this._width/2+spacing/2;
            containerMC._y = this._y-this._height/2+spacing/2;
            containerMC._alpha += 5;
            if (containerMC._alpha>90) {
                containerMC._alpha = 100;
                delete this.onEnterFrame;
            }
        }
    };
};
var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success) {
	if (success) {
		xmlNode = this.firstChild;
		image = [];
		header = [];
		description = [];
		
		total = xmlNode.childNodes.length;
		for (i=0; i<total; i++) {
			image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
			header* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
			description* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
		}
	} else {
		content = "file not loaded!";
	}
}
gallery_xml.load("gallery.xml");

```

The XML code looks like:

```auto
<images>
    <pic>
		<image>image1.jpg</image>
        <picinfo>JMS Menu Marketing</picinfo>
		<caption>JMS Menu Marketing is a company that works with restaurants to fully get the most out of their menus. 
For the logo, they were looking to emphasize the JMS portion of their name and to show simple
sophistication and professionalism. </caption>
</pic>

```

I’m not an expert on xml and its a code that I’ve assembled from a few different sources, any help would gladly be appreciated.
