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