ウィンドウサイズ †フルスクリーン表示[ActionScript2.0] †ActionScript? †btn.onRelease = function() { Stage['displayState'] = 'fullScreen'; //Stage['displayState'] = 'normal'; }; //スクリーンモード切替時に呼ばれるリスナー var stageListener:Object = new Object(); stageListener.onFullScreen = function(full:Boolean){ if (full == true) { trace('FullScreen'); } else { trace('Not FullScreen'); } } Stage.addListener(stageListener); HTML †パブリッシュしたHTMLを利用する場合は、<object>タグの<param>タグ、allowFullScreen?のvalueをtrueにする。 <script language="javascript"> if (AC_FL_RunContent == 0) { alert("このページでは \"AC_RunActiveContent.js\" が必要です。"); } else { AC_FL_RunContent( 'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0', 'width', '550', 'height', '400', 'src', 'fullscreen01', 'quality', 'high', 'pluginspage', 'http://www.macromedia.com/go/getflashplayer', 'align', 'middle', 'play', 'true', 'loop', 'true', 'scale', 'showall', 'wmode', 'window', 'devicefont', 'false', 'id', 'fullscreen01', 'bgcolor', '#ffffff', 'name', 'fullscreen01', 'menu', 'true', 'allowFullScreen', 'true', 'allowScriptAccess','sameDomain', 'movie', 'fullscreen01', 'salign', '' ); //end AC code } </script> <noscript> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="550" height="400" id="fullscreen01" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="true" /> <param name="movie" value="fullscreen01.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" /> <embed src="fullscreen01.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="fullscreen01" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> </noscript> 実行結果 †フルスクリーン表示[ActionScript3.0] †ActionScript? †import flash.events.FullScreenEvent; btn.addEventListener(MouseEvent.CLICK,clickHandler); function clickHandler(event:Event) { stage.displayState = StageDisplayState.FULL_SCREEN; //stage.displayState = StageDisplayState.NORMAL; }; //スクリーンモード切替時に呼ばれるリスナー stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullScreenHandler); function fullScreenHandler(event:FullScreenEvent) { trace('event = ' + event); if (event.fullScreen == true) { trace('FullScreen'); } else { trace('Not FullScreen'); } }; HTML †略。 実行結果 †MoviClip?が常に中央配置になるように表示する[ActionScript2.0] †flaファイルの作成 †パブリッシュ設定→HTMLを開く。サイズ項目は、パーセントを選択する。 ActionScript? †//Flashムービーを左上に配置 Stage.align = 'TL'; //伸縮を拡大/縮小なし Stage.scaleMode = 'noScale'; //リスナーに登録 var sizeListener:Object = new Object(); sizeListener.onResize = function() { photo_mc._x = Stage.width/2; photo_mc._y = Stage.height/2; }; //最初に配置を揃える Stage.addListener(sizeListener); HTML †以下のCSSを追記する。 <style type="text/css" media="screen"> html, body { width: 100%; height: 100%; } </style> 実行結果 †参考サイト †Comment †
Counter: 11110,
today: 1,
yesterday: 2
|