我正在使用Adobe Flash CS 5构建Air应用程序.我需要检查是否有可用的Internet连接.
我遇到了这个错误:
1172: DeFinition air.net Could not be found.
1046: Type was not found or was not a compile-time constant: URLMonitor.
这是我的代码:
import air.net.*; 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 = 3000; // monitor.addEventListener(StatusEvent.STATUS,onConnection); // function onConnection(e:Event = null):void { trace("onConnection") } // monitor.start(); trace(monitor) }
缺什么?
谢谢.
乌利