我的主窗口上有 HTML 控件,如下所示:
<mx:HTML
id="hidHTML"
location="http://localhost/index.html"
enabled="true"
paddingLeft="0"
paddingRight="0"
width="100%" height="100%"/>
index.html 的内容是:
<!DOCTYPE html>
<html>
<head>
<script>
window.runtime.trace("wrong sandbox");
</script>
</head>
<body>
"remote" file
</body>
</html>
打开应用程序让我:
TypeError: Result of expression 'window.runtime' [undefined] is not an object.
将位置更改为“index.html”并在我的应用程序目录中有 index.html(index.html 中的内容相同)让我:
wrong sandbox
显然,当位置设置为应用程序目录以外的其他内容时,AIR 已经改变了沙盒安全性。有趣的是,我在手册中找不到任何关于它的内容:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/HTML.html#location
我也找不到任何可以将沙盒安全设置回应用程序的东西,即 mx:HTML 的任何属性或方法。
有谁知道我如何获得 mx:HTML 的应用程序安全性或找到有关它为什么不在应用程序中运行的文档及其背后的原因?