Flash 和Js通信 null为空或不是对象
来源:互联网 发布:淘宝投诉客服电话 编辑:程序博客网 时间:2024/04/29 20:09
在IE下,一点Flash中调用JS函数的按钮就出JS错误“'null' 为空或不是对象”,查看关于ExternalInterface的帮助,提到一点是:
注意:在将 SWF 文件嵌入到 HTML 页中时,请确保<object>
和 <embed>
标签的 id
和 name
属性不包括诸如以下的字符: (句点)、-、+、*、/ 和 \。
既然提到id和name和属性不得包含特 殊符号,是不是在调用ExternalInterface时,id属性也是是必不可少的。加上 id,问题迎刃而解~
举例:
点击Flash的时候就执行GetJS方法
function GetJS(evt:MouseEvent):void //控制刷新按钮F5不可用
{
if(ExternalInterface.available) {
ExternalInterface.call("sayHello"); //getFocus是Main.html中的js方法
}
}
stage.addEventListener(MouseEvent.CLICK,GetJS);
//js方法:
function sayHello()
{
alert("Hello!");
}
- Flash 和Js通信 null为空或不是对象
- js(jquery)出错: 'null' 为空或不是对象
- jquery null为空或不是对象
- 消息:'null'为空或不是对象
- 消息: 'null' 为空或不是对象
- js报为空或不是对象
- js为空或不是对象解决方法
- JS中“null'document.getElementById为空或不是对象” 的解决办法
- JS中“null'document.getElementById为空或不是对象” 的解决办法
- ie无法识别jquery,‘null’为空或不是对象;js加载顺序问题
- 出现JS错误提示null为空或不是对象的错误
- JS 报对象为空或不是对象 (转载)
- JS Error:'document.form.name' 为空或不是对象
- window.external为空或不是对象
- undefined为空或不是对象
- document.getElementById(...)' 为空或不是对象
- 解决“options为空或不是对象”
- 提示:id为空或不是对象
- ORACLE日期时间函数大全
- Sobel operator
- 详析:谷歌为何紧急封杀阿里云OS?
- OpenWrt取消strip的方法
- 串口通讯基础及S3C2410 UART控制器(2)
- Flash 和Js通信 null为空或不是对象
- 串口通讯基础及S3C2410 UART控制器(1)
- 关于 端口映射
- a different object with the same identifier value was already associated with the session错误
- D3D中的矩阵
- hdu 1005 矩阵相乘求解
- 分页代码
- makefile(二)
- 使用ifstream和getline读取文件内容 c++