AIR and Network Detection

We can detetct the network in AIR using following code ::

Need to use ‘ServiceMonitorShim’ complied clip from AIR components in your fla file.

import air.net.URLMonitor;
import flash.net.URLRequest;
import flash.events.StatusEvent;
var monitor:URLMonitor;
monitor = new URLMonitor(new URLRequest(‘http://192.168.0.57’));
monitor.addEventListener(StatusEvent.STATUS, announceStatus);
monitor.start();
function announceStatus(e:StatusEvent):void
{
         trace(“Status change. Current status: ” + monitor.available);
}