博客园  :: 首页  :: 新随笔  :: 订阅 订阅  :: 管理

Flash全屏

Posted on 2010-12-14 15:44  PHP-张工  阅读(747)  评论(0编辑  收藏  举报

Flash全屏时,键盘除了ESC、alt+F4等系统按键外,都会停止响应。但鼠标事件正常!

参考:http://help.adobe.com/zh_CN/ActionScript/3.0_ProgrammingAS3/WS2E9C7F3B-6A7C-4c5d-8ADD-5B23446FBEEB.html

HTML代码:

<!DOCTYPE html>
<html>
	<head>
		<title>全屏</title>
		<style type="text/css">
		html, body, #myContent
		{   
			height:100%;   
		}
		body
		{
			margin:0;
			padding:0;
			overflow:hidden;
		}
		</style>
		<script type="text/javascript" src="swfobject.js"></script>
		<script type="text/javascript">
		function loadFlash()
		{
			var flashvars = {};
			var parames = {
				menu:false,
				quality:"high",
				allowfullscreen:true,
				wmode:"transparent"
			};
			swfobject.embedSWF("screen.swf", "myContent", "100%", "100%", "9.0.0", "expressInstall.swf", flashvars, parames);
		}
		window.moveTo(0,0);
		window.resizeTo(window.screen.availWidth, window.screen.availHeight);
		</script>
	</head>
	<body onload="loadFlash();">
		<div id="myContent">
		
		</div>
	</body>
</html>

实例下载:https://files.cnblogs.com/zjfree/screen.rar

ps:博客园在未登录时,是无法访问 https://files.cnblogs.com/ 的。所以做了是否用户登录判断!判断博客园用户是否登录代码如下:

function checkLogin()
{
	if($('.author').length == 0)
	{
		setTimeout(checkLogin,1000);
	}
	else if($('.author')[0].disabled)
	{
		//登录处理
	}
	else
	{
		//未登录处理
	}
}
checkLogin();