Search

 

October 2006
S M T W T F S
« Sep   Nov »
1234567
891011121314
15161718192021
22232425262728
293031  

Tags

Archives


« | Main | »

Lets Go Full Screen – Sample

By Rich Tretola | October 17, 2006
22,208 views

Let’s go Full Screen with our Flex apps. Thanks to the new Flash Player beta it
is so easy to do.
The following is a very simple sample of going full screen. The only key point to
this is that it must be something that is triggered by user interaction.

YOU CAN NOT FORCE A USER INTO FULL SCREEN MODE.
ALSO, REMEMBER THAT THE KEYBOARD ENTRIES ARE NOT ALLOWED WHILE IN FULL SCREEN MODE.
Thanks to ohwhen for pointing this out.

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
<?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();
            }
        }

        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>

You must also set the allowFullScreen value in the html to true:

1
<param name="allowFullScreen" value="true" />

Right Click on application to view & download Source Code.

Run This Code

Topics: Flex 2, Tutorials | 3 Comments »

3 Responses to “Lets Go Full Screen – Sample”

  1. walv Says:
    February 1st, 2010 at 4:52 pm

    good article. thanks!

    Reply to this comment

  2. manos from greece Says:
    April 19th, 2010 at 10:22 pm

    how can i expand the object in my flex project if i going to the full screen mode

    Reply to this comment

  3. Working with Full-Screen in Flex « Sweeping Design Says:
    November 9th, 2010 at 3:53 am

    [...] of using flex in full-screen for the first time today and found the examples at Flex Examples and Everything Flex wanting in clarity and style. Here, then, is the low-down – as clean and simple as it [...]

Comments