0

我正在加载一个外部 SWF 文件并在我的 Flex4.6 中使用 ApplicationDomain.getdefination("Slide1") 使用 AIR 3.2 for iOS 来获取其中的嵌入内容。

当我在调试模式(快速)下编译时它工作正常,但在发布模式(标准)下编译时在 iPad 上给出 Ref Error 1065(参见下面的错误行*)。

任何帮助/建议表示赞赏。

我的 actionscript 类中的示例代码如下所示:-

var request:URLRequest;
request = new URLRequest(strSwfPath);
var rslLoader:Loader = new Loader();
var appDom:ApplicationDomain = new ApplicationDomain( ApplicationDomain.currentDomain );
var loaderContext:LoaderContext = new LoaderContext(false,appDom);
loaderContext.allowLoadBytesCodeExecution = true;
rslLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadSwfCompleteHandler, false, 0, true);
rslLoader.load(request, loaderContext);

//--
private var loadedAppDomain:ApplicationDomain;
public var embedClass:Class;
//--

private function loadSwfCompleteHandler(event:Event):void 
{
     loadedAppDomain = rslLoader.contentLoaderInfo.applicationDomain;
     embedClass = loadedAppDomain.getDefinition(slideName) as Class; // >>>>>>>>>>>>>>>>>>>>>>> *Error Line.
}

//--------------------- The code inside my external SWF looks like:-
package 

{
    import flash.display.Sprite;
    import flashx.textLayout.compose.ISWFContext;
    public class Slide1 extends Sprite implements ISWFContext  {

        [Embed("slide1/sldBg1.png", mimeType="image/png")]
        public static const bg:Class;
        public function callInContext(fn:Function, thisArg:Object, argsArray:Array, returns:Boolean=true):*{
             if (returns)
                     return fn.apply(thisArg, argsArray);
             fn.apply(thisArg, argsArray);
         }
    }
}
4

1 回答 1

2

iOS App Store 协议存在关于运行时代码的问题;所以这行不通。

Adobe 有一种变通方法可以使这项工作发挥作用。它是在 AIR 3.6 中引入的;所以你将不得不升级你的 AIR SDK。

于 2013-07-03T16:22:33.140 回答