为什么我收到“外部接口在此容器中不可用”在 Flex 移动项目中?

发布于 2024-12-10 19:37:35 字数 818 浏览 2 评论 0原文

我正在使用 StageWebView 显示本地 HTML 页面(使用 file://)。我想在我的 Flex 移动项目中调用一个由 JS 函数调用的函数。使用ExternalInterface,我

在Flex中 -
ExternalInterface.addCallback("myFunction",myFunc);

在 JS 中 -

    function thisMovie(movieName) {
       if (navigator.appName.indexOf("Microsoft") != -1) {
         return window[movieName];
       } else {
         return document[movieName];
      }
    }

   function showAlert()
   {
    alert("Going to call AS function");
        thisMovie("ShowLocalHTML").myFunction("Hello");
    return false;
   } 

我收到“错误:错误 #2067:ExternalInterface 在此容器中不可用。ExternalInterface 需要 Internet Explorer ActiveX、Firefox、Mozilla 1.7.5 及更高版本,或支持 NPRuntime 的其他浏览器。”当尝试运行应用程序时。

我的项目是针对Android平台的。我的桌面上安装了 Mozilla、Chrome - 尽管我不是与问题相关的用户。

请帮助解决这个问题。

I am using StageWebView to show a local HTML page (using file://). I want to call a function in my flex mobile project to be called from a JS function. Using ExternalInterface, I have

in Flex -
ExternalInterface.addCallback("myFunction",myFunc);

in JS -

    function thisMovie(movieName) {
       if (navigator.appName.indexOf("Microsoft") != -1) {
         return window[movieName];
       } else {
         return document[movieName];
      }
    }

   function showAlert()
   {
    alert("Going to call AS function");
        thisMovie("ShowLocalHTML").myFunction("Hello");
    return false;
   } 

I am getting "Error: Error #2067: The ExternalInterface is not available in this container. ExternalInterface requires Internet Explorer ActiveX, Firefox, Mozilla 1.7.5 and greater, or other browsers that support NPRuntime." when trying to run the application.

And my project targets Android platform. And I have Mozilla, Chrome installed on my desktop - although I am not user if that is relevant to the problem.

Please help in resolving this issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

最美的太阳 2024-12-17 19:37:35

由于我是 Flex 和 AS 的新手,我花了一段时间才理解这个问题。请参阅 http://help.adobe.com/ en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.htmlhttp://sean.voisen.org/blog/2010/ 10/制作最精彩的stagewebview/。这意味着外部接口不可与 AIR for android 中的 StageWebView 一起使用。

Since I am new to Flex and AS it took me a while to understand the problem. See http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html and http://sean.voisen.org/blog/2010/10/making-the-most-of-stagewebview/. What it means is External Interface is not available for use with StageWebView in AIR for android.

你怎么敢 2024-12-17 19:37:35

确实如此,但你仍然可以交流 js <>如果您使用的是 ANE 解决方案,请使用空气。检查这里 https://github.com/myflashlab/webView-ANE 我是顺便说一下这个ANE! :)

True, but you still can communicate js <> air if you are using an ANE solution. Check here https://github.com/myflashlab/webView-ANE I'm the coder of this ANE by the way! :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文