Jump to content
Search Community

XMLLoader is failing

mrkos67
Moderator Tag

Recommended Posts

Posted

What would cause an XMLLoader to fail? This just started happening the other day, whereas before it was working perfect. When I started getting this error, I added all the other event listeners to see if anything else was going on, but the only events that fire are the OPEN, an HTTPStatus, and then the FAIL, as indicated by the output below.

 

Code to load the XML

var xmlLoader:XMLLoader = new XMLLoader( $url, {} );
xmlLoader.addEventListener( LoaderEvent.OPEN, onOpen_xml, false, 0, true );
xmlLoader.addEventListener( LoaderEvent.COMPLETE, onComplete_xml, false, 0, true );
xmlLoader.addEventListener( LoaderEvent.FAIL, onFail_xml, false, 0, true );
xmlLoader.addEventListener( LoaderEvent.ERROR, onError_xml, false, 0, true );
xmlLoader.addEventListener( LoaderEvent.IO_ERROR, onIOError_xml, false, 0, true );
xmlLoader.addEventListener( LoaderEvent.HTTP_STATUS, onHTTPStatus_xml, false, 0, true );
xmlLoader.addEventListener( LoaderEvent.SECURITY_ERROR, onSecurityError_xml, false, 0, true );
xmlLoader.addEventListener( LoaderEvent.UNCAUGHT_ERROR, onUncaughtError_xml, false, 0, true );
xmlLoader.load();
 

protected function onOpen_xml( evt:LoaderEvent ):void { _log.log( "AudioRecorderApp :: onOpen_xml()" ); }
protected function onError_xml( evt:LoaderEvent ):void { _log.log( "AudioRecorderApp :: onError_xml()" ); }
protected function onIOError_xml( evt:LoaderEvent ):void { _log.log( "AudioRecorderApp :: onIOError_xml()" ); }
protected function onHTTPStatus_xml( evt:LoaderEvent ):void { _log.log( "AudioRecorderApp :: onHTTPStatus_xml() - data:" +evt.data ); }
protected function onFail_settings( evt:LoaderEvent ):void { _log.log( "AudioRecorderApp :: onFail_xml() - data:" + evt.data );
protected function onUncaughtError_xml( evt:LoaderEvent ):void { _log.log( "AudioRecorderApp :: onUncaughtError_xml()" ); }
protected function onSecurityError_xml( evt:LoaderEvent ):void { _log.log( "AudioRecorderApp :: onSecurityError_xml()" ); }
protected function onComplete_settings( evt:LoaderEvent ):void { _log.log( "AudioRecorderApp :: onComplete_xml()" ); }
 
And the output:

AudioRecorderApp :: onOpen_xml()
AudioRecorderApp :: onHTTPStatus_xml() - data:[HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2 status=200 redirected=false responseURL=null]
AudioRecorderApp :: onFail_xml() - data:null

 
I don't get it. 
Posted

Found it. I didn't realize the LoaderEvent had a "text" property for errors, fails, and such. Using that, it was determined that the fail was being caused by an incorrectly terminated <![CDATA[]]> block in the XML file itself.

  • Like 1
Posted

I was just about to suggestion that you trace the event.text :) You beat me to it. 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...