Category
show
전체 (775)
웹표준, 웹접근성™ (5)
웹프로그래밍™ (360)
웹기획™ (0)
웹디자인™ (5)
서버™ (32)
데이터베이스™ (43)
개발자료 (9)
트랜드 (60)
Study English (2)
블루비 (70)
오피스 다이어리 (19)
Textcube (2)
이슈 (20)
컴퓨터 악세사리 (18)
엔터테인먼트 (24)
좋은글 (73)
재테크 (1)
이벤트 (4)

Flex3 fullscreen 예제샘플

웹프로그래밍™/Flex,AIR,Flash 2008/08/11 11:19 by 블루비 Total 593 : Today 4 : Yesterday 0

Creating full-screen Flex applications


Source View

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/08/07/creating-full-screen-flex-applications/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" applicationComplete="init(event)">

<mx:Script>
<![CDATA[
import flash.display.StageDisplayState;

private function init(evt:Event):void {
/* Set up full screen handler. */
Application.application.stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullScreenHandler);
dispState = Application.application.stage.displayState;
}

private function fullScreenHandler(evt:FullScreenEvent):void {
dispState = Application.application.stage.displayState + " (fullScreen=" + evt.fullScreen.toString() + ")";
if (evt.fullScreen) {
/* Do something specific here if we switched to full screen mode. */
} else {
/* Do something specific here if we switched to normal mode. */
}
}

private function toggleFullScreen():void {
try {
switch (Application.application.stage.displayState) {
case StageDisplayState.FULL_SCREEN:
/* If already in full screen mode, switch to normal mode. */
Application.application.stage.displayState = StageDisplayState.NORMAL;
break;
default:
/* If not in full screen mode, switch to full screen mode. */
Application.application.stage.displayState = StageDisplayState.FULL_SCREEN;
break;
}
} catch (err:SecurityError) {
// ignore
}
}
]]>
</mx:Script>

<mx:String id="dispState" />

<mx:Label text="width={Application.application.width}" />
<mx:Label text="height={Application.application.height}" />
<mx:Label text="displayState={dispState}" />

<mx:Button label="Toggle fullscreen" click="toggleFullScreen()" />

</mx:Application>



Javascript embed 코드에 빨간색 부분을 추가
AC_FL_RunContent(
"src", "main",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "main",
"quality", "high",
"bgcolor", "#869ca7",
"name", "main",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer",
"allowFullScreen", "true"
);

object, embed 태그사용시 속성에도 빨간색 부분을 추가해준다.
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="main" width="100%" height="100%"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="main.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />

<embed src="main.swf" quality="high" bgcolor="#869ca7"
width="100%" height="100%" name="main" align="middle"
play="true"
loop="false"
quality="high"
allowScriptAccess="sameDomain"
allowFullScreen="true"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>




2008/08/11 11:19 2008/08/11 11:19

TRACKBACK :: http://blueb.net/blog/trackback/1277

Leave a Comment
[로그인][오픈아이디란?]
1  ... 44 45 46 47 48 49 50 51 52  ... 775 

달력

«   2008/11   »
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30