これは、ボタンをステージに追加するための私のコードです
private function add_fullScreenBtn(height:Number):void
{
button_fullScr = new Sprite();
button_fullScr.useHandCursor = true;
button_fullScr.buttonMode = true;
button_fullScr.mouseChildren = false;
button_fullScr.x = height;
button_fullScr.y = btn_y;
var fullScr_Btn:Bitmap = new fullScreenImage();
button_fullScr.addChild(fullScr_Btn);
button_fullScr.addEventListener(MouseEvent.CLICK, fullScreenHandler);
addChild(button_fullScr);
}
これは、ユーザーがフルスクリーン ボタンをクリックしたときにイベントを処理するためのコードです。
private function fullScreenHandler(event:MouseEvent):void
{
trace("Here");
// stage.displayState = StageDisplayState.FULL_SCREEN
if (this.stage.displayState== StageDisplayState.NORMAL) {
//stage.displayState="fullScreen";
this.stage.displayState=StageDisplayState.FULL_SCREEN_INTERACTIVE;
stage.scaleMode = StageScaleMode.NO_SCALE;
} else {
//stage.displayState="normal";
this.stage.displayState=StageDisplayState.NORMAL;
}
}
これはhtmlページのコードです
<html>
<head>This is the Test Page
</head>
<body>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://.../swflash.cab#version=9,0,0,0"
width="550" height="400" id="sample" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name="movie" value="sample.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#333333" />
<embed src="sample.swf" quality="high" bgcolor="#333333"
width="550" height="400"
name="sample" align="middle"
allowscriptaccess="sameDomain"
type="application/x-shockwave-flash"
allowFullScreen="true"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</embed>
</object>
</body>
</html>
このページを実行しているときに、フル スクリーン モードが許可されていないというエラーが表示されます。セキュリティ例外。コンソールでトレースすると、「ここに」印刷されます
誰でもエラーを解決する方法を提案できますか