Visualizzazione di finestre a schermo intero

Adobe AIR 1.0 e versioni successive

L'impostazione della proprietà displayState dello Stage su StageDisplayState.FULL_SCREEN_INTERACTIVE consente di attivare la modalità a schermo intero della finestra. In questa modalità l'input da tastiera è consentito (nel contenuto SWF eseguito in un browser, l'input da tastiera non è consentito). Per uscire dalla modalità a schermo intero, l'utente deve premere il tasto ESC.

Nota: alcuni gestori di finestre di Linux non modificano le dimensioni della finestra a schermo intero se per la finestra sono impostate le dimensioni massime (viene però rimosso il chrome di sistema della finestra).

Il codice Flex seguente, ad esempio, definisce una semplice applicazione AIR che imposta un semplice terminale a schermo intero:

<?xml version="1.0" encoding="utf-8"?> 
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"  
    layout="vertical"  
    applicationComplete="init()" backgroundColor="0x003030" focusRect="false"> 
    <mx:Script> 
        <![CDATA[ 
            private function init():void  
            { 
                stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE; 
                focusManager.setFocus(terminal); 
                terminal.text = "Welcome to the dumb terminal app. Press the ESC key to exit..\n"; 
                terminal.selectionBeginIndex = terminal.text.length; 
                terminal.selectionEndIndex = terminal.text.length; 
            } 
        ]]> 
    </mx:Script> 
    <mx:TextArea  
        id="terminal"  
        height="100%" width="100%"  
        scroll="false" 
        backgroundColor="0x003030"  
        color="0xCCFF00"  
        fontFamily="Lucida Console"  
        fontSize="44"/> 
</mx:WindowedApplication>

Il codice ActionScript seguente per Flash simula un semplice terminale di testo a schermo intero:

    import flash.display.Sprite; 
    import flash.display.StageDisplayState; 
    import flash.text.TextField; 
    import flash.text.TextFormat; 
     
    public class FullScreenTerminalExample extends Sprite 
    { 
        public function FullScreenTerminalExample():void  
        { 
            var terminal:TextField = new TextField(); 
            terminal.multiline = true; 
            terminal.wordWrap = true; 
            terminal.selectable = true; 
            terminal.background = true; 
            terminal.backgroundColor = 0x00333333; 
             
            this.stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE; 
             
            addChild(terminal); 
            terminal.width = 550; 
            terminal.height = 400; 
             
            terminal.text = "Welcome to the dumb terminal application. Press the ESC key to exit.\n_"; 
             
            var tf:TextFormat = new TextFormat(); 
            tf.font = "Courier New"; 
            tf.color = 0x00CCFF00; 
            tf.size = 12; 
            terminal.setTextFormat(tf); 
             
            terminal.setSelection(terminal.text.length - 1, terminal.text.length); 
        } 
    }