0

这怎么可能。如何在 html embed costructor 中小于提供的嵌入宽度和高度?

<script type="text/javascript">
    // For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. 
    var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
    // To use express install, set to playerProductInstall.swf, otherwise the empty string. 
    var xiSwfUrlStr = "${expressInstallSwf}";
    var attributes = {};
    attributes.id = "${application}";
    attributes.name = "${application}";
    attributes.align = "middle";
    swfobject.embedSWF(
        "${swf}.swf", "flashContent"
        ,"640", "360"
        ,swfVersionStr
        ,xiSwfUrlStr
        // flashvars
        ,{}
        // Params
        ,{
            wmode:'direct'
            ,quality:'high'
            ,bgcolor:'#ffffff'
            ,allowscriptaccess:'always'
            ,allowfullscreen:'true'
            ,allownetworking:'all'
        }
        ,attributes
    );
</script>

动作脚本部分:

stage.addEventListener(Event.ENTER_FRAME, onFrame);
private function onFrame(event:Event):void 
{
    log('stage width,height',stage.width,stage.height,sv.videoWidth,sv.videoHeight);
}

输出:

stage width,height 320 276 720 404

如何让舞台全屏?

我错过了什么?

4

2 回答 2

1

对于嵌入中设置的尺寸,您需要stage.stageWidth和 stage.stageHeight。

对于所有 DisplayObject,.width 和 .height 表示内容的大小。因此,无论在嵌入代码中给出的 Flash Player 的大小如何,一个空的舞台的宽度和高度都为零。

换句话说,stage.stageWidth是 Flash Playerstage.width的宽度,而是添加到舞台上的东西的宽度。

于 2013-03-09T10:15:33.310 回答
0

如果您的问题是关于使您的 Flash 全屏显示,那么只需添加以下代码:

stage.displayState=StageDisplayState.FULL_SCREEN;
于 2013-03-09T09:15:23.317 回答