00:00
00:00
Newgrounds Background Image Theme

GodsPurpose just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Fullscreen Tutorial

64,568 Views | 17 Replies
New Topic Respond to this Topic

Fullscreen Tutorial 2008-01-05 20:00:08


Since i started a thread asking if Newgrounds supported the fullscreen function ive been asked by a few people how to do it, so heres a tutorial.

**This only works on Flash Player 9.0.28 and above so you may need to update your flash player**

The new fullscreen attribute works due to a new actionscript Stage object 'displayState'. This takes two inputs :
'fullScreen': Sets the stage to display full-screen
'normal': Default setting

Unfortunately those using flash8 will need to make a modification to the flash installation to allow this.
You will need to change the following file:

Flash 8\en\First Run\Classes\FP8\Stage.as

to include "static var displayState:String;"

The finished file should look like this:

intrinsic class Stage
{
static var displayState:String;
static var align:String;
static var height:Number;
static var scaleMode:String;
static var showMenu:Boolean;
static var width:Number;

static function addListener(listener:Object):Void;
static function removeListener(listener:Object):Boolean;
}

Now, to code a simple button which switches between fullscreen and normal.

on (press) {
	if(Stage.displayState  == "fullScreen"){Stage.displayState  = "normal"} //if in fullscreen, become normal
else if(Stage.displayState  == "normal"){Stage.displayState  = "fullScreen"} //if normal, become fullscreen
}

Finally in order for this to work, you must include a new attribute to the EMBED tag of the of the html file to allow fullscreen.
This simply requires the addition of:
<param name="allowFullScreen" value="true" />

example:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="650" height="400" id="Untitled-1" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name="movie" value="Untitled-1.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="Untitled-1.swf" quality="high" bgcolor="#ffffff" width="650" height="400" name="Untitled-1" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

I hope this helps people who have been having problems.

**I don't know if this works with older versions of flash but CS3 is fine along with flash8 after simple modfication

Futher Help:

http://julian.empiregn.com/2007/2/22/How -to-create-true-fullscreen-movies-with-F lash
http://www.adobe.com/devnet/flashplayer/
articles/full_screen_mode.html

Response to Fullscreen Tutorial 2008-01-05 20:03:23


Nice, I like that you made a great tutorial. Anyways, you should see if you can get it in AS: Main (but try putting "AS: " in front next time). Also, you should go a little more in depth with every single part of the code and explain each line.


MY E-PENIS IS BIGGER THAN YOURS

8=================================>

...and this is my fag...

BBS Signature

Response to Fullscreen Tutorial 2008-01-06 08:53:01


At 1/5/08 08:03 PM, El-Presidente wrote: Nice, I like that you made a great tutorial. Anyways, you should see if you can get it in AS: Main (but try putting "AS: " in front next time). Also, you should go a little more in depth with every single part of the code and explain each line.

Ok thanks, for the advice, i may aswell explain some of it now.

Using the Fullscreen function

Stage.displayState  = "fullScreen"

this is the basic command for switching to fullscreen. It sets the stage to take up all available space on the screen, covering both windows taskbar and internet explorer tool bar.

Stage.displayState  = "normal"

This is the opposite, setting the stage to return to its default scale.

So to use these commands in simple buttons would require a simple code of:

on (press) {  //on left click down
	Stage.displayState  = "fullScreen //set stage to fullscreen.
}

and the opposite being to return to normal:

on (press) { //on left click down
	Stage.displayState  = "normal" //set stage to deafult
}

A simple toggle button can be created by using a simple function to check for fullscreen or not,

on (press) {
	if(Stage.displayState  == "fullScreen"){Stage.displayState  = "normal"}
else if(Stage.displayState  == "normal"){Stage.displayState  = "fullScreen"}
}

To explain the code,
"if(Stage.displayState == "fullScreen")" checks if fullscreen, then {Stage.displayState = "normal") become normal.

else if(Stage.displayState == "normal") otherwise, if normal, then {Stage.displayState = "fullScreen"} become fullscreen.

Response to Fullscreen Tutorial 2008-01-06 08:57:19


Whats wrong with fscommand("fullscreen", "true");?

Response to Fullscreen Tutorial 2008-01-06 08:58:40


Oh wait. This is for online. Sorry.

Nice tut :)

Response to Fullscreen Tutorial 2008-01-06 08:59:42


At 1/6/08 08:57 AM, UnknownFury wrote: Whats wrong with fscommand("fullscreen", "true");?

That only works in projector files, by using this fuction you can get fullscreen in mode in any browser as long as they have enabled the fullscreen EMBED code. This allows you to get the same effect for example of youtube videos when played fullscreen.

Response to Fullscreen Tutorial 2008-01-06 09:01:24


At 1/6/08 08:58 AM, UnknownFury wrote: Oh wait. This is for online. Sorry.

Nice tut :)

sorry, i must of being writing my last reply when you posted this lol

Response to Fullscreen Tutorial 2008-01-06 09:02:07


At 1/6/08 08:59 AM, g-muff wrote:
At 1/6/08 08:57 AM, UnknownFury wrote: Whats wrong with fscommand("fullscreen", "true");?
That only works in projector files, by using this fuction you can get fullscreen in mode in any browser as long as they have enabled the fullscreen EMBED code. This allows you to get the same effect for example of youtube videos when played fullscreen.

Yeah it was my mistake. I realised that afterwards, hence the double post.

Good Job :)

Response to Fullscreen Tutorial 2010-11-15 15:56:41


