How you can you make your Flash appear in full screen?
9 Nov, 2007Thanks to unjimpe I was able to learn more from this. Because only knew the actionscript used in the version 2, I had honestly no idea on how to use the one in the version 3 of the actionscript and HTML.
This is a direct copy from the tutorial of how to make your Flash appear in full screen from the Flash Player 9 because you in it, have the choice of watching movies easily without the need of javascript or any other crafts. This is one of the major characteristics of Flash that makes the development of new applications simple and practical.
ActionScript 2.0
If you use AS2 it’s now available in a new version called : Stage.displayState, which has two possible values (fullscreen or normal) and with it, we’ll be able to control the way we want to watch a movie. Then we have:
-
// Change to fullscreen
-
Stage.displayState = “fullscreen”;
-
// Change to normal screen
-
Stage.displayState = “normal”;
With this you’ll be able to create a button that on the event onRelease calls upon one of these, as simple as that.
ActionScript 3.0
If you use AS3, it’s really similar, the thing that changes is that now the application is named: flash.display.Stage.displayState which has two options: StageDisplayState.FULL_SCREEN and StageDisplayState.NORMAL, then if you want to use this application in AS3 we have:
-
//Importing the necessary classes
-
import flash.display.Stage;
-
import flash.display.StageDisplayState;
-
-
// Change to fullscreen
-
stage.displayState = StageDisplayState.FULL_SCREEN;
-
// Change to normal screen
-
stage.displayState = StageDisplayState.NORMAL;
HTML forfullscreen mode
To make use of this property we have to add a new parameter called allowFullScreen which has two options true or false to allow or not the fullscreen access. Then if we use the method embed, the code would be:
-
<object width=“50″ height=“50″ id=“movie”>
-
<param name=“allowFullScreen” value=“true” />
-
<param name=“movie” value=“mov.swf” />
-
<embed src=“mov.swf” allowFullScreen=“true”
-
width=“50″ height=“50″ name=“movie” />
-
</object>
If we now use SWFObject to insert it Flash the code would be:
-
<script type=“text/javascript”>
-
var so = new SWFObject(”mov.swf”, “id”, “50″, “50″, “8″, “#fff”);
-
so.addParam(”allowFullScreen”, “true”);
-
so.write(”movie”);
-
</script>
There is a final thing you should know, the events associated with the keyboard(onKeyDown, etc) as well as the editable text fields will be disabled in the full screen mode, this is one of it’s restrictions.


One Response to “How you can you make your Flash appear in full screen?”
By ricky on Apr 17, 2008 | Reply
THANKYOU! - its about time someone with a brain posted a simple answer to ‘going fullscreen’. See - theres no need to import 527 classes and use 4 million lines of code to acheive this - what is done in three! Well done