加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

actionscript-3 – Adob??e Air – 检查互联网连接

发布时间:2020-12-15 01:45:01 所属栏目:百科 来源:网络整理
导读:我正在使用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 ai
我正在使用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)
}

缺什么?
谢谢.
乌利

解决方法

你需要添加aircore.swc

转到文件 – > ActionScript设置

在“库路径”选项卡上,单击图标(“添加新路径”),然后单击“Flash”图标(“浏览到SWC”).

然后,您需要浏览到安装Flash CS5的位置,然后转到AIK2.5 / frameworks / libs / air /并选择aircore.swc

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读