I'm trying all this and it works, but only in explorer. It does not work in Firefox, Safari, Opera, Chrome, etc. Why, why???


BBS Signature

Response to Fullscreen Tutorial 2021-04-21 09:30:57


At 1/6/08 08:53 AM, g-muff wrote:
At 1/5/08 08:03 PM, El-Presidente wrote: Nice, I like that you made a great tutorial. Anyways, you should see if you can get it in AS: Main (but try putting "AS: " in front next time). Also, you should go a little more in depth with every single part of the code and explain each line.
Ok thanks, for the advice, i may aswell explain some of it now.

Using the Fullscreen function

Stage.displayState = "fullScreen"

this is the basic command for switching to fullscreen. It sets the stage to take up all available space on the screen, covering both windows taskbar and internet explorer tool bar.

Stage.displayState = "normal"

This is the opposite, setting the stage to return to its default scale.

So to use these commands in simple buttons would require a simple code of:

on (press) { //on left click down
Stage.displayState = "fullScreen //set stage to fullscreen.
}

and the opposite being to return to normal:

on (press) { //on left click down
Stage.displayState = "normal" //set stage to deafult
}

A simple toggle button can be created by using a simple function to check for fullscreen or not,

on (press) {
if(Stage.displayState == "fullScreen"){Stage.displayState = "normal"}
else if(Stage.displayState == "normal"){Stage.displayState = "fullScreen"}
}

To explain the code,
"if(Stage.displayState == "fullScreen")" checks if fullscreen, then {Stage.displayState = "normal") become normal.

else if(Stage.displayState == "normal") otherwise, if normal, then {Stage.displayState = "fullScreen"} become fullscreen.

hi its me um um um pot/ dank meme man hii

BBS Signature

Response to Fullscreen Tutorial 2021-05-12 17:26:43


At 1/5/08 08:00 PM, g-muff wrote: Since i started a thread asking if Newgrounds supported the fullscreen function ive been asked by a few people how to do it, so heres a tutorial.

**This only works on Flash Player 9.0.28 and above so you may need to update your flash player**

The new fullscreen attribute works due to a new actionscript Stage object 'displayState'. This takes two inputs :
'fullScreen': Sets the stage to display full-screen
'normal': Default setting

Unfortunately those using flash8 will need to make a modification to the flash installation to allow this.
You will need to change the following file:

Flash 8\en\First Run\Classes\FP8\Stage.as

to include "static var displayState:String;"

The finished file should look like this:

intrinsic class Stage
{
static var displayState:String;
static var align:String;
static var height:Number;
static var scaleMode:String;
static var showMenu:Boolean;
static var width:Number;

static function addListener(listener:Object):Void;
static function removeListener(listener:Object):Boolean;
}

Now, to code a simple button which switches between fullscreen and normal.

on (press) {
if(Stage.displayState == "fullScreen"){Stage.displayState = "normal"} //if in fullscreen, become normal
else if(Stage.displayState == "normal"){Stage.displayState = "fullScreen"} //if normal, become fullscreen
}

Finally in order for this to work, you must include a new attribute to the EMBED tag of the of the html file to allow fullscreen.
This simply requires the addition of:
<param name="allowFullScreen" value="true" />

example:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="650" height="400" id="Untitled-1" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name="movie" value="Untitled-1.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="Untitled-1.swf" quality="high" bgcolor="#ffffff" width="650" height="400" name="Untitled-1" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

I hope this helps people who have been having problems.

**I don't know if this works with older versions of flash but CS3 is fine along with flash8 after simple modfication

Futher Help:

http://julian.empiregn.com/2007/2/22/How -to-create-true-fullscreen-movies-with-F lash
http://www.adobe.com/devnet/flashplayer/
articles/full_screen_mode.html


oorr I found out that you can actually just simply press F after clicking the game and ESC to get out of it

Response to Fullscreen Tutorial 2021-05-13 01:24:04


At 5/12/21 05:26 PM, 4ElementsBentByMe wrote: oorr I found out that you can actually just simply press F after clicking the game and ESC to get out of it

That's probably because the game implemented fullscreen in that manner.


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to Fullscreen Tutorial 2021-05-13 21:53:31


Yeah I'm new haha just found that out

Response to Fullscreen Tutorial 2021-05-29 17:36:43 (edited 2021-05-29 17:37:35)


i was playing friday night funkin when it entered full screen. How can I replicate this?

Response to Fullscreen Tutorial 2021-05-30 08:46:04


At 5/29/21 05:36 PM, Liamwalker1978 wrote: i was playing friday night funkin when it entered full screen. How can I replicate this?

FNF was made using HaxeFlixel, so they probably used

FlxG.fullscreen = true;

You can read the documentation here: https://api.haxeflixel.com/flixel/FlxG.html#fullscreen


Although not a follower of [hseroK divaD], she's a devoted Branch Davidian.

Response to Fullscreen Tutorial 2021-06-03 10:52:25


thx


Response to Fullscreen Tutorial 2021-12-11 19:38:13


At 1/5/08 08:03 PM, El-Presidente wrote: Nice, I like that you made a great tutorial. Anyways, you should see if you can get it in AS: Main (but try putting "AS: " in front next time). Also, you should go a little more in depth with every single part of the code and explain each line.


No one fucking asked pointy dick

Response to Fullscreen Tutorial 2021-12-17 22:38:14 (edited 2021-12-17 22:38:52)


How do I exist full screen in easy steps? Since I accidentally turn in full screen on my computer.

iu_499933_9437036.png