Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > Stage > 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.
fullScreen--Sets Flash Player to expand the stage over the user's entire screen.normal--Sets the player back to the standard stage display mode.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):
allowFullScreen parameter in the object and embed tags in the HTML page that contains the reference to the SWF file, with allowFullScreen set to "true", as shown in the following example:
<param name="allowFullScreen" value="true" />
...
<embed src="example.swf" allowFullScreen="true" ... >
An HTML page may also use a script to generate SWF-embedding tags. You need to alter the script so that it inserts the proper allowFullScreen settings. HTML pages generated by Flash authoring use the AC_FL_RunContent() function to embed references to SWF files, and you need to add the allowNetworking parameter settings, as in the following:
AC_FL_RunContent( ... "allowFullScreen", "true", ... )
Stage.displayState without user input. While Flash Player is in full-screen mode, all keyboard input is disabled (except keyboard shortcuts that take the user out of full-screen mode). A Flash Player dialog box appears over the movie when users enter full-screen mode to inform the users they are in full-screen mode and that they can press the Escape key to end full-screen mode.fullScreen setting is not supported for "windowless" (transparent windowless or opaque windowless) playback. If you have wmode set to opaque or transparent in the HTML page hosting the SWF file, the user will not be able to switch Flash Player to full-screen mode. [bullet point added: 4/23/07] Availability: ActionScript 2.0; Flash Player 9.0.28.0
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);
scaleMode (Stage.scaleMode property), onFullScreen (Stage.onFullScreen handler), onResize (Stage.onResize event listener)
Flash CS3
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00002149.html
Comments
No screen name said on May 2, 2007 at 3:12 PM : No screen name said on Oct 18, 2007 at 8:02 AM :