Fullscreen flash files

In this article we will try to show you how to use fullscreen functionality in Adobe Flash files

Sample button with ActionScript 2.0:

This is the code inside this flash file, create a flash file with As 2.0, from the "components" panel (under "user interface") drag and drop a button, give it an instance name like "my_button", then add this code in the keyframe:

// align stage content to Top Left corner
Stage.align = "TL";
// do not scale the content in the stage
Stage.scaleMode = "noScale";
// switch fullscreen/normal on clicking the button named "my_button"
my_button.onRelease = function() {
	if (fullscreen_state == "on") {
		Stage["displayState"] = "normal";
		fullscreen_state = "off";
	} else {
		Stage["displayState"] = "fullScreen";
		fullscreen_state = "on";

Now in order for fullscreen functionality to work, you also need to allow this by HTML code, this is the html code, note the TWO instances of the parameter "allowfullscreen" with value "true", fullscreen will not work without them:

<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="200" height="100" id="fullscreen_as2.0" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowfullscreen" value="true" />
<param name="movie" value="fullscreen_as2.0.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ff9900" />
<embed src="fullscreen_as2.0.swf" quality="high" allowfullscreen="true" bgcolor="#FF9900" width="200" height="100" name="fullscreen_as2.0" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

Download the flash fullscreen sample.