URLLoader IO error
Hi All,
I want to get information about internet connection using flash code. So that i am loading an xml from server onEnterFrame. And if the internet connection is lost then the URLLoader should give an IO error.
To handle the onErnterFrame event i am using the following function :
function onEnterFrameHandler(event:Event):void
{
_connection_Status_XML_Loader = new URLLoader();
_connection_Status_XML_Loader.addEventListener(IOErrorEvent.IO_ERROR, connectionErrorHandler);
_connection_Status_XML_Loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, connectionHttpStatusHandler);
_connection_Status_XML_Loader.addEventListener(Event.COMPLETE,connectionStatusHandler);
var request:URLRequest = new URLRequest(serverPath+"abc.xml"+ "?"+Math.random());
try
{
_connection_Status_XML_Loader.load(request);
}
catch (error:Error)
{
trace("Unable to load requested document");
}
}
Normally, if i run the application in flash player then i will mostly got the message as
"Error opening URL 'http://servername/abc.xml?0.1506041861139238'"
several time becous i am trying to load xml in onEnterFrame. But in between sometime i got error message as :
Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: http://servername/abc.xml?0.2708006724715233
at ConnectionTest/onEnterFrameHandler()
Can anyone guide me ?
Thanks in Advance.
Bharat Patel