外部 SWF ファイルをロードし、iOS 用 AIR 3.2 を使用して Flex4.6 で ApplicationDomain.getdefination("Slide1") を使用して、その中に埋め込みコンテンツを取得しています。
デバッグ モード (高速) でコンパイルすると問題なく動作しますが、リリース モード (標準) でコンパイルすると、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);
}
}
}