Actionscript 3 - checking for an internet connection
问题 I am using this code in my flash file import air.net.URLMonitor; import flash.net.URLRequest; import flash.events.StatusEvent; var monitor:URLMonitor; function checkInternetConnection(e:Event = null):void { var url:URLRequest = new URLRequest("http://www.google.com"); url.method = "HEAD"; monitor = new URLMonitor(url); monitor.pollInterval = 1000; // monitor.addEventListener(StatusEvent.STATUS, checkHTTP); // function checkHTTP(e:Event = null):void { if (monitor.available) { navigateToURL(new