【问题标题】:Loading swf in sprite swf does not fit在精灵 swf 中加载 swf 不适合
【发布时间】:2024-06-16 03:40:01
【问题描述】:

我正在将 SWF 加载到从 Sprite 扩展的主类中(使用 FlashBuilder 4.7 和 AIR SDK 3.7 的 ActionScript 项目)。 _appFile 是使用 Flex 4 和 Flex 3.5 SDK 创建的 SWF。什么会扭曲 SWF?如何将 SWF 宽度和高度设置为 100%。

        //load the _appFile
        _fs.open(_appFile,FileMode.READ);
        var ba:ByteArray = new ByteArray();
        _fs.readBytes(ba);
        _fs.close();

        var context:LoaderContext = new LoaderContext();
        context.allowCodeImport = true;
        context.applicationDomain = ApplicationDomain.currentDomain;
        var loader: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

【问题讨论】:

    标签: actionscript-3 apache-flex flex4 flash-builder flex3


    【解决方案1】:

    我改变的阶段有问题:

    stage.align = StageAlign.TOP_LEFT;
    stage.scaleMode = StageScaleMode.NO_SCALE;
    stage.displayState = StageDisplayState.FULL_SCREEN; Now It works
    

    【讨论】: