0

如果我一个接一个地加载两个 swf,它会抛出一个错误非法覆盖。第一个 swf 使用 SDK 4.7 编译,第二个使用 SDK 3.5 编译。我试图单独加载它们并且它们都可以工作。但在删除第一个之后,它会依次抛出错误 #1053:在 mx.managers.SystemManagerProxy 中非法覆盖激活。

public function App()
    {
        _fs.open(_installerDownloader,FileMode.READ);
        var ba:ByteArray = new ByteArray();
        _fs.readBytes(ba);
        _fs.close();

        context = new LoaderContext();
        context.allowCodeImport = true;
        context.applicationDomain = ApplicationDomain.currentDomain;

        loader = new Loader();
        this.addChild(loader); //required so that the loaded SWF has access to the 'stage' property
        loader.loadBytes(ba,context); //run the loaded SWF within the security sandbox of this application
        stage.align = StageAlign.TOP_LEFT;
        stage.scaleMode = StageScaleMode.NO_SCALE;
    }

    public function launchApplication():void
    {   
        loader.addEventListener(Event.REMOVED_FROM_STAGE,launchMC);
        loader.unloadAndStop(true);
        this.removeChild(loader);
    }

    public function launchMC(e:Event):void
    {
        _fs.open(_installer,FileMode.READ);
        var ba:ByteArray = new ByteArray();
        _fs.readBytes(ba);
        _fs.close();            

        context = new LoaderContext();
        context.allowCodeImport = true;
        context.applicationDomain = ApplicationDomain.currentDomain;
        loader = new Loader();
        this.addChild(loader); //required so that the loaded SWF has access to the 'stage' property
        loader.loadBytes(ba,context); //run the loaded SWF within the security sandbox of this application
        stage.align = StageAlign.TOP_LEFT;
        stage.scaleMode = StageScaleMode.NO_SCALE;
    }

谢谢,大卫

4

0 回答 0