Flex/__Flex 3.0

fullscreen

javamix 2008. 7. 1. 14:39

index.html

  //창틀없는 풀스크린

  function resize(){

   window.open("Eis_Main.html","","fullscreen");    

  //창틀없이 풀스크린으로 뜬다. 호출하는 URL이 IP주소일때는 창틀과 제목표시줄 상태표시줄이 생긴다.


   window.opener=self;         //창을 닫을 때 명령 프롬프트가 뜨지않기 위해 넣어줘야한다.
   window.close();  
  
  }


  //창틀있는 풀스크린

  function resize(){
   var width, height;

   width = screen.width;       //화면의 가로폭
   height= screen.height;      //화면의 세로폭


   window.open("Eis_Main.html","","titlebar=yes,status=no,menubar=no,resizable=yes,scrollbars=no,top=0,left=0,width="+width+",height="+height);  
   
   window.opener=self;
   window.close();
  
  }


해당 파일을 호출하여 풀스크린 팝업을 띄우고 자신은 닫히는 예제 해당 파일 onLoad시 실행



======================================================================================================================

Flex2.0 버전 FullScreen

FullScreenTest.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    backgroundGradientColors="[#8080ff, #400040]">
   
    <mx:Script>
        <![CDATA[
        import flash.display.StageDisplayState;

        private function toggle():void{
            if(fs.selected == true){
                this.goFullScreen();
            } else {
                this.exitFullScreen();
            }
        }
       


       /* StagetDisplay의 모드는 FULL_SCREEN, NORMAL 두가지가 존재 */
        private function goFullScreen():void {
               stage.displayState = StageDisplayState.FULL_SCREEN;      
        }
        private function exitFullScreen():void {
               stage.displayState = StageDisplayState.NORMAL;
        }
        ]]>
    </mx:Script>
   
    <mx:Panel width="100%" height="100%" title="Very Basic Full Screen Sample"
 layout="absolute">
        <mx:CheckBox label="Full Screen" id="fs" click="this.toggle()"
     horizontalCenter="0" verticalCenter="0"/>
    </mx:Panel>
</mx:Application>



Flex에서 풀스크린을 사용하기 위해서는 swf를 Embed 시킬때 줘야되는 옵션이 있다.

그러기 위해서 index.template.html 파일을 수정해준다.

 AC_FL_RunContent(
.........

.........
  "allowScriptAccess","sameDomain",
  "allowFullScreen","true",       //추가부분
  "type", "application/x-shockwave-flash",

........

........

  }

.......

.......

......

 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
   id="${application}" width="${width}" height="${height}"
   codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
   .........
   <param name="allowScriptAccess" value="sameDomain" />
   <param name="allowFullScreen" value="true" />
   <embed src="${swf}.swf" quality="high" bgcolor="${bgcolor}"
    width="${width}" height="${height}" name="${application}" 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>


PS)  Flex 버전에서는 지금 현재 화면이 최초 로딩시 풀스크린은 실행오류가 발생

참조URL:
http://cafe.naver.com/adflex.cafe?iframe_url=/ArticleRead.nhn%3Farticleid=28