User Guide
Stage 1125
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
Stage.scaleMode is "noScale", the width property represents the width of Flash Player.
This means that
Stage.width will vary as you resize the player window. When the value of
Stage.scaleMode is not "noScale", width represents the width of the SWF file as set at
author-time in the Document Properties dialog box. This means that the value of
width will
stay constant as you resize the player window.
Availability: ActionScript 1.0; Flash Player 6
Example
This example creates a new listener object called
stageListener. It then uses
stageListener to call onResize and define a function that will be called when onResize is
triggered. Finally, the code adds the
stageListener object to the callback list of the Stage
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;
};