Packageflash.display
Classpublic class ScreenMode
InheritanceScreenMode Inheritance Object

Language version: ActionScript 3.0
Runtime version: AIR 31.0

The ScreenMode object provides information about the width, height and refresh rate of a Screen.

Methods and properties of the following classes use ScreenMode objects:

View the examples.

See also

flash.display.ScreenMode


Public Properties
 PropertyDefined by
  colorDepth : int
[read-only] The color depth of the ScreenMode in number of bits.
ScreenMode
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  height : int
[read-only] The screen height of the ScreenMode in pixels.
ScreenMode
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  refreshRate : int
[read-only] The screen refresh rate of the ScreenMode in hertz.
ScreenMode
  width : int
[read-only] The screen width of the ScreenMode in pixels.
ScreenMode
Public Methods
 MethodDefined by
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Property detail
colorDepthproperty
colorDepth:int  [read-only]

Language version: ActionScript 3.0
Runtime version: AIR 31.0

The color depth of the ScreenMode in number of bits. The color depth property indicates the color depth of the ScreenMode.

Implementation
    public function get colorDepth():int
heightproperty 
height:int  [read-only]

Language version: ActionScript 3.0
Runtime version: AIR 31.0

The screen height of the ScreenMode in pixels. The height property indicates the height of the ScreenMode.

Implementation
    public function get height():int
refreshRateproperty 
refreshRate:int  [read-only]

Language version: ActionScript 3.0
Runtime version: AIR 31.0

The screen refresh rate of the ScreenMode in hertz. The refreshRate property indicates the refresh rate of the ScreenMode. The return value is 0 when a display device does not support refresh rate.

Implementation
    public function get refreshRate():int
widthproperty 
width:int  [read-only]

Language version: ActionScript 3.0
Runtime version: AIR 31.0

The screen width of the ScreenMode in pixels. The width property indicates the width of the ScreenMode.

Implementation
    public function get width():int
Examples
examples\Screen.mode.2
The following example shows how to use the properties of the ScreenMode (in this case, the primary display screen):
import flash.display.ScreenMode;
import flash.display.Screen;

var primarymonitor:Screen = Screen.mainScreen;

stage.displayState=StageDisplayState.FULL_SCREEN_INTERACTIVE;
var r:ScreenMode = primarymonitor.mode;

res_0.text = r.width + "*" + r.height + "*" + r.refreshRate +"*" + r.colorDepth ;