FLASH与JS的交互[转]
- 使用fscommand来调用js函数,并将参数传递给js
- 调用的函数的编写规则为:function flashID_DoFSCommand(command, 参数){...}
- 让我感到有点奇怪的是,函数的前面还要加上
- var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
- 函数后面要加上
- if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
- navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
- document.write('<SCRIPT LANGUAGE=VBScript\> \n');
- document.write('on error resume next \n');
- document.write('Sub myFlash_FSCommand(ByVal command, ByVal args)\n');
- document.write(' call myFlash_DoFSCommand(command, args)\n');
- document.write('end sub\n');
- document.write('</SCRIPT\> \n');
- }
这样才能运行正常,实在百思不得其解……等待js达人解说。。。
转自http://www.17pod.com/user1/17pod/archives/2006/620.html