# Load xml from serverside script

**URL:** <https://forum.kirupa.com/t/load-xml-from-serverside-script/233206>\
**Category:** Uncategorized\
**Created:** [July 21, 2007, 4:42am UTC](https://forum.kirupa.com/t/load-xml-from-serverside-script/233206 "2007-07-21T04:42:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darcey](https://avatars.discourse-cdn.com/v4/letter/d/9f8e36/32.png) [@Darcey](https://forum.kirupa.com/u/Darcey)\
**Post date:** [July 21, 2007, 4:42am UTC](https://forum.kirupa.com/t/load-xml-from-serverside-script/233206/1 "2007-07-21T04:42:19Z")

</div>

Been having some trouble with the dreaded 2032 error ranging from images to serverside script paths.

For a test brining things outside of my application here is the basics:

I have 3 test urls (which all work in a browser):

1. An image at “[http://127.0.0.1/data/users/22/LRG\_050225G2hw.jpg](http://127.0.0.1/data/users/22/LRG_050225G2hw.jpg)”

2. A dynamic generated XML page: “[http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx?xml=1](http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx?xml=1)”

3. A same page but with parameter functionality removed: “[http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx](http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx)”

**TEST 1: Load the image url from test url no 1**  
[AS]  
var imgUrl:String = “[http://127.0.0.1data/users/22/LRG\_050225G2hw.jpg](http://127.0.0.1data/users/22/LRG_050225G2hw.jpg)”;  
var myImageUrl:URLRequest = new URLRequest(imgUrl);  
var myLoader:URLLoader = new URLLoader(myImageUrl);

myLoader.addEventListener(IOErrorEvent.IO\_ERROR, catchIOError);  
function catchIOError(event:IOErrorEvent){  
trace("Error caught: "+ event.type);  
trace("event: " + event);  
}  
[/AS]

Result: Works fine, as expected

**TEST 2: Load the xml url from test url no 2**  
[AS]  
var myXML:XML = new XML();  
var XML\_URL:String = “[http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx?xml=1](http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx?xml=1)”;  
var myXMLURL:URLRequest = new URLRequest(XML\_URL);  
var myLoader:URLLoader = new URLLoader(myXMLURL);

myLoader.addEventListener(IOErrorEvent.IO\_ERROR, catchIOError);  
function catchIOError(event:IOErrorEvent){  
trace("Error caught: "+ event.type);  
trace("event: " + event);  
}  
[/AS]

Result: ERROR  
Error opening URL ‘[http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx?xml=1](http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx?xml=1)’  
Error caught: ioError  
event: [IOErrorEvent type=“ioError” bubbles=false cancelable=false eventPhase=2 text=“Error #2032: Stream Error. URL: [http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx?xml=1](http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx?xml=1)”]

**TEST 3: Load the xml url from test url no 3**  
[AS]  
var myXML:XML = new XML();  
var XML\_URL:String = “[http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx](http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx)”;  
var myXMLURL:URLRequest = new URLRequest(XML\_URL);  
var myLoader:URLLoader = new URLLoader(myXMLURL);

myLoader.addEventListener(IOErrorEvent.IO\_ERROR, catchIOError);  
function catchIOError(event:IOErrorEvent){  
trace("Error caught: "+ event.type);  
trace("event: " + event);  
}  
[/AS]

Result: ERROR  
Error opening URL ‘[http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx?xml=1](http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx?xml=1)’  
Error caught: ioError  
event: [IOErrorEvent type=“ioError” bubbles=false cancelable=false eventPhase=2 text=“Error #2032: Stream Error. URL: [http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx?xml=1](http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx?xml=1)”]

ALSO TRIED

Tried two more and no joy  
[AS]  
var request:URLRequest = new URLRequest();  
request.url = “[http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx](http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx)”;  
request.method = URLRequestMethod.GET;  
request.data = new URLVariables(“xml=1”);  
var myLoader:URLLoader = new URLLoader(request);  
[/AS]

and

[AS]  
var myXMLURL:URLRequest = new URLRequest(“[http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx](http://127.0.0.1/scripts/GetUserLeadPhotoForFlash.aspx)”);  
myXMLURL.method = URLRequestMethod.POST  
var myLoader:URLLoader = new URLLoader(myXMLURL);

myLoader.addEventListener(Event.COMPLETE, xmlLoaded);  
myLoader.addEventListener(IOErrorEvent.IO\_ERROR, onXmlIOerror);

function xmlLoaded(evt:Event):void{  
trace(“LOADED”);  
}

function onXmlIOerror(event:IOErrorEvent):void{  
trace(“not loaded”);  
}  
[/AS]

No joy…?

Now as far as I know, error #2032 is an incorrect url error, and these urls check out fine in the browser.

Anyone got any suggestions?
