Hi Flexcoders I have a question. I made an application and I like to give user the option of clicking on full screen. I implemented the following code and full screen is working fine. When user clicks on Full screen the whole application takes place of the monitor but my problem is that the application does not scale, so it looks weird. Please help me out, I need full screen scaling of my whole application. However I implemented same thing in AS 3.0 uisng Flash IDE just by using "addEventListener(Event.ENTER_FRAME,setStage); function setStage(event:Event):void { stage.displayState = StageDisplayState.FULL_SCREEN; fscommand("fullscreen", "true"); fscommand("allowscale", "true"); }". But this techniques is not working in Flex. I am trying to run independent SWF file for full screen, With Browser definitely this thing is not going to work but i need full screen in SWF file. Please help Thanks Anuj //Code For Flex <mx:Application width="1640" xmlns:mx="http://www.adobe.com/2006/mxml" verticalAlign="top" viewSourceURL="srcview/index.html" layout="absolute" backgroundColor="#b7babc" verticalScrollPolicy="off" horizontalScrollPolicy="off" height="100%" applicationComplete="FS(event)" xmlns:assets="assets.*" enterFrame="GridCheck(event)" creationComplete="init()" xmlns:ns1="*" xmlns:ns2="Renderers.*" xmlns:myComps="*" xmlns:objecthandles="com.roguedevelopment.objecthandles.*"> <mx:Style source="resources/css/style.css"/> <mx:Button id="FullScreenButton" x="809" y="959" label="Fullscreen" click="toggleFullScreen()"/> //Functions public function FS(evt:Event):void { stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullScreenHandler); dispState =stage.displayState; }
public function fullScreenHandler(evt:FullScreenEvent):void { dispState = stage.displayState + " (fullScreen=" + evt.fullScreen.toString() + ")"; if (evt.fullScreen) { FullScreenButton.label="Normal"; } else { FullScreenButton.label="Full Screen"; } } public function toggleFullScreen():void { try { switch(Application.application.stage.displayState) { case StageDisplayState.FULL_SCREEN: //If already in full screen mode, switch to normal mode. stage.displayState = StageDisplayState.NORMAL; stage.scaleMode=StageScaleMode.NO_SCALE; break; default: // If not in full screen mode, switch to full screen mode. stage.displayState = StageDisplayState.FULL_SCREEN; //Setting Scale stage.scaleMode=StageScaleMode.NO_SCALE; break; } } catch (err:SecurityError) { // ignore } } <mx:Button id="FullScreenButton" x="809" y="959" label="Fullscreen" click="toggleFullScreen()"/> </mx:Application>