ActionScript 3 全屏使用ActionScript 3
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ActionScript 3 全屏使用ActionScript 3相关的知识,希望对你有一定的参考价值。
<!-- HTML -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var flashvars = {};
var params = {};
params.allowfullscreen = "true";
var attributes = {};
swfobject.embedSWF("untitled.swf", "myAlternativeContent", "800", "600", "9.0.0", false, flashvars, params, attributes);
</script>
</head>
<body>
<div id="myAlternativeContent">
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
</div>
</body>
</html>
//AC3:
import flash.display.StageDisplayState;
function goFullScreen():void{
if (stage.displayState == StageDisplayState.NORMAL){
stage.displayState=StageDisplayState.FULL_SCREEN;
}
else {
stage.displayState=StageDisplayState.NORMAL;
}
}
stage.addEventListener(MouseEvent.CLICK, _handleClick)
function _handleClick(event:MouseEvent):void{
goFullScreen();
}
以上是关于ActionScript 3 全屏使用ActionScript 3的主要内容,如果未能解决你的问题,请参考以下文章
ActionScript 3 全屏as3
ActionScript 3 在全屏退出事件
ActionScript 3 全屏图像调整大小(按比例)
Actionscript 3全屏切换
ActionScript 3 测试Action Script中是否存在类方法
Action Script 3. 如何播放一次动画?