Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual page 174

Programming actionscript 3.0
Table of Contents

Advertisement

In addition, a user can choose to leave full-screen mode by switching focus to a different
window or by pressing one of several key combinations: the escape key (all platforms), ctrl-w
(Windows), cmd-w (Mac), or alt-F4 (Windows).
Stage scaling behavior for full-screen mode is the same as under normal mode; the scaling is
controlled by the Stage class's
to
StageScaleMode.NO_SCALE
to reflect the size of the screen area occupied by the SWF (the entire screen, in this case).
You can use the Stage class's
is turned on or off. For example, you might want to reposition, add, or remove items from the
screen when entering or leaving full-screen mode, as in this example:
import flash.events.FullScreenEvent;
function fullScreenRedraw(event:FullScreenEvent):void
{
if (event.fullScreen)
{
// remove input text fields
// add a button which closes full-screen mode
}
else
{
// re-add input text fields
// remove the button which closes full-screen mode
}
}
mySprite.stage.addEventListener(FullScreenEvent.FULL_SCREEN,
fullScreenRedraw);
As this code shows, the event object for the
flash.events.FullScreenEvent class, which includes a
full-screen mode is enabled (
When working with full-screen mode in ActionScript, you'll want to keep the following
considerations in mind:
Full-screen mode can only be initiated through ActionScript in response to a mouse click
(including right-click) or keypress.
For users with multiple monitors, the SWF content will only expand to fill one monitor.
Flash Player uses a metric to determine which monitor contains the greatest portion of the
SWF, and uses that monitor for full-screen mode.
For a SWF file embedded in an HTML page, the HTML code to embed Flash Player
must include a
<param>
value
, such as this:
true
174
Display Programming
property. As always, if the
scaleMode
, the stage's
stageWidth
event to detect and respond when full-screen mode
fullScreen
fullScreen
) or not (
).
true
false
tag and
attribute with name
<embed>
scaleMode
and
stageHeight
event is an instance of the
property indicating whether
fullScreen
allowFullScreen
property is set
properties change
and

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents