Adobe Air 检测网络是否连通

import air.net.URLMonitor;
import flash.events.StatusEvent;

private var monitor:URLMonitor =new URLMonitor(new URLRequest("http://www.g.cn"));
private function checkNet():void
{
	monitor.addEventListener(StatusEvent.STATUS, showStatus);
	monitor.start();
	trace(monitor.available);
}

private function showStatus(evt:StatusEvent):void
{
	trace(monitor.available);
}

 

你可能感兴趣的:(Adobe,AIR)