Adobe® AIR® API Reference for HTML Developers
Home  |  Show Classes List |  Index  |  Appendixes

Language Reference only       
Screen 
3D:
Context3D
Context3DBlendFactor
Context3DClearMask
Context3DCompareMode
Context3DProgramType
Context3DRenderMode
Context3DStencilAction
Context3DTextureFormat
Context3DTriangleFace
Context3DVertexBufferFormat
CubeTexture
IndexBuffer3D
Program3D
Stage3D
Texture
VertexBuffer3D
Air.net:
ServiceMonitor
SocketMonitor
URLMonitor
Air.update:
ApplicationUpdater
ApplicationUpdaterUI
DownloadErrorEvent
StatusFileUpdateErrorEvent
StatusFileUpdateEvent
StatusUpdateErrorEvent
StatusUpdateEvent
UpdateEvent
Data:
EncryptedLocalStore
SQLCollationType
SQLColumnNameStyle
SQLColumnSchema
SQLConnection
SQLError
SQLErrorEvent
SQLErrorOperation
SQLEvent
SQLIndexSchema
SQLMode
SQLResult
SQLSchema
SQLSchemaResult
SQLStatement
SQLTableSchema
SQLTransactionLockType
SQLTriggerSchema
SQLUpdateEvent
SQLViewSchema
Desktop:
Clipboard
ClipboardFormats
ClipboardTransferMode
DockIcon
Icon
InteractiveIcon
NativeApplication
NativeProcess
NativeProcessStartupInfo
NotificationType
SystemTrayIcon
Display:
BitmapData
NativeMenu
NativeMenuItem
Screen
Stage
StageDisplayState
StageQuality
Events:
ActivityEvent
AsyncErrorEvent
BrowserInvokeEvent
DataEvent
DatagramSocketDataEvent
DNSResolverEvent
DRMAuthenticateEvent
DRMStatusEvent
ErrorEvent
Event
EventDispatcher
FileListEvent
HTTPStatusEvent
InvokeEvent
InvokeEventReason
IOErrorEvent
LocationChangeEvent
MouseEvent
NativeProcessExitEvent
NetDataEvent
NetMonitorEvent
NetStatusEvent
OutputProgressEvent
ProgressEvent
SampleDataEvent
SecurityErrorEvent
ServerSocketConnectEvent
StatusEvent
StorageVolumeChangeEvent
TimerEvent
UncaughtErrorEvent
UncaughtErrorEvents
File:
File
FileMode
FileStream
StorageVolume
StorageVolumeInfo
Functions:
trace()
generateRandomBytes()
navigateToURL()
sendToURL()
Geom:
Matrix
Point
Rectangle
Media:
AudioDecoder
AudioPlaybackMode
H264Level
H264Profile
H264VideoStreamSettings
ID3Info
InputMediaStream
Microphone
MicrophoneEnhancedMode
MicrophoneEnhancedOptions
Sound
SoundChannel
SoundCodec
SoundLoaderContext
SoundMixer
SoundTransform
VideoCodec
VideoStatus
VideoStreamSettings
Native window:
NativeWindow
NativeWindowBoundsEvent
NativeWindowDisplayState
NativeWindowDisplayStateEvent
NativeWindowInitOptions
NativeWindowRenderMode
NativeWindowResize
NativeWindowSystemChrome
NativeWindowType
Net:
AAAARecord
ARecord
CertificateStatus
DatagramSocket
DNSResolver
FileFilter
InterfaceAddress
IPVersion
LocalConnection
MXRecord
NetConnection
NetMonitor
NetStreamAppendBytesAction
NetStreamMulticastInfo
NetworkInfo
NetworkInterface
ObjectEncoding
PTRRecord
ResourceRecord
Responder
SecureSocket
ServerSocket
SharedObject
SharedObjectFlushStatus
Socket
SRVRecord
URLLoader
URLLoaderDataFormat
URLRequest
URLRequestDefaults
URLRequestHeader
URLRequestMethod
URLStream
URLVariables
XMLSocket
Security:
ReferencesValidationSetting
RevocationCheckSettings
SignatureStatus
SignerTrustSettings
X500DistinguishedName
X509Certificate
XMLSignatureValidator
System:
Capabilities
Security
System
Updater
Ui:
Keyboard
KeyboardType
KeyLocation
Mouse
MouseCursorData
Utils:
Vector
ByteArray
Collator
CollatorMode
CompressionAlgorithm
CurrencyFormatter
CurrencyParseResult
DateTimeFormatter
DateTimeNameContext
DateTimeNameStyle
DateTimeStyle
Endian
HTMLLoader
HTMLPDFCapability
LastOperationStatus
LocaleID
NationalDigitsType
NumberFormatter
NumberParseResult
StringTools
Timer
window.runtime propertywindow.runtime.flash.display.Screen
InheritanceScreen Inheritance EventDispatcher Inheritance Object

