Actionscript 3 Flex试图用另一个SWF替换加载的SWF,即使在卸载第一个SWF之后,也会抛出非法覆盖

Actionscript 3 Flex试图用另一个SWF替换加载的SWF,即使在卸载第一个SWF之后,也会抛出非法覆盖,actionscript-3,apache-flex,Actionscript 3,Apache Flex,如果我一个接一个地加载两个SWF,它会抛出一个错误非法覆盖。第一个swf使用SDK 4.7编译,第二个使用SDK 3.5编译。我尝试分别加载它们,它们都可以工作。但依次删除第一个之后,它会抛出错误#1053:非法覆盖mx.managers.SystemManagerProxy中的activate public function App() { _fs.open(_installerDownloader,FileMode.READ); var ba:Byte

如果我一个接一个地加载两个SWF,它会抛出一个错误非法覆盖。第一个swf使用SDK 4.7编译,第二个使用SDK 3.5编译。我尝试分别加载它们,它们都可以工作。但依次删除第一个之后,它会抛出错误#1053:非法覆盖mx.managers.SystemManagerProxy中的activate

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;
    }
谢谢,
David

对于解决方法,如果使用SWFLoader而不是Loader,loadForCompability设置为true应该可以工作。作为参考,它是一个actionscript项目,主类是一个Sprite。您知道如何添加mx.controls.SWFLoader;到ActionScript项目?