1. 程式人生 > >Flex4 AIR載入時全屏顯示

Flex4 AIR載入時全屏顯示

 

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx"
       creationComplete="callLater(fullScreen)">

 <fx:Declarations>
  <!-- 將非可視元素(例如服務、值物件)放在此處 -->
 </fx:Declarations>
 <fx:Script>
  <![CDATA[
   private function fullScreen():void{
    stage.displayState = StageDisplayState.FULL_SCREEN;
   }
   
  ]]>
 </fx:Script>
 
 <fx:Declarations>
  <!-- 將非可視元素(例如服務、值物件)放在此處 -->
 </fx:Declarations>
</s:WindowedApplication>

方法二:

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx"
        showStatusBar="false"
        applicationComplete="Full1()">
 <fx:Script>
  <![CDATA[
  import flash.display.*;
  
  private function Full1():void
  {
  stage.displayState = StageDisplayState.FULL_SCREEN  
  }
  ]]>
 </fx:Script>
</s:WindowedApplication>