SWFSizeで画面サイズに合わせてスクロールを出す

swfsize

フルスクリーンだけど
解像度の低いユーザーにも配慮したサイトを作る場合
デザインを解像度の低いユーザーに合わせて作る事になったり面倒なことが出てきます。

しかし、そういったことを回避できる便利ライブラリがあるんですね。

SWFSize

http://www.libspark.org/wiki/SWFSize

指定サイズ以下のブラウザサイズの場合にスクロールバーを出してくれ
JavaScriptを別個に読み込む必要もなく、使い方もいたって簡単。

//インポート
import org.libspark.ui.SWFSize;
 
// 最小画面サイズの指定
SWFSize.initialize(800, 600);

Flash Developerを救うライブラリです。

 

[サンプル] 別windowで開きます。
[SWFObject2.2を使った場合のhtmlのテンプレート]

 

	<html xmlns="http://www.w3.org/1999/xhtml" lang="jp" xml:lang="jp">
	<head>
		<title>wszz</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 = {};
			var attributes = {};
			attributes.id = "flcont";
			attributes.name = "flcont";
			swfobject.embedSWF("index.swf", "myAlternativeContent", "100%", "100%", "10.0.0", "expressInstall.swf", flashvars, params, attributes);
		</script>
		<style>
			html, body { height:100%; }
			body { margin:0; }
		</style>
	</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>

 

Filed under AS3 · Tagged with ,

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

You must be logged in to post a comment.