Calendar

October 2006
M T W T F S S
« Sep   Nov »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Tag Cloud

Categories

Archives

Highest Rated

Most Viewed

Recent Posts

Recent Comments


« Flex SQLAdmin Now Open Source!! | Main | Interactive Calendar »

Lets Go Full Screen - Sample

By Rich Tretola | October 17, 2006Print This Post Print This Post
1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 4 out of 5)
Loading ... Loading ...
642 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. 

<?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 add a new <object> and <embed> tag parameter,
allowFullScreen
, to their HTML. This parameter defaults to
false
, or not allowing full screen. To allow full-screen, developers must set
allowFullScreen
to
true
in their <object>/<embed> tags. Right Click on application to view & download Source Code. Run This Code Note: you must new Beta Flash Player for this to work. Rich

Share/Save/Bookmark

Topics: Flex 2, Tutorials |

Comments