# Full Screen Won't Work

**URL:** <https://forum.kirupa.com/t/full-screen-wont-work/325464>\
**Category:** flash\
**Created:** [October 17, 2011, 6:41pm UTC](https://forum.kirupa.com/t/full-screen-wont-work/325464 "2011-10-17T18:41:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![na\_il](https://avatars.discourse-cdn.com/v4/letter/n/bc79bd/32.png) [@na\_il](https://forum.kirupa.com/u/na_il)\
**Post date:** [October 17, 2011, 6:41pm UTC](https://forum.kirupa.com/t/full-screen-wont-work/325464/1 "2011-10-17T18:41:41Z")

</div>

I’ve tried a thousand ways and it is getting frustrating…

Attempt one

AS3

function setFullScreen():void {  
if (stage.displayState== “normal”) {  
stage.displayState=“fullScreen”;  
stage.scaleMode = StageScaleMode.NO\_SCALE;  
} else {  
stage.displayState=“normal”;  
}  
}

button1.addEventListener(MouseEvent.CLICK, goFull);

function goFull(event:MouseEvent):void {  
setFullScreen();  
}

HTML

\<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “[http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd](http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd)”\>  
\<html xmlns=“[http://www.w3.org/1999/xhtml](http://www.w3.org/1999/xhtml)” lang=“en” xml:lang=“en”\>  
\<head\>  
\<title\>Stat\_Project\</title\>  
\<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” /\>  
\<style type=“text/css” media=“screen”\>  
html, body { height:100%; background-color: #ffffff;}  
body { margin:0; padding:0; overflow:hidden; }  
#flashContent { width:100%; height:100%; }  
\</style\>  
\</head\>  
\<body\>  
\<div id=“flashContent”\>  
\<object classid=“clsid:d27cdb6e-ae6d-11cf-96b8-444553540000” width=“1000” height=“700” id=“Stat\_Project” align=“middle”\>  
\<param name=“movie” value=“Stat\_Project.swf” /\>  
\<param name=“quality” value=“high” /\>  
\<param name=“bgcolor” value="#ffffff" /\>  
\<param name=“play” value=“true” /\>  
\<param name=“loop” value=“true” /\>  
\<param name=“wmode” value=“window” /\>  
\<param name=“scale” value=“showall” /\>  
\<param name=“menu” value=“true” /\>  
\<param name= “allowFullScreen” value= “true” /\>  
\<param name=“devicefont” value=“false” /\>  
\<param name=“salign” value="" /\>  
\<param name=“allowScriptAccess” value=“sameDomain” /\>  
\<!–[if !IE]\>–\>  
\<object type=“application/x-shockwave-flash” data=“Stat\_Project.swf” width=“1000” height=“700”\>  
\<param name=“movie” value=“Stat\_Project.swf” /\>  
\<param name=“quality” value=“high” /\>  
\<param name=“bgcolor” value="#ffffff" /\>  
\<param name=“play” value=“true” /\>  
\<param name=“loop” value=“true” /\>  
\<param name=“wmode” value=“window” /\>  
\<param name=“scale” value=“showall” /\>  
\<param name=“menu” value=“true” /\>  
\<param name= “allowFullScreen” value= “true” /\>  
\<param name=“devicefont” value=“false” /\>  
\<param name=“salign” value="" /\>  
\<param name=“allowScriptAccess” value=“sameDomain” /\>  
\<!–\<![endif]–\>  
\<a href=“[http://www.adobe.com/go/getflash](http://www.adobe.com/go/getflash)”\>  
\<img src=“[http://www.adobe.com/images/shared/download\_buttons/get\_flash\_player.gif](http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif)” alt=“Get Adobe Flash player” /\>  
\</a\>  
\<!–[if !IE]\>–\>  
\</object\>  
\<!–\<![endif]–\>  
\</object\>  
\</div\>  
\</body\>  
\</html\>

Attempt two:

AS3 class

package{

```
//import all classes
import flash.display.Loader;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageDisplayState;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.FullScreenEvent;
import flash.events.MouseEvent;
import flash.net.URLRequest;

public class MainClass extends Sprite 
{
	//create variables
			
	public function MainClass() {
		
		stage.align = StageAlign.TOP_LEFT;
		stage.scaleMode = StageScaleMode.NO_SCALE;			
		stage.addEventListener(Event.RESIZE, stageResize);		
		
		stage.addEventListener(FullScreenEvent.FULL_SCREEN, onFullscreen);
		fullscreen_btn.addEventListener(MouseEvent.CLICK, goFullscreen);
		fullscreen_btn.buttonMode = true;
	}	
	
	private function onFullscreen(e:FullScreenEvent):void 
	{
		fullscreen_btn.gotoAndStop(e.fullScreen?2:1);
	}
	
	private function goFullscreen(e:MouseEvent):void 
	{
		if( stage.displayState == StageDisplayState.NORMAL ){				
			stage.displayState = StageDisplayState.FULL_SCREEN;				
		} else {				
			stage.displayState = StageDisplayState.NORMAL;					
		}		
	}
	
	
	private function stageResize(e:Event=null):void
	{			
				
		fullscreen_btn.x = Math.floor(stage.stageWidth - fullscreen_btn.width - 10);
		fullscreen_btn.y = 10;
	}
	
	
}	

```

}

What am I doing wrong??? This is so frustrating…
