air - 将 Adobe Flex Web 应用程序迁移到 Adobe AIR 包应用程序 - ExternalInterface.call 失败
问题描述
由于对 Adobe Flex 的支持将于 2020 年结束,我们将按照以下步骤将 Adobe Flex Web 应用程序迁移到 Adobe AIR 独立应用程序中 创建证书
./adt -certificate -cn SelfSigned 1024-RSA sampleCert.p12 samplePassword
创建 AIR 应用程序
./adt -package -keystore ./sampleCert.p12 -storetype pkcs12 -target bundle AIRApp.app App-descriptor.xml App.swf
在很多地方,我们都会调用 ExternalInterface,如下所示
ExternalInterface.call("window.location.search.toString");
并抛出异常
at Error$/throwError()
at flash.external::ExternalInterface$/call()```
Is there a way to enable ExternalInterface in Adobe AIR?
解决方案
ExternalInterface 用于在 Flex 应用程序的封闭 HTML 页面中调用 Javascript 函数。ExternalInterface 在 AIR 中不存在,因为它没有封闭的 HTML 页面/Javascript。
您必须检查 Flex 应用程序中的每个 ExternalInterface 调用,并在 AIR 中编写等效的调用。Adobe AIR API 可能有用
推荐阅读
- react-native - 是否有禁用标签栏按钮的选项
- c++ - 在不破坏客户端的情况下修复过载
- python-3.x - 无法使用 Bokeh 和 Python 绘制数据点 - 显示空布局
- html - 屏幕阅读器无法阅读整页
- javascript - 如何控制 v-card 的垂直滚动条?
- selenium - chrome 在 dom 中找不到硒的任何元素
- amazon-web-services - 使用 JupyterNotebook 进行 AWS Congito 身份验证
- pandas - 使用 pandas 运行分析报告时出错,给我一个错误“TypeError: describe_boolean_1d() got an unexpected keyword argument 'title'”
- python - 在父级之外绘制 QGraphicsWidget
- r - Mac上的R Gui应用程序在调用历史记录时添加空行