FLASH与JS的交互[转]

  1. 使用fscommand来调用js函数,并将参数传递给js
  2. 调用的函数的编写规则为:function flashID_DoFSCommand(command, 参数){...}
  3. 让我感到有点奇怪的是,函数的前面还要加上
  4. var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
  5. 函数后面要加上
  6. if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
  7.   navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
  8.   document.write('<SCRIPT LANGUAGE=VBScript\> \n');
  9.   document.write('on error resume next \n');
  10.   document.write('Sub myFlash_FSCommand(ByVal command, ByVal args)\n');
  11.   document.write(' call myFlash_DoFSCommand(command, args)\n');
  12.   document.write('end sub\n');
  13.   document.write('</SCRIPT\> \n');
  14. }

这样才能运行正常,实在百思不得其解……等待js达人解说。。。
转自http://www.17pod.com/user1/17pod/archives/2006/620.html

RSS feed for comments on this post · TrackBack URL

发表评论