Flex / Flash Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: …
When attempting to access a URL via the URLLoader, eg:
{
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.HTTPStatusEvent;
import flash.events.SecurityErrorEvent;
import flash.net.URLLoader;
public class URLErrorHandler
{
private var errorCallback:Function = null;
/*
Specify a callback function on an error if desired. The callback function prototype is
public function onError(event:Event):void
*/
public function URLErrorHandler(loader:URLLoader, onError:Function = null)
{
if (loader == null)
return;
loader.addEventListener ( IOErrorEvent.IO_ERROR, handleIOError );
loader.addEventListener ( HTTPStatusEvent.HTTP_STATUS, handleHttpStatus );
loader.addEventListener ( SecurityErrorEvent.SECURITY_ERROR, handleSecurityError );
//loader.addEventListener ( Event.COMPLETE, handleComplete );
errorCallback = onError;
}
function handleIOError ( event:IOErrorEvent ):void
{
trace ( “Load failed: IO error: ” + event.text );
if (errorCallback != null) errorCallback(event);
}
function handleHttpStatus ( event:HTTPStatusEvent ):void
{
trace ( “Load failed: HTTP Status = ” + event.status );
//if (errorCallback != null) errorCallback(event);
}
function handleSecurityError ( event:SecurityErrorEvent ):void
{
trace ( “Load failed: Security Error: ” + event.text );
//if (errorCallback != null) errorCallback(event);
}
}
}
Filed under: Technology | Tagged: Adobe, Error, Flash, Flex