Reputation: 2285
I want to check network and Internet availability in Action Script programming language. please help me.
Upvotes: 1
Views: 169
Reputation: 2590
var request : URLRequest = new URLRequest ( YOUR URL HERE );
var loader : URLLoader = new URLLoader ();
loader.addEventListener( Event.COMPLETE, handleLoaderComplete );
loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, ldrStatus);
loader.load ( request );
protected function ldrStatus(evt:HTTPStatusEvent):void
{
trace(evt.status)
}
protected function handleLoaderComplete(event:Event):void
{
trace("COMPLETE");
}
try above code, evt.status should give 200, in success.
Upvotes: 1