Runtime Versions:  1.0

The Screen class provides information about the display screens available to this application.

Screens are independent desktop areas within a possibly larger "virtual desktop." The origin of the virtual desktop is the top-left corner of the operating-system-designated main screen. Thus, the coordinates for the bounds of an individual display screen may be negative. There may also be areas of the virtual desktop that are not within any of the display screens.

The Screen class includes static class members for accessing the available screen objects and instance members for accessing the properties of an individual screen. Screen information should not be cached since it can be changed by a user at any time.

Note that there is not necessarily a one-to-one correspondance between screens and the physical monitors attached to a computer. For example, two monitors may display the same screen.

You cannot instantiate the Screen class directly. Calls to the new Screen() constructor throw an ArgumentError exception.

See also



Properties
 PropertyDefined By
  bounds : Rectangle
[read-only] The bounds of this screen.
Screen
  colorDepth : int
[read-only] The color depth of this screen (expressed in number of bits).
Screen
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  mainScreen : Screen
[static] [read-only] The primary display.
Screen
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  screens : Array
[static] [read-only] The array of the currently available screens.
Screen
  visibleBounds : Rectangle
[read-only] The bounds of the area on this screen in which windows can be visible.
Screen
Public Methods
 MethodDefined By
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
EventDispatcher
 Inherited
dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow.
EventDispatcher
  
[static] Returns the (possibly empty) set of screens that intersect the provided rectangle.
Screen
 Inherited
hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
hasOwnProperty(name:String):Boolean
Indicates whether an object has a specified property defined.
Object
 Inherited
isPrototypeOf(theClass:Object):Boolean
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
propertyIsEnumerable(name:String):Boolean
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
toLocaleString():String
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
toString():String
Returns the string representation of the specified object.
Object
 Inherited
valueOf():Object
Returns the primitive value of the specified object.
Object
 Inherited
willTrigger(type:String):Boolean
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
Property Detail

bounds

property
bounds:Rectangle  [read-only]

Runtime Versions:  1.0

The bounds of this screen.

The screen location is relative to the virtual desktop.

On Linux systems that use certain window managers, this property returns the desktop bounds, not the screen's visible bounds.


Example  ( How to use this example )
The following example shows how to get the bounds of a screen (in this case, the primary display screen):
var screenBounds = air.Screen.mainScreen.bounds;

colorDepth

property 
colorDepth:int  [read-only]

Runtime Versions:  1.0

The color depth of this screen (expressed in number of bits).


Example  ( How to use this example )
The following example shows how to get the color depth of a screen (in this case, the primary display screen):
var colors = air.Screen.mainScreen.colorDepth;

mainScreen

property 
mainScreen:Screen  [read-only]

Runtime Versions:  1.0

The primary display.


Example  ( How to use this example )
The following example shows how to get the Screen object representing the "main" screen of this computer:
var primaryScreen = air.Screen.mainScreen;

screens

property 
screens:Array  [read-only]

Runtime Versions:  1.0

The array of the currently available screens.

Modifying the returned array has no effect on the available screens.


Example  ( How to use this example )
The following example shows how to get the array containing the available screens:
var screenArray = air.Screen.screens;

visibleBounds

property 
visibleBounds:Rectangle  [read-only]

Runtime Versions:  1.0

The bounds of the area on this screen in which windows can be visible.

The visibleBounds of a screen excludes the task bar (and other docked desk bars) on Windows, and excludes the menu bar and, depending on system settings, the dock on Mac OS X. On some Linux configurations, it is not possible to determine the visible bounds. In these cases, the visibleBounds property returns the same value as the screenBounds property.


Example  ( How to use this example )
The following example shows how to get the usable bounds of a screen (in this case, the primary display screen):
var screenBounds = air.Screen.mainScreen.visibleBounds;
Method Detail

getScreensForRectangle

()method
public function getScreensForRectangle(rect:Rectangle):Array

Runtime Versions:  1.0

Returns the (possibly empty) set of screens that intersect the provided rectangle.

Parameters

rect:Rectangle — A rectangle with coordinates relative to the origin of the virtual desktop, which is the top-left corner of the primary screen.

Returns
Array — An array of Screen objects containing the screens that contain any part of the area defined by the rect parameter.

Example  ( How to use this example )

The following example shows how to get the array of screens containing at least part of a given rectangle:
var rect = new air.Rectangle(-200, 100, 1000, 600);
var intersectedScreens = air.Screen.getScreensForRectangle(rect);