displayState (Stage.displayState property)

public static displayState : String

Sets Flash Player to play the movie in full-screen mode or to take Flash Player out of full-screen mode. You can also use this property to check the current state of Flash Player.

The scaling behavior of the movie in full-screen mode is determined by the scaleMode setting (set using the Stage.scaleMode property or the SWF file's param or embed tag settings in the HTML file). If the scaleMode property is set to noScale while Flash Player makes the transition to full-screen mode, the stage width and height properties are updated and the Stage.onResize event listener is called.

The following restrictions apply to SWF files that play within an HTML page (not those using the standalone Flash Player):

Availability: ActionScript 2.0; Flash Player 9.0.28.0

Example

The following example demonstrates how to display a SWF in full-screen mode. Note the above restrictions. Add a Button instance to your document with the instance name myButton. Add the following ActionScript to your FLA or AS file:

var myButton:mx.controls.Button;
myButton.label = "Toggle Fullscreen";
myButton.setSize(150,22);
var buttonListener:Object = new Object();
buttonListener.click = function(evt:Object) {
    Stage.displayState = Stage.displayState == "normal" ? "fullScreen" : "normal";
};
myButton.addEventListener("click", buttonListener);

See also

scaleMode (Stage.scaleMode property), onFullScreen (Stage.onFullScreen handler), onResize (Stage.onResize event listener)