0

そんなことがあるものか。HTML埋め込みコストラクタで指定された埋め込み幅と高さよりもどのようにステージを小さくすることができますか?

<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

フラッシュをフルスクリーンにすることが問題である場合は、次のコードを追加するだけです。

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