View comments | RSS feed

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)


Flash CS3


Comments


No screen name said on May 2, 2007 at 3:12 PM :
Is the wmode restriction, which I assume is a bug, going to be fixed in the future? In the meantime, is there a workaround for this?
No screen name said on Oct 18, 2007 at 8:02 AM :
Is there a good reason for disabling keyboard input while in full screen mode?

It seems that it must be a deliberate choice to do so and it also seems to be a bloody-minded and pointless restriction that renders the feature all but useless for my purposes.

I am working on a number of large slide and image analysis products that require users to enter comments (by typing - keyboard input) to annotate images. Full-screen functionality would be ideal for this to maximise the viewable area, but without the ability to type into forms, fullscreen is utterly useless.
Joe ... Ward said on Oct 19, 2007 at 3:28 PM :
The inconvenience is an unfortunate symptom of the times we live in. A fully interactive full-screen mode could be used in as part of phishing attack in an attempt to trick a user into revealing private information by emulating the desktop.
No screen name said on Oct 22, 2007 at 12:30 AM :
More on keyboard input:
Hi Joe,
With wmode disabled (presumably again to protect against phishing), emulating the desktop in any meaningful way is dependant on quite a lot of guess work - enough, I would imagine, to make the attack implausible if not impossible.
In the mean time, legitimate business uses for full-screen viewing - such as ours - cannot be achieved despite the technology being available.
There must surely be a compromise that can be achieved (as was done for Flash control of Mouse and Microphone) to allow users that want to use full-screen mode with keyboard input to opt-in to using keyboard with full-screen?
Gaius
Neoyz said on Feb 17, 2008 at 11:34 PM :
It seems that it has been fixed in the flashplayer 9.0.115

 

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