SWFLoader 在 Air 项目中工作,但不在 Web 项目中工作

SWFLoader Working in Air Project but not Web Project

我一直在 Flash builder 中开发一个 Web 类型的 Flex 项目。在这个项目中,我一直在尝试使用 SWFLoader 加载 swf 文件。我在调试器工作时遇到了问题,所以我创建了一个完全相同的 Air 项目,我可以 运行 并使用它进行调试(我使用脚本使它保持最新)。我已经成功地将 swf 文件加载到我的 Air 项目中,没有任何问题。但是,当我在我的 Web 项目中测试它时,SWFLoader 似乎不起作用,我只得到一个空白区域,我的 SWFLoader 元素应该显示加载的 swf 文件。

private function get_swf_file_binary_amf(event:ResultEvent):void {
            Alert.show("SWF Returned");
            var decoder:Base64Decoder=new Base64Decoder();
            decoder.decode(event.result);
            var swf_bytes:ByteArray=decoder.toByteArray();

            var context:LoaderContext=new LoaderContext();
            context.allowLoadBytesCodeExecution=true;
            context.parameters = {myval: "test_string"};

            swf_loaded_file.loaderContext = context;
            swf_loaded_file.addEventListener(Event.COMPLETE, loadComplete);
            swf_loaded_file.load(swf_bytes);
        }

private function loadComplete(completeEvent:Event):void{
    trace("load Complete")
}

以上是在我的 Adob​​e Air 项目中运行的代码。我正在接收我的 swf 文件的二进制数据并将其转换为 ByteArray,而不是像许多示例建议的那样使用 URLLoader。当我在我的 Web 项目中尝试 运行 时,这可能是我出现问题的原因吗?

Edit/Update: 我找到了 Web 项目失败的特定行: context.allowLoadBytesCodeExecution=true;

我仍然不确定为什么我的 Web 项目不喜欢这一行,但我的 Air 项目不关心。

我删除了被诅咒的行:

context.allowLoadBytesCodeExecution=true;

这似乎解决了问题。我什至不太确定这条线的作用,我刚刚从教程中继承了它。摆脱它似乎并没有破坏我的 Air 项目中的任何工作,所以我认为这解决了我的问题。