Example
The following example creates a clickable text link that lets the user enable and disable the
Flash Player context menu.
this.createTextField("showMenu_txt", this.getNextHighestDepth(), 10, 10,
100, 22);
showMenu_txt.html = true;
showMenu_txt.autoSize = true;
showMenu_txt.htmlText = "<a
href=\"asfunction:toggleMenu\"><u>Stage.showMenu = "+Stage.showMenu+"</
u></a>";
function toggleMenu() {
Stage.showMenu = !Stage.showMenu;
showMenu_txt.htmlText = "<a
href=\"asfunction:toggleMenu\"><u>Stage.showMenu = "+Stage.showMenu+"</
u></a>";
}
See also
,
ContextMenu
ContextMenuItem
width (Stage.width property)
public static width : Number
Property (read-only); indicates the current width, in pixels, of the Stage. When the value of
is
Stage.scaleMode
This means that
Stage.width
is not
Stage.scaleMode
author-time in the Document Properties dialog box. This means that the value of
stay constant as you resize the player window.
Availability: ActionScript 1.0; Flash Player 6
Example
This example creates a new listener object called
to call
stageListener
triggered. Finally, the code adds the
object. Listener objects allow multiple objects to listen for resize notifications.
this.createTextField("stageSize_txt", this.getNextHighestDepth(), 10, 10,
100, 22);
var stageListener:Object = new Object();
stageListener.onResize = function() {
stageSize_txt.text = "w:"+Stage.width+", h:"+Stage.height;
};
, the
"noScale"
width
will vary as you resize the player window. When the value of
,
"noScale"
width
and define a function that will be called when
onResize
stageListener
property represents the width of Flash Player.
represents the width of the SWF file as set at
. It then uses
stageListener
object to the callback list of the Stage
will
width
is
onResize
Stage
1125
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?
Questions and answers