我正在尝试使用 AIR3.6 在另一个中加载 swf。我复制了在这里找到的代码http://blogs.adobe.com/airodynamics/2012/11/09/packaging-and-loading-multiple-swfs-in-air-apps-on-ios/但徒劳无功。它不起作用。所以我想我不明白程序的一部分。
那就是我所做的:
• 我有一个可以正确发布到iOS 的第一个fla。
• 在这个 fla 我有这个代码:
var mLoader:Loader = new Loader();
var mRequest:URLRequest = new URLRequest("test.swf");
var _lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
mLoader.load(mRequest);
function onCompleteHandler(loadEvent:Event)
{
addChild(loadEvent.currentTarget.content);
}
• 在发布设置中,我进入了常规选项卡,并包含了我的第二个 swf:test.swf
• 第二个swf (test.swf)。我使用 AIR 3.6 for iOS 发布了它。它根本没有动作脚本。里面只有一个绿色的形状。
• 当我测试我的第一个fla 时,第二个被正确加载。
• 当我在 iPad 上发布它时,第二个 swf 没有加载。
有人可以告诉我哪里错了吗?
谢谢。