问题在AIR应用程序加载嵌入的SWF文件 [英] problems with loading embedded swf files in air app
问题描述
我有我创建了使用Flash CS 5.5中的游戏文件。我还有一个swf文件这是我嵌入到游戏文件提示文件。它工作正常的PC。我有问题,当我试图加载与嵌入的SWF文件的游戏文件。我得到了以下错误: 引发SecurityError:错误#3226:无法导入一个SWF文件时LoaderContext.allow codeImport是假的。谁能告诉我,为什么会出现这种情况?
I have a game file which I create using flash cs 5.5. I have another swf file which is hint file which I embedded in that game file. It works fine in pc. I got problems when I tried to load that game file with embedded swf file. I got the following error: SecurityError: Error #3226: Cannot import a SWF file when LoaderContext.allowCodeImport is false. Can anyone tell me why is this happening ?
推荐答案
我想你是在Android设备上正在与Adobe AIR的移动。在空气中移动,有加载外部SWF文件的额外限制 - 特别是当它们包含字节codeS(动作)。由于辅助SWF文件包含动作code本身,你不能加载到没有明确的安全余量移动AIR应用程序。
I suppose you're working with adobe air for mobile on your android device. In air for mobile, there is extra restrictions on loading external SWF files - especially when they contain byte codes(ActionScript). Because your secondary SWF file is containing actionscript code for itself, you cannot load into your mobile air application without explicit security allowance.
AS3使用装载机
隐含当实例类指的嵌入式SWF文件和它加载使用默认选项 - 它被设置为不同的在空气中移动的运行环境
AS3 uses Loader
implicitly when you instantiate classes refering your embedded SWF files, and it loads with default option - which is set to different in air for mobile runtime environment.
您可以将它们与手动加载,通过创建装载机
和的LoaderContext
实例自己。
You can load them with manual loading, by creating Loader
and LoaderContext
instance by yourself.
var ldr:Loader = new Loader();
var lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
lc.allowCodeImport = true;
ldr.load(new URLRequest("YOUR_FILE_PATH"), lc);
另外请注意,在iOS中,即使允许codeImport
设置为true,则不能加载外部SWF与codeS,以任何方式。
Also note that in iOS, even if allowCodeImport
is set to true, you cannot load external SWF with codes, by any means.
有关更多细节:<一href="http://blogs.adobe.com/airodynamics/2012/11/09/packaging-and-loading-multiple-swfs-in-air-apps-on-ios/" rel="nofollow">http://blogs.adobe.com/airodynamics/2012/11/09/packaging-and-loading-multiple-swfs-in-air-apps-on-ios/
这篇关于问题在AIR应用程序加载嵌入的SWF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!