這怎麼可能。如何在HTML嵌入式構造器中提供嵌入寬度和高度的階段?Actionscript:舞臺寬度小於提供的嵌入大小和StageVideo.videoWidth
<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>
的Actionscript部分:
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
如何使舞臺全屏?
我失蹤了什麼?
終於!我想聽到的。謝謝! :) 昨天發生了什麼現在是有意義的。 – Somebody 2013-03-09 10:35:44
最後一個問題。爲什麼stage.stageWidth是570,而不是__constructor中的640。在哪裏我可以安全地開始採摘實際的stage.stageWidth,並確保它與我在嵌入容器中提供的相同? – Somebody 2013-03-09 15:04:06
這可能是你的瑞士法郎是570寬。通常情況下,最好是swf與顯示的尺寸相同(如本例中嵌入所指定的那樣),但如果這不是一個選項,則可以設置stage.scaleMode = StageScaleMode.NO_SCALE和stage.stageWidth應該在構造函數中是640。您可能還需要設置stage.align = StageAlign.TOP_LEFT,以使事情正確對齊。 – 2013-03-09 17:02:13