ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Hide Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes

Language Reference only
Filters: AIR 32.0 and earlier, Flash Player 32.0 and earlier, Flash Lite 4
Flex 4.6 and earlier, Flash Pro CS6 and earlier
Hide Filters
flash.display 

NativeWindow  - AS3

Packagesx

Top Level
adobe.utils
air.desktop
air.net
air.update
air.update.events
coldfusion.air
coldfusion.air.errors
coldfusion.air.events
coldfusion.service
coldfusion.service.events
coldfusion.service.mxml
com.adobe.acm.solutions.authoring.domain.extensions
com.adobe.acm.solutions.ccr.domain.extensions
com.adobe.consulting.pst.vo
com.adobe.dct.component
com.adobe.dct.component.datadictionary
com.adobe.dct.component.datadictionaryElement
com.adobe.dct.component.dataElementsPanel
com.adobe.dct.component.toolbars
com.adobe.dct.event
com.adobe.dct.exp
com.adobe.dct.model
com.adobe.dct.service
com.adobe.dct.service.provider
com.adobe.dct.transfer
com.adobe.dct.util
com.adobe.dct.view
com.adobe.ep.taskmanagement.domain
com.adobe.ep.taskmanagement.event
com.adobe.ep.taskmanagement.filter
com.adobe.ep.taskmanagement.services
com.adobe.ep.taskmanagement.util
com.adobe.ep.ux.attachmentlist.component
com.adobe.ep.ux.attachmentlist.domain
com.adobe.ep.ux.attachmentlist.domain.events
com.adobe.ep.ux.attachmentlist.domain.renderers
com.adobe.ep.ux.attachmentlist.skin
com.adobe.ep.ux.attachmentlist.skin.renderers
com.adobe.ep.ux.content.event
com.adobe.ep.ux.content.factory
com.adobe.ep.ux.content.handlers
com.adobe.ep.ux.content.managers
com.adobe.ep.ux.content.model.asset
com.adobe.ep.ux.content.model.preview
com.adobe.ep.ux.content.model.relation
com.adobe.ep.ux.content.model.search
com.adobe.ep.ux.content.model.toolbar
com.adobe.ep.ux.content.search
com.adobe.ep.ux.content.services
com.adobe.ep.ux.content.services.load
com.adobe.ep.ux.content.services.permissions
com.adobe.ep.ux.content.services.preview
com.adobe.ep.ux.content.services.providers
com.adobe.ep.ux.content.services.query
com.adobe.ep.ux.content.services.relationships
com.adobe.ep.ux.content.services.search.lccontent
com.adobe.ep.ux.content.services.version
com.adobe.ep.ux.content.view
com.adobe.ep.ux.content.view.components.activate
com.adobe.ep.ux.content.view.components.grid
com.adobe.ep.ux.content.view.components.grid.hover
com.adobe.ep.ux.content.view.components.grid.hover.component
com.adobe.ep.ux.content.view.components.grid.renderers
com.adobe.ep.ux.content.view.components.relationships
com.adobe.ep.ux.content.view.components.review
com.adobe.ep.ux.content.view.components.search.renderers
com.adobe.ep.ux.content.view.components.searchpod
com.adobe.ep.ux.content.view.components.toolbar
com.adobe.ep.ux.content.view.components.toolbar.controlRenderers
com.adobe.ep.ux.content.view.components.version
com.adobe.ep.ux.documentsubmit.component
com.adobe.ep.ux.documentsubmit.domain
com.adobe.ep.ux.documentsubmit.skin
com.adobe.ep.ux.taskaction.component
com.adobe.ep.ux.taskaction.domain
com.adobe.ep.ux.taskaction.domain.events
com.adobe.ep.ux.taskaction.skin
com.adobe.ep.ux.taskdetails.component
com.adobe.ep.ux.taskdetails.domain
com.adobe.ep.ux.taskdetails.skin
com.adobe.ep.ux.tasklist.component
com.adobe.ep.ux.tasklist.domain
com.adobe.ep.ux.tasklist.skin
com.adobe.ep.ux.webdocumentviewer.domain
com.adobe.exm.expression
com.adobe.exm.expression.error
com.adobe.exm.expression.event
com.adobe.exm.expression.impl
com.adobe.fiber.runtime.lib
com.adobe.fiber.services
com.adobe.fiber.services.wrapper
com.adobe.fiber.styles
com.adobe.fiber.util
com.adobe.fiber.valueobjects
com.adobe.gravity.binding
com.adobe.gravity.context
com.adobe.gravity.flex.bundleloader
com.adobe.gravity.flex.progress
com.adobe.gravity.flex.serviceloader
com.adobe.gravity.framework
com.adobe.gravity.init
com.adobe.gravity.service.bundleloader
com.adobe.gravity.service.logging
com.adobe.gravity.service.manifest
com.adobe.gravity.service.progress
com.adobe.gravity.tracker
com.adobe.gravity.ui
com.adobe.gravity.utility
com.adobe.gravity.utility.async
com.adobe.gravity.utility.error
com.adobe.gravity.utility.events
com.adobe.gravity.utility.factory
com.adobe.gravity.utility.flex.async
com.adobe.gravity.utility.logging
com.adobe.gravity.utility.message
com.adobe.gravity.utility.sequence
com.adobe.gravity.utility.url
com.adobe.guides.control
com.adobe.guides.domain
com.adobe.guides.i18n
com.adobe.guides.spark.components.skins
com.adobe.guides.spark.components.skins.mx
com.adobe.guides.spark.headers.components
com.adobe.guides.spark.headers.skins
com.adobe.guides.spark.layouts.components
com.adobe.guides.spark.layouts.skins
com.adobe.guides.spark.navigators.components
com.adobe.guides.spark.navigators.renderers
com.adobe.guides.spark.navigators.skins
com.adobe.guides.spark.util
com.adobe.guides.spark.wrappers.components
com.adobe.guides.spark.wrappers.skins
com.adobe.guides.submit
com.adobe.icc.dc.domain
com.adobe.icc.dc.domain.factory
com.adobe.icc.editors.events
com.adobe.icc.editors.handlers
com.adobe.icc.editors.managers
com.adobe.icc.editors.model
com.adobe.icc.editors.model.config
com.adobe.icc.editors.model.el
com.adobe.icc.editors.model.el.operands
com.adobe.icc.editors.model.el.operators
com.adobe.icc.enum
com.adobe.icc.external.dc
com.adobe.icc.obj
com.adobe.icc.services
com.adobe.icc.services.category
com.adobe.icc.services.config
com.adobe.icc.services.download
com.adobe.icc.services.export
com.adobe.icc.services.external
com.adobe.icc.services.formbridge
com.adobe.icc.services.fragmentlayout
com.adobe.icc.services.layout
com.adobe.icc.services.letter
com.adobe.icc.services.locator
com.adobe.icc.services.module
com.adobe.icc.services.render
com.adobe.icc.services.submit
com.adobe.icc.services.user
com.adobe.icc.token
com.adobe.icc.vo
com.adobe.icc.vo.render
com.adobe.icomm.assetplacement.controller
com.adobe.icomm.assetplacement.controller.utils
com.adobe.icomm.assetplacement.data
com.adobe.icomm.assetplacement.model
com.adobe.livecycle.assetmanager.client
com.adobe.livecycle.assetmanager.client.event
com.adobe.livecycle.assetmanager.client.handler
com.adobe.livecycle.assetmanager.client.managers
com.adobe.livecycle.assetmanager.client.model
com.adobe.livecycle.assetmanager.client.model.cms
com.adobe.livecycle.assetmanager.client.service
com.adobe.livecycle.assetmanager.client.service.search
com.adobe.livecycle.assetmanager.client.service.search.cms
com.adobe.livecycle.assetmanager.client.utils
com.adobe.livecycle.content
com.adobe.livecycle.rca.model
com.adobe.livecycle.rca.model.constant
com.adobe.livecycle.rca.model.document
com.adobe.livecycle.rca.model.participant
com.adobe.livecycle.rca.model.reminder
com.adobe.livecycle.rca.model.stage
com.adobe.livecycle.rca.service
com.adobe.livecycle.rca.service.core
com.adobe.livecycle.rca.service.core.delegate
com.adobe.livecycle.rca.service.process
com.adobe.livecycle.rca.service.process.delegate
com.adobe.livecycle.rca.token
com.adobe.livecycle.ria.security.api
com.adobe.livecycle.ria.security.service
com.adobe.mosaic.layouts
com.adobe.mosaic.layouts.dragAndDrop
com.adobe.mosaic.layouts.interfaces
com.adobe.mosaic.mxml
com.adobe.mosaic.om.constants
com.adobe.mosaic.om.events
com.adobe.mosaic.om.impl
com.adobe.mosaic.om.interfaces
com.adobe.mosaic.skinning
com.adobe.mosaic.sparklib.editors
com.adobe.mosaic.sparklib.optionMenu
com.adobe.mosaic.sparklib.scrollableMenu
com.adobe.mosaic.sparklib.scrollableMenu.skins
com.adobe.mosaic.sparklib.tabLayout
com.adobe.mosaic.sparklib.tabLayout.events
com.adobe.mosaic.sparklib.tabLayout.layouts
com.adobe.mosaic.sparklib.tabLayout.skins
com.adobe.mosaic.sparklib.text
com.adobe.mosaic.sparklib.util
com.adobe.solutions.acm.authoring.presentation
com.adobe.solutions.acm.authoring.presentation.actionbar
com.adobe.solutions.acm.authoring.presentation.common
com.adobe.solutions.acm.authoring.presentation.events
com.adobe.solutions.acm.authoring.presentation.fragment
com.adobe.solutions.acm.authoring.presentation.letter
com.adobe.solutions.acm.authoring.presentation.letter.data
com.adobe.solutions.acm.authoring.presentation.preview
com.adobe.solutions.acm.authoring.presentation.rte
com.adobe.solutions.acm.ccr.presentation
com.adobe.solutions.acm.ccr.presentation.contentcapture
com.adobe.solutions.acm.ccr.presentation.contentcapture.events
com.adobe.solutions.acm.ccr.presentation.contentcapture.preview
com.adobe.solutions.acm.ccr.presentation.datacapture
com.adobe.solutions.acm.ccr.presentation.datacapture.renderers
com.adobe.solutions.acm.ccr.presentation.pdf
com.adobe.solutions.exm
com.adobe.solutions.exm.authoring
com.adobe.solutions.exm.authoring.components.controls
com.adobe.solutions.exm.authoring.components.toolbars
com.adobe.solutions.exm.authoring.domain
com.adobe.solutions.exm.authoring.domain.expression
com.adobe.solutions.exm.authoring.domain.impl
com.adobe.solutions.exm.authoring.domain.method
com.adobe.solutions.exm.authoring.domain.variable
com.adobe.solutions.exm.authoring.enum
com.adobe.solutions.exm.authoring.events
com.adobe.solutions.exm.authoring.model
com.adobe.solutions.exm.authoring.renderer
com.adobe.solutions.exm.authoring.view
com.adobe.solutions.exm.expression
com.adobe.solutions.exm.impl
com.adobe.solutions.exm.impl.method
com.adobe.solutions.exm.method
com.adobe.solutions.exm.mock
com.adobe.solutions.exm.mock.method
com.adobe.solutions.exm.runtime
com.adobe.solutions.exm.runtime.impl
com.adobe.solutions.exm.variable
com.adobe.solutions.prm.constant
com.adobe.solutions.prm.domain
com.adobe.solutions.prm.domain.factory
com.adobe.solutions.prm.domain.impl
com.adobe.solutions.prm.domain.manager
com.adobe.solutions.prm.presentation.asset
com.adobe.solutions.prm.presentation.constant
com.adobe.solutions.prm.presentation.document
com.adobe.solutions.prm.presentation.event
com.adobe.solutions.prm.presentation.file
com.adobe.solutions.prm.presentation.project
com.adobe.solutions.prm.presentation.team
com.adobe.solutions.prm.presentation.util
com.adobe.solutions.prm.service
com.adobe.solutions.prm.services.impl
com.adobe.solutions.prm.vo
com.adobe.solutions.rca.constant
com.adobe.solutions.rca.domain
com.adobe.solutions.rca.domain.common
com.adobe.solutions.rca.domain.factory
com.adobe.solutions.rca.domain.impl
com.adobe.solutions.rca.domain.impl.manager
com.adobe.solutions.rca.domain.manager
com.adobe.solutions.rca.presentation
com.adobe.solutions.rca.presentation.comment
com.adobe.solutions.rca.presentation.constant
com.adobe.solutions.rca.presentation.event
com.adobe.solutions.rca.presentation.gantt
com.adobe.solutions.rca.presentation.gantt.ruler
com.adobe.solutions.rca.presentation.template
com.adobe.solutions.rca.presentation.template.audit
com.adobe.solutions.rca.presentation.template.definition
com.adobe.solutions.rca.presentation.template.documents
com.adobe.solutions.rca.presentation.template.stages
com.adobe.solutions.rca.presentation.util
com.adobe.solutions.rca.service
com.adobe.solutions.rca.services.impl
com.adobe.solutions.rca.vo
com.adobe.solutions.rca.vo.um
com.adobe.viewsource
fl.accessibility
fl.containers
fl.controls
fl.controls.dataGridClasses
fl.controls.listClasses
fl.controls.progressBarClasses
fl.core
fl.data
fl.display
fl.events
fl.ik
fl.lang
fl.livepreview
fl.managers
fl.motion
fl.motion.easing
fl.rsl
fl.text
fl.transitions
fl.transitions.easing
fl.video
flash.accessibility
flash.concurrent
flash.crypto
flash.data
flash.desktop
flash.display
flash.display3D
flash.display3D.textures
flash.errors
flash.events
flash.external
flash.filesystem
flash.filters
flash.geom
flash.globalization
flash.html
flash.media
flash.net
flash.net.dns
flash.net.drm
flash.notifications
flash.permissions
flash.printing
flash.profiler
flash.sampler
flash.security
flash.sensors
flash.system
flash.text
flash.text.engine
flash.text.ime
flash.ui
flash.utils
flash.xml
flashx.textLayout
flashx.textLayout.compose
flashx.textLayout.container
flashx.textLayout.conversion
flashx.textLayout.edit
flashx.textLayout.elements
flashx.textLayout.events
flashx.textLayout.factory
flashx.textLayout.formats
flashx.textLayout.operations
flashx.textLayout.utils
flashx.undo
ga.controls
ga.layouts
ga.model
ga.uiComponents
ga.util
ga.views
ga.wrappers
lc.foundation
lc.foundation.domain
lc.foundation.events
lc.foundation.ui
lc.foundation.util
lc.preloader
lc.procmgmt
lc.procmgmt.commands
lc.procmgmt.domain
lc.procmgmt.events
lc.procmgmt.formbridge
lc.procmgmt.impl
lc.procmgmt.ui.attachments
lc.procmgmt.ui.controls
lc.procmgmt.ui.controls.card
lc.procmgmt.ui.controls.renderer
lc.procmgmt.ui.help
lc.procmgmt.ui.layout
lc.procmgmt.ui.presentationmodel
lc.procmgmt.ui.process
lc.procmgmt.ui.search
lc.procmgmt.ui.startpoint
lc.procmgmt.ui.task
lc.procmgmt.ui.task.form
lc.procmgmt.ui.task.form.commands
lc.procmgmt.ui.tracking
mx.accessibility
mx.automation
mx.automation.air
mx.automation.delegates
mx.automation.delegates.advancedDataGrid
mx.automation.delegates.charts
mx.automation.delegates.containers
mx.automation.delegates.controls
mx.automation.delegates.controls.dataGridClasses
mx.automation.delegates.controls.fileSystemClasses
mx.automation.delegates.core
mx.automation.delegates.flashflexkit
mx.automation.events
mx.binding
mx.binding.utils
mx.charts
mx.charts.chartClasses
mx.charts.effects
mx.charts.effects.effectClasses
mx.charts.events
mx.charts.renderers
mx.charts.series
mx.charts.series.items
mx.charts.series.renderData
mx.charts.styles
mx.collections
mx.collections.errors
mx.containers
mx.containers.accordionClasses
mx.containers.dividedBoxClasses
mx.containers.errors
mx.containers.utilityClasses
mx.controls
mx.controls.advancedDataGridClasses
mx.controls.dataGridClasses
mx.controls.listClasses
mx.controls.menuClasses
mx.controls.olapDataGridClasses
mx.controls.scrollClasses
mx.controls.sliderClasses
mx.controls.textClasses
mx.controls.treeClasses
mx.controls.videoClasses
mx.core
mx.core.windowClasses
mx.data
mx.data.crypto
mx.data.errors
mx.data.events
mx.data.messages
mx.data.mxml
mx.data.offline.errors
mx.data.utils
mx.effects
mx.effects.easing
mx.effects.effectClasses
mx.events
mx.filters
mx.flash
mx.formatters
mx.geom
mx.graphics
mx.graphics.codec
mx.graphics.shaderClasses
mx.logging
mx.logging.errors
mx.logging.targets
mx.managers
mx.messaging
mx.messaging.channels
mx.messaging.config
mx.messaging.errors
mx.messaging.events
mx.messaging.management
mx.messaging.messages
mx.modules
mx.netmon
mx.olap
mx.olap.aggregators
mx.preloaders
mx.printing
mx.resources
mx.rpc
mx.rpc.events
mx.rpc.http
mx.rpc.http.mxml
mx.rpc.livecycle
mx.rpc.mxml
mx.rpc.remoting
mx.rpc.remoting.mxml
mx.rpc.soap
mx.rpc.soap.mxml
mx.rpc.wsdl
mx.rpc.xml
mx.skins
mx.skins.halo
mx.skins.spark
mx.skins.wireframe
mx.skins.wireframe.windowChrome
mx.states
mx.styles
mx.utils
mx.validators
org.osmf.containers
org.osmf.display
org.osmf.elements
org.osmf.events
org.osmf.layout
org.osmf.logging
org.osmf.media
org.osmf.metadata
org.osmf.net
org.osmf.net.dvr
org.osmf.net.httpstreaming
org.osmf.net.metrics
org.osmf.net.qos
org.osmf.net.rtmpstreaming
org.osmf.net.rules
org.osmf.traits
org.osmf.utils
spark.accessibility
spark.automation.delegates
spark.automation.delegates.components
spark.automation.delegates.components.gridClasses
spark.automation.delegates.components.mediaClasses
spark.automation.delegates.components.supportClasses
spark.automation.delegates.skins.spark
spark.automation.events
spark.collections
spark.components
spark.components.calendarClasses
spark.components.gridClasses
spark.components.mediaClasses
spark.components.supportClasses
spark.components.windowClasses
spark.core
spark.effects
spark.effects.animation
spark.effects.easing
spark.effects.interpolation
spark.effects.supportClasses
spark.events
spark.filters
spark.formatters
spark.formatters.supportClasses
spark.globalization
spark.globalization.supportClasses
spark.layouts
spark.layouts.supportClasses
spark.managers
spark.modules
spark.preloaders
spark.primitives
spark.primitives.supportClasses
spark.skins
spark.skins.mobile
spark.skins.mobile.supportClasses
spark.skins.spark
spark.skins.spark.mediaClasses.fullScreen
spark.skins.spark.mediaClasses.normal
spark.skins.spark.windowChrome
spark.skins.wireframe
spark.skins.wireframe.mediaClasses
spark.skins.wireframe.mediaClasses.fullScreen
spark.transitions
spark.utils
spark.validators
spark.validators.supportClasses
xd.core.axm.enterprise.view.components
xd.core.axm.enterprise.view.skins
xd.core.axm.view.components
xd.core.axm.view.components.support

Language Elements

Global Constants
Global Functions
Operators
Statements, Keywords & Directives
Special Types

Appendixes

What's New
Compiler Errors
Compiler Warnings
Run-Time Errors
Migrating to ActionScript 3
Supported Character Sets
MXML Only Tags
Motion XML Elements
Timed Text Tags
List of deprecated elements
Accessibility Implementation Constants
How to Use ActionScript Examples
Legal notices
Packageflash.display
Classpublic class NativeWindow
InheritanceNativeWindow Inheritance EventDispatcher Inheritance Object

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

The NativeWindow class provides an interface for creating and controlling native desktop windows.

AIR profile support: This feature is supported on all desktop operating systems, but is not supported on mobile devices or AIR for TV devices. You can test for support at run time on desktop devices using the NativeWindow.isSupported property. See AIR Profile Support for more information regarding API support across multiple profiles.

A reference to the NativeWindow instance is returned by the window constructor. A reference to a NativeWindow instance can also be accessed using the stage.nativeWindow property of any display object on that window's stage:

var window:NativeWindow = displayObject.stage.nativeWindow;

The properties of a NativeWindow instance can only be accessed by application content. If non-application content attempts to access the NativeWindow object, a security error will be thrown.

Content can be added to a window using the DisplayObjectContainer methods of the Stage object such as addChild().

You cannot not add Flex components directly to the display list of a NativeWindow instance. Instead, use the Flex mx:WindowedApplication and mx:Window components to create your windows and add the other Flex components as children of those objects. You can add Flex-based SWF content directly to a NativeWindow window as long as the SWF file is loaded into its own application domain and is application content.

To create a root HTML window for displaying HTML content it is typically easier to create the window with HTMLLoader.createRootWindow(). Windows created in this way will have an HTMLLoader object added automatically. (From JavaScript code, you can also use the JavaScript window.open() function. However, this method gives you less control over the window appearance and behavior.)

The following operations on NativeWindow objects are asynchronous: close(), maximize(), minimize(), restore(), and bounds changes. An application can detect when these operations have completed by listening for the appropriate events.

If the NativeApplication.autoExit property is true, which is the default, the application will close when its last window is closed (and all close event handlers have returned). If autoExit is false, then NativeApplication.nativeApplication.exit() must be called to terminate the application.

NativeWindow objects will not be garbage collected after the window constructor has been called and before close() has been called. It is the responsibility of the application to close its own windows.

Related API Elements



Public Properties
 PropertyDefined By
      active : Boolean
[read-only] Indicates whether this window is the active application window.
NativeWindow
      alwaysInFront : Boolean
Specifies whether this window will always be in front of other windows (including those of other applications).
NativeWindow
      bounds : Rectangle
The size and location of this window.
NativeWindow
      closed : Boolean
[read-only] Indicates whether this window has been closed.
NativeWindow
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
      displayState : String
[read-only] The display state of this window.
NativeWindow
      height : Number
The height of this window in pixels.
NativeWindow
      isSupported : Boolean
[static] [read-only] Indicates whether native windows are supported on the client system.
NativeWindow
      maximizable : Boolean
[read-only] Reports the maximizable setting used to create this window.
NativeWindow
      maxSize : Point
The maximum size for this window.
NativeWindow
      menu : NativeMenu
The native menu for this window.
NativeWindow
      minimizable : Boolean
[read-only] Reports the minimizable setting used to create this window.
NativeWindow
      minSize : Point
The minimum size for this window.
NativeWindow
      owner : NativeWindow
[read-only] The NativeWindow object that owns this window.
NativeWindow
      renderMode : String
[read-only] Reports the window renderMode setting used to create this window.
NativeWindow
      resizable : Boolean
[read-only] Reports the resizable setting used to create this window.
NativeWindow
      stage : Stage
[read-only] The Stage object for this window.
NativeWindow
      supportsMenu : Boolean
[static] [read-only] Indicates whether AIR supports native window menus on the current computer system.
NativeWindow
      supportsNotification : Boolean
[static] [read-only] Indicates whether AIR supports window notification cueing on the current computer system.
NativeWindow
      supportsTransparency : Boolean
[static] [read-only] Indicates whether AIR supports native windows with transparent pixels.
NativeWindow
      systemChrome : String
[read-only] Reports the system chrome setting used to create this window.
NativeWindow
      systemMaxSize : Point
[static] [read-only] The largest window size allowed by the operating system.
NativeWindow
      systemMinSize : Point
[static] [read-only] The smallest window size allowed by the operating system.
NativeWindow
      title : String
The window title.
NativeWindow
      transparent : Boolean
[read-only] Reports the transparency setting used to create this window.
NativeWindow
      type : String
[read-only] Reports the window type setting used to create this window.
NativeWindow
      visible : Boolean
Specifies whether this window is visible.
NativeWindow
      width : Number
The width of this window in pixels.
NativeWindow
      x : Number
The horizontal axis coordinate of this window's top left corner relative to the origin of the operating system desktop.
NativeWindow
      y : Number
The vertical axis coordinate of this window's top left corner relative to the upper left corner of the operating system's desktop.
NativeWindow
Public Methods
 MethodDefined By
  
Creates a new NativeWindow instance and a corresponding operating system window.
NativeWindow
  
    activate():void
Activates this window.
NativeWindow
 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
  
    close():void
Closes this window.
NativeWindow
 Inherited
Dispatches an event into the event flow.
EventDispatcher
  
    globalToScreen(globalPoint:Point):Point
Converts a point in pixel coordinates relative to the origin of the window stage (a global point in terms of the display list), to a point on the virtual desktop.
NativeWindow
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 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
  
Returns a list of the NativeWindow objects that are owned by this window.
NativeWindow
  
    maximize():void
Maximizes this window.
NativeWindow
  
    minimize():void
Minimizes this window.
NativeWindow
  
    notifyUser(type:String):void
Triggers a visual cue through the operating system that an event of interest has occurred.
NativeWindow
  
Sends this window directly behind the specified window.
NativeWindow
  
Brings this window directly in front of the specified window.
NativeWindow
  
Sends this window behind any other visible windows.
NativeWindow
  
Brings this window in front of any other visible windows.
NativeWindow
 Inherited
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
  
    restore():void
Restores this window from either a minimized or a maximized state.
NativeWindow
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
    startMove():Boolean
Starts a system-controlled move of this window.
NativeWindow
  
    startResize(edgeOrCorner:String = "BR"):Boolean
Starts a system-controlled resize operation of this window.
NativeWindow
 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
 Inherited
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
  
    activate
Dispatched by this NativeWindow object after the window has been activated.NativeWindow
  
    close
Dispatched by this NativeWindow object after the window has been closed.NativeWindow
  
    closing
Dispatched by this NativeWindow object immediately before the window is to be closed.NativeWindow
  
    deactivate
Dispatched by this NativeWindow object after the window has been deactivated.NativeWindow
  Dispatched by this NativeWindow object after the window's displayState property has changed.NativeWindow
  Dispatched by this NativeWindow object immediately before the window changes its display state.NativeWindow
  
    move
Dispatched by this NativeWindow object after the window has been moved on the desktop.NativeWindow
  
    moving
Dispatched by the NativeWindow object immediately before the window is to be moved on the desktop.NativeWindow
  
    resize
Dispatched by this NativeWindow object after the window has been resized.NativeWindow
  
    resizing
Dispatched by this NativeWindow object immediately before the window is to be resized on the desktop.NativeWindow
Property Detail
    

active

property
active:Boolean  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Indicates whether this window is the active application window.

Use the activate() method to make a window active.



Implementation
    public function get active():Boolean

Related API Elements

    

alwaysInFront

property 
alwaysInFront:Boolean

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Specifies whether this window will always be in front of other windows (including those of other applications).

There are two groups of windows in the system depth order. Windows in the alwaysInFront group are always displayed in front of all other windows. Depth ordering between windows within the same group is determined normally. In other words, activating a window will bring it in front of other windows in its group.

Changing alwaysInFront from false to true will bring the window to the top of all other windows. Changing the property from true to false will send the window to the back of "alwaysInFront" windows, but still in front of other windows. Setting the property to its current value will not change the window depth order. Setting the alwaysInFront property of a window that has an owner has no effect.

The alwaysInFront property should rarely be set to true since windows with this setting will appear in front of the windows of other applications even when the other application is active.

OS behavior notes:

  • Some Linux window managers do not display windows that have the alwaysInFront property set to in front of fullscreen windows.
  • On Mac® OS X, setting alwaysInFront to true will have no effect when the displayState property of the window stage is fullScreen or fullScreenInteractive.



Implementation
    public function get alwaysInFront():Boolean
    public function set alwaysInFront(value:Boolean):void

Example  ( How to use this example )
The following examples force a window to be displayed in front of all other windows (that are not similarly forced to the front):
windowObj.alwaysInFront = true;
With a reference to a display object on the window stage:
displayObject.stage.nativeWindow.alwaysInFront=true;
From a JavaScript routine running in an HTMLLoader object in the window (or a root HTML window):
window.nativeWindow.alwaysInFront = true;
    

bounds

property 
bounds:Rectangle

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

The size and location of this window.

The dimensions of a window include any system chrome. The dimensions of a window's stage are equal to the dimensions of the window, minus the size of any system chrome. Changing the width and height of the window will change the stage's stageWidth and stageHeight. The reverse also applies; changing the stage dimensions will change the window size.

In a root HTML window, the outerWidth and outerHeight properties are equivalent to the window height and width properties. The innerWidth and innerHeight properties equal the stage.stageWidth and stage.stageHeight properties minus the thickness of any automatic scrollbars displayed by the window.

A resize event is dispatched whenever the width or height of this window changes. Likewise, a move event is dispatched whenever the origin (x,y) of this window changes. On Mac OS and Windows, setting the bounds property directly will not dispatch a moving or resizing event. However, on Linux the NativeWindow does dispatch a moving and resizing events when you set the bounds property.

Setting the bounds property of a window is equivalent to setting its x, y, width, and height properties. Likewise, setting any of the individual dimensions is equivalent to setting the bounds property. When you set all the dimensions at the same time by using the bounds property, fewer events are dispatched.

The order in which the individual dimensions are set is not guaranteed. On Linux window managers that do not allow windows to extend off the desktop area, a change to an individual property may be blocked even though the net affect of applying all the property changes would have resulted in a legal window.

If the width or height specified is less than the minimum or greater than the maximum allowed width or height, then the window width or height is set to the closest legal size. The factors that determine the minimum and maximum width and height are the following:

  • The minSize and maxSize properties of the NativeWindow object
  • The minimum and maximum operating system limits, which are the values of NativeWindow.systemMinSize and NativeWindow.systemMaxSize.
  • The maximum width and height of a window in Adobe AIR, which are each 4095 pixels. (In AIR 1.5 and earlier, the maximum width and height of a window is 2880 pixels each.)
  • The minimum width and height required by any displayed system chrome.

Pixel values are rounded to the nearest integer when the position or dimensions of a window are changed.



Implementation
    public function get bounds():Rectangle
    public function set bounds(value:Rectangle):void

Throws
ArgumentError — If the rectangle is null or contains invalid values.
 
IllegalOperationError — If the bounds property is accessed after this window has been closed.

Related API Elements


Example  ( How to use this example )
The following examples set the bounds of a window with a reference to a NativeWindow object:
windowObj.bounds = new Rectangle(200, 200, 1000, 800);
With a reference to a display object on the window stage:
displayObject.stage.nativeWindow.bounds = new Rectangle(20, 20, 800, 600);
From a JavaScript routine running in an HTMLLoader object in the window (or a root HTML window):
window.nativeWindow.bounds = new air.Rectangle(20, 20, 800, 600);
    

closed

property 
closed:Boolean  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Indicates whether this window has been closed.

Accessing the following properties on a closed window will throw an illegal operation error:

  • title
  • bounds
  • x, y, width, height
  • displayState
  • visible

Likewise, calling the following methods on a closed window will also throw an illegal operation error:

  • minimize()
  • maximize()
  • restore()
  • startResize()
  • startMove()



Implementation
    public function get closed():Boolean

Example  ( How to use this example )
The following examples show how to access the closed property of a window:
var isWindowClosed:Boolean = windowObj.closed;
With a reference to a display object on the window stage:
var isWindowClosed:Boolean = displayObject.stage.nativeWindow.closed;
From a JavaScript routine running in an HTMLLoader object in the window (or root HTML window):
var isWindowClosed = window.nativeWindow.closed;
    

displayState

property 
displayState:String  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

The display state of this window.

Constants for the possible values are defined in the NativeWindowDisplayState class:

  • NativeWindowDisplayState.NORMAL
  • NativeWindowDisplayState.MINIMIZED
  • NativeWindowDisplayState.MAXIMIZED



Implementation
    public function get displayState():String

Throws
IllegalOperationError — If the displayState property is accessed after this window has been closed.

Related API Elements


Example  ( How to use this example )
The following example shows how to get the current window display state given a reference to the window object:
var state:String = windowObj.displayState;
    

height

property 
height:Number

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

The height of this window in pixels.

The dimensions of a window include any system window chrome that is displayed. The height of the usable display area inside a window is available from the Stage.stageHeight property.

Changing the height property of a window is equivalent to changing the height through the bounds property.

If the height specified is less than the minimum or greater than the maximum allowed height, then the window height is set to the closest legal size. The factors that determine the minimum and maximum height are the following:

  • The minSize.x and maxSize.x properties of the NativeWindow object
  • The minimum and maximum operating system limits, which are the values of NativeWindow.systemMinSize.x and NativeWindow.systemMaxSize.x.
  • The maximum height of a window in Adobe AIR, which is 4095 pixels (2880 pixels in AIR 1.5 and earlier).

On Linux, setting the height property is an asynchronous operation.

To detect the completion of the height change, listen for the resize event, which is dispatched on all platforms.

Pixel values are rounded to the nearest integer when the height of a window is changed.



Implementation
    public function get height():Number
    public function set height(value:Number):void

Throws
ArgumentError — If the value set is null or invalid.
 
IllegalOperationError — If the property is accessed after this window has been closed.

Related API Elements

    

isSupported

property 
isSupported:Boolean  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 2.0

Indicates whether native windows are supported on the client system.



Implementation
    public static function get isSupported():Boolean
    

maximizable

property 
maximizable:Boolean  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Reports the maximizable setting used to create this window.

The maximizable setting cannot be changed after a window is created.

Note: Some Linux window managers allow windows to be maximized by the user even when the maximizable property is set to false.



Implementation
    public function get maximizable():Boolean

Throws
SecurityError — When trying to set to false without sufficient privilege.
 
IllegalOperationError — If the property is accessed after this window has been closed.

Related API Elements

    

maxSize

property 
maxSize:Point

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

The maximum size for this window.

The size limit is specified as the coordinates of a Point object. The point x property corresponds to the window width, the y property to the window height.

The maxSize restriction is enforced for window resizing operations invoked both through ActionScript code and through the operating system.

Setting maxSize will change the window bounds if the current bounds are larger than the new maximum size.

If the width or height specified is greater than the maximum allowed width or height, then the window width is set to the closest legal size. The factors that determine the minimum and maximum width and height are the following:

  • The maximum operating system limit, which is the value NativeWindow.systemMaxSize.
  • The maximum width and height of a window in Adobe AIR, which is 4095 pixels for each. (In AIR 1.5 and earlier, the maximum width and height of a window is 2880 pixels each.)

Note: On some operating systems, such as Mac OS X, maximizing a window will only enlarge the window to the maxSize value even if the maximized window will be smaller than the operating system screen. The window will still be in the maximized display state.



Implementation
    public function get maxSize():Point
    public function set maxSize(value:Point):void

Throws
IllegalOperationError — If assigned size is not within the operating system minimum and maximum window sizes.
 
SecurityError — If size is forbidden for the content's current privilege.
 
ArgumentError — If the size is null or contains invalid values.
 
IllegalOperationError — If the maxSize property is accessed after this window has been closed.

Related API Elements


Example  ( How to use this example )
The following examples show how to set the maximum allowed size for a window.
windowObj.maxSize = new Point(1040,920);
With a reference to a display object on the window stage:
displayObject.stage.nativeWindow.maxSize = new Point(800,600);
From a JavaScript routine running in an HTMLLoader object in a window (or in a root HTML window):
window.nativeWindow.maxSize = new air.Point(960,960);
    

menu

property 
menu:NativeMenu

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

The native menu for this window.

When a NativeMenu object is assigned to the window menu property, a native menu will be displayed for a window if NativeWindow.supportsMenu is true, unless the window systemChrome property is NativeWindowSystemChrome.NONE.

Note: Assigning a menu to a window when NativeWindow.supportsMenu is false or when the window systemChrome property is NativeWindowSystemChrome.NONE is allowed, but does nothing. Be sure to use the NativeWindow.supportsMenu property to determine whether the operating system supports window menus. Using other means (such as Capabilities.os) to determine support can lead to programming errors (if some possible target operating systems are not considered).



Implementation
    public function get menu():NativeMenu
    public function set menu(value:NativeMenu):void

Related API Elements

    

minimizable

property 
minimizable:Boolean  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Reports the minimizable setting used to create this window.

The minimizable setting cannot be changed after a window is created.

Note: Some Linux window managers allow windows to be minimizable by the user even when the minimizable property is set to false.



Implementation
    public function get minimizable():Boolean

Throws
SecurityError — When trying to set to false without sufficient privilege.
 
IllegalOperationError — If the property is accessed after this window has been closed.

Related API Elements

    

minSize

property 
minSize:Point

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

The minimum size for this window.

The size limit is specified as the coordinates of a Point object. The point x property corresponds to the window width, the y property to the window height.

Setting minSize, will change the window bounds if the current bounds are smaller than the new minimum size.

The minSize restriction is enforced for window resizing operations invoked both through ActionScript code and through the operating system.

Note: The width and height of any displayed system chrome may make it impossible to set a window as small as the specified minimum size.



Implementation
    public function get minSize():Point
    public function set minSize(value:Point):void

Throws
IllegalOperationError — If the assigned size is not within the operating system minimum and maximum window sizes.
 
SecurityError — If size is forbidden for the content's current privilege.
 
ArgumentError — If the size is null or contains invalid values.
 
IllegalOperationError — if the minSize property is accessed after this window has been closed.

Related API Elements


Example  ( How to use this example )
The following examples show how to set the minimum allowed size for a window:
windowObj.minSize = new Point(200,80);
With a reference to a display object on the window stage:
displayObject.stage.nativeWindow.minSize = new Point(120,60);
From a JavaScript routine running in an HTMLLoader object in a window (or in a root HTML window):
window.nativeWindow.minSize = new air.Point(80,60);
    

owner

property 
owner:NativeWindow  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 2.6

The NativeWindow object that owns this window.

Window ownership is established when a window is created and cannot be changed. To create a window that has an owner, set the owning NativeWindow object as the owner property of the NativeWindowInitOptions object used to create the owned window.

Note: On Linux, some window managers do not display owned windows in front of the owning window when the owner is in fullscreen mode.



Implementation
    public function get owner():NativeWindow

Related API Elements

    

renderMode

property 
renderMode:String  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 3.0

Reports the window renderMode setting used to create this window.

The value returned by NativeWindow.renderMode will be one of the constants defined in the NativeWindowRenderMode class.

The renderMode setting cannot be changed after a window is created.



Implementation
    public function get renderMode():String

Throws
IllegalOperationError — If the property is accessed after this window has been closed.

Related API Elements

    

resizable

property 
resizable:Boolean  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Reports the resizable setting used to create this window.

The resizable setting cannot be changed after a window is created.



Implementation
    public function get resizable():Boolean

Throws
SecurityError — When trying to set to false without sufficient privilege.
 
IllegalOperationError — If the property is accessed after this window has been closed.

Related API Elements

    

stage

property 
stage:Stage  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

The Stage object for this window. The Stage object is the root object in the display list architecture used in ActionScript 3.0-based SWF content.

The stage is the root of the display list for the window. Add visual display objects to a window by adding them to the stage or to another object already in the display list of this stage. The stage dimensions are those of the window client area when the window uses system chrome. The stage dimensions are equal to the dimensions of the window if system chrome is not used.



Implementation
    public function get stage():Stage

Related API Elements


Example  ( How to use this example )
The following example shows how to set stage properties for a NativeWindow instance:
import flash.display.StageAlign;

windowObj.stage.align = StageAlign.TOP_LEFT;
    

supportsMenu

property 
supportsMenu:Boolean  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Indicates whether AIR supports native window menus on the current computer system.

When NativeWindow.supportsMenu is true, a native menu will be displayed for a window when a NativeMenu object is assigned to the window menu property (unless the window systemChrome property is NativeWindowSystemChrome.NONE). Be sure to use the NativeWindow.supportsMenu property to determine whether the operating system native window menus. Using other means (such as Capabilities.os) to determine support can lead to programming errors (if some possible target operating systems are not considered).

Note: Assigning a menu to a window when NativeWindow.supportsMenu is false or when the window systemChrome property is NativeWindowSystemChrome.NONE is allowed, but does nothing.



Implementation
    public static function get supportsMenu():Boolean

Related API Elements

    

supportsNotification

property 
supportsNotification:Boolean  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Indicates whether AIR supports window notification cueing on the current computer system.

When NativeWindow.supportsNotification is true, calling the window's notifyUser() method will result in a visual cue to the user that an event of interest has occurred. This visual cue will conform to the operating system convention of the native system. For example, on Windows®, the task bar icon will flash.

Note: Calling notifyUser() when NativeWindow.supportsNotification is false is allowed, but does nothing.



Implementation
    public static function get supportsNotification():Boolean

Related API Elements

    

supportsTransparency

property 
supportsTransparency:Boolean  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.1

Indicates whether AIR supports native windows with transparent pixels.

When NativeWindow.supportsTransparency is true, transparency in pixels of a native window will be honored, if the window transparent property is set to true. Opacity of all pixels will be set to 1 if NativeWindow.supportsTransparency is false, regardless of the value of the window transparent property. Fully transparent pixels will render as black when NativeWindow.supportsTransparency is false. Be sure to use the NativeWindow.supportsTransparency property to determine whether the operating system supports transparency. Using other means (such as Capabilities.os) to determine support can lead to programming errors (if some possible target operating systems are not considered).

Note: The value of this property might change while an application is running, based on user preferences set for the operating system.



Implementation
    public static function get supportsTransparency():Boolean

Related API Elements

    

systemChrome

property 
systemChrome:String  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Reports the system chrome setting used to create this window.

The values returned by NativeWindow.systemChrome will be one of the constants defined in the NativeWindowSystemChrome class.

The system chrome setting cannot be changed after a window is created.



Implementation
    public function get systemChrome():String

Throws
SecurityError — When trying to set to false without sufficient privilege.
 
IllegalOperationError — If the property is accessed after this window has been closed.

Related API Elements


Example  ( How to use this example )
The following example shows how to get the system chrome type for a window:
var sysChromeType:String = windowObj.systemChrome;
With a reference to a display object on the window stage:
var sysChromeType:String = displayObject.stage.nativeWindow.systemChrome;
From a JavaScript routine running in an HTMLLoader object in the window (or root HTML window):
var sysChromeType = window.nativeWindow.systemChrome;
The following example shows how to change the apparent system chrome and transparency settings by creating a new window and moving all child display objects to the new window:
import flash.display.NativeWindow;
import flash.display.NativeWindowSystemChrome;
import flash.display.NativeWindowInitOptions;

public function deChromeWindow(oldWindow:NativeWindow):NativeWindow{
    if(oldWindow.systemChrome != NativeWindowSystemChrome.NONE){
        var newOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
        newOptions.systemChrome = NativeWindowSystemChrome.NONE;
        newOptions.transparent = true;
        
        var newWindow:NativeWindow = new NativeWindow(newOptions);
        newWindow.stage.stageWidth = oldWindow.stage.stageWidth;
        newWindow.stage.stageHeight = oldWindow.stage.stageHeight;
        newWindow.stage.align = oldWindow.stage.align;
        newWindow.stage.scaleMode = oldWindow.stage.scaleMode;
        
        for(var i:int = 0; i < oldWindow.stage.numChildren; i++){
            newWindow.stage.addChild(oldWindow.stage.getChildAt(i));
        }
        newWindow.activate();
        oldWindow.close();
        
        return newWindow;
    }
    return oldWindow;
}

    

systemMaxSize

property 
systemMaxSize:Point  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

The largest window size allowed by the operating system.

The size limit is specified as the coordinates of a Point object. The point x property corresponds to the window width, the y property to the window height.

In addition to the operating system size limit, AIR has a maximum window size limit of 4095 by 4095 pixels (2880 pixels by 2880 pixels in AIR 1.5 and earlier). And an application can set a limit using the maxSize property of the NativeWindow object.



Implementation
    public static function get systemMaxSize():Point
    

systemMinSize

property 
systemMinSize:Point  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

The smallest window size allowed by the operating system.

The size limit is specified as the coordinates of a Point object. The point x property corresponds to the window width, the y property to the window height.



Implementation
    public static function get systemMinSize():Point
    

title

property 
title:String

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

The window title.

The title will appear in the system chrome for the window, if displayed, as well as in other system-dependent locations (such as the task bar).



Implementation
    public function get title():String
    public function set title(value:String):void

Throws
IllegalOperationError — If the property is accessed after this window has been closed.

Example  ( How to use this example )
The following example sets the title of a window object:
windowObj.title = "Window Title";
    

transparent

property 
transparent:Boolean  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Reports the transparency setting used to create this window.

The transparent property cannot be changed after a window is created. Transparency affects both the visual appearance and the mouse behavior of the window. On Windows and Mac OS X, the window will not capture mouse events when the alpha value of the pixel is below a certain threshold, which varies between about .06 and .01 depending on the operating system. On Linux, the the window will capture mouse events above completely transparent areas and therefore will prevent users from accessing other windows and items on the desktop.

Note: Window transparency cannot always be supported. If the user's operating system configuration is such that transparency is not available, the window will be created without transparency. Areas that would have been transparent are composited against black. Use the NativeWindow.supportsTransparency property to determine whether window transparency is supported.



Implementation
    public function get transparent():Boolean

Throws
SecurityError — When trying to set to false without sufficient privilege.
 
IllegalOperationError — If the property is accessed after this window has been closed.

Related API Elements

    

type

property 
type:String  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Reports the window type setting used to create this window.

The values returned by NativeWindow.type will be one of the constants defined in the NativeWindowType class.

The type setting cannot be changed after a window is created.



Implementation
    public function get type():String

Throws
SecurityError — When trying to set to false without sufficient privilege.
 
IllegalOperationError — If the property is accessed after this window has been closed.

Related API Elements

    

visible

property 
visible:Boolean

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Specifies whether this window is visible.

An invisible window is not displayed on the desktop, but all window properties and methods are valid.

By default, visible is set to false. To display a window, set visible to true or call NativeWindow.activate().

If this window has an owner, the visible state of that owning window determines whether this window is displayed. If the owning window is not displayed, then any owned windows are not displayed, even if their visible properties are true.

Note: On Mac OS X, setting visible=false on a minimized window will not remove the window icon from the dock. If a user subsequently clicks the dock icon, the window will return to the visible state and be displayed on the desktop.



Implementation
    public function get visible():Boolean
    public function set visible(value:Boolean):void

Throws
SecurityError — When trying to set to false without sufficient privilege.
 
IllegalOperationError — If the property is accessed after this window has been closed.

Related API Elements


Example  ( How to use this example )
The following examples show how to access the visible property of a window:
windowObj.visible = true;
With a reference to a display object on the window stage:
displayObj.stage.nativeWindow.visible = true;
From a JavaScript routine running in an HTMLLoader object in the window (or root HTML window):
window.nativeWindow.visible = true;
    

width

property 
width:Number

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

The width of this window in pixels.

The dimensions reported for a native window include any system window chrome that is displayed. The width of the usable display area inside a window is available from the Stage.stageWidth property.

Changing the width property of a window is equivalent to changing the width through the bounds property.

If the width specified is less than the minimum or greater than the maximum allowed width, then the window width is set to the closest legal size. The factors that determine the minimum and maximum width are the following:

  • The minSize.y and maxSize.y properties of the NativeWindow object
  • The minimum and maximum operating system limits, which are the values of NativeWindow.systemMinSize.y and NativeWindow.systemMaxSize.y.
  • The maximum width of a window in Adobe AIR, which is 4095 pixels (2880 pixels in AIR 1.5 and earlier).

On Linux, setting the width property is an asynchronous operation.

To detect the completion of the width change, listen for the resize event, which is dispatched on all platforms.

Pixel values are rounded to the nearest integer when the width of a window is changed.



Implementation
    public function get width():Number
    public function set width(value:Number):void

Throws
ArgumentError — If the value set is null or invalid.
 
IllegalOperationError — If the property is accessed after this window has been closed.

Related API Elements

    

x

property 
x:Number

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

The horizontal axis coordinate of this window's top left corner relative to the origin of the operating system desktop.

On systems with more than one monitor, x can be negative. If you save the value, perhaps to reposition a window at its previous location, you should always verify that the window is placed in a usable location when the position is restored. Changes in screen resolution or monitor arrangement can can result in a window being placed off screen. Use the Screen class to obtain information about the desktop geometry.

Changing the x property of a window is equivalent to changing the location through the bounds property.

On Linux, setting the x property is an asynchronous operation.

To detect the completion of the position change, listen for the move event, which is dispatched on all platforms.

Pixel values are rounded to the nearest integer when the x-coordinate of a window is changed.



Implementation
    public function get x():Number
    public function set x(value:Number):void

Throws
ArgumentError — If the value set is null or invalid.
 
IllegalOperationError — If the property is accessed after this window has been closed.

Related API Elements

    

y

property 
y:Number

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

The vertical axis coordinate of this window's top left corner relative to the upper left corner of the operating system's desktop.

On systems with more than one monitor, y can be negative. If you save the value, perhaps to reposition a window at its previous location, you should always verify that the window is placed in a usable location when the position is restored. Changes in screen resolution or monitor arrangement can can result in a window being placed off screen. Use the Screen class to obtain information about the desktop geometry.

Changing the y property of a window is equivalent to changing the location through the bounds property.

On Linux, setting the y property is an asynchronous operation.

To detect the completion of the position change, listen for the move event, which is dispatched on all platforms.

Pixel values are rounded to the nearest integer when the y-coordinate of a window is changed.



Implementation
    public function get y():Number
    public function set y(value:Number):void

Throws
ArgumentError — If the value set is null or invalid.
 
IllegalOperationError — If the property is accessed after this window has been closed.

Related API Elements

Constructor Detail
    

NativeWindow

()Constructor
public function NativeWindow(initOptions:NativeWindowInitOptions)

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Creates a new NativeWindow instance and a corresponding operating system window.

The settings defined in the initOptions parameter cannot be changed after the window is created. Invalid initOptions settings will cause an illegal operation error to be thrown. Settings that are valid but not available on the current system will not throw an exception. The window capabilities specific to the current operating system can be detected, if desired, using the static NativeWindow members such as systemMaxSize.

The default window size is determined by the operating system, and windows are created in an invisible state. To prevent changes to the window from being visible, do not change the window visible property to true or call activate() until the window changes are finished.

Parameters
initOptions:NativeWindowInitOptions — An object containing the initialization properties for this window.

Throws
IllegalOperationError — If the initOptions parameter is invalid.

Related API Elements


Example  ( How to use this example )

The following example creates and activates a new NativeWindow instance:
import flash.display.NativeWindowInitOptions;
import flash.display.NativeWindowSystemChrome;
import flash.display.NativeWindowType;
import flash.display.NativeWindow;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.geom.Rectangle;

var windowOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
windowOptions.systemChrome = NativeWindowSystemChrome.STANDARD;
windowOptions.type = NativeWindowType.NORMAL;

var newWindow:NativeWindow = new NativeWindow(windowOptions);
newWindow.stage.scaleMode = StageScaleMode.NO_SCALE;
newWindow.stage.align = StageAlign.TOP_LEFT;
newWindow.bounds = new Rectangle(100, 100, 800, 800);

newWindow.activate();
Method Detail

    activate

()method
public function activate():void

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Activates this window.

Activating a window will:

  • Make the window visible
  • Bring the window to the front
  • Give the window keyboard and mouse focus

On Linux, activate() is an asynchronous operation.

The NativeWindow object dispatches an activate event on all platforms.

Related API Elements


Example  ( How to use this example )

The following examples show how to activate a window.

With a reference to a display object on the window stage:

displayObject.stage.nativeWindow.activate();

With a reference to an instance of the NativeWindow class:
windowObj.activate();

From JavaScript in an HTML page rendered in the window (where window is the global JavaScript window object):
window.nativeWindow.activate();

    close

()method 
public function close():void

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Closes this window.

A close event is dispatched as soon as the close operation is complete. A closing event will not be dispatched. If cancellation of the close operation should be allowed, dispatch a closing event and check whether any registered listeners cancel the default behavior before calling the close() method.

When a window is closed, any windows that it owns are also closed. The owned windows do not dispatch closing events.

If display object instances that are currently in the window are not referenced elsewhere they will be garbage collected and destroyed, except on the initial application window created by AIR. To allow display objects on the initial window to be garbage collected, remove them from the window stage.

After being closed, the NativeWindow object is still a valid reference, but accessing most properties and methods will throw an illegal operation error.

Closed windows cannot be reopened. If the window is already closed, no action is taken and no events are dispatched.

Note: to hide a window without closing it, set the window's visible property to false.

Related API Elements


Example  ( How to use this example )

The following examples show how to close a window:

With a reference to the NativeWindow instance (windowObj):

windowObj.close();


With a reference to a display object on the window stage:
displayObj.stage.nativeWindow.close();

From a JavaScript routine running in an HTMLLoader object (or HTML root window):
window.close(); //overriddable in HTMLHost

Or:
window.nativeWindow.close(); //not overriddable

The following example illustrates how to allow cancellation of a close operation (where windowObj is the NativeWindow instance to be closed):
public function closeCommand():Boolean{
    var closeEvent:Event = new Event(Event.CLOSING,true,true);
    windowObj.dispatchEvent(closeEvent);
    if(!closeEvent.isDefaultPrevented()){
        windowObj.close();
        return true;
    } else {
      return false;
    }
}

The following example illustrates how to close a window from a JavaScript routine running in an HTMLLoader object (or HTML root window), while allowing the operation to be canceled:
<script src="AIRAliases.js" type="text/javascript"></script>
<script type="text/javascript">
    var dirtyData = false;
    function closeWindow(){
            var closingEvent = new air.Event(air.Event.CLOSING,true,true);
            window.nativeWindow.dispatchEvent(closingEvent);
               if(!closingEvent.isDefaultPrevented()){
                   window.nativeWindow.close();
                //or use: window.close(); 
               return true;
           } else {
               return false;
        }
    }
        
    function onClosing(event){
        if(dirtyData){
            event.preventDefault();
            //Save data...
        }
    }    

    window.nativeWindow.addEventListener(air.Event.CLOSING,onClosing);        
</script>

    globalToScreen

()method 
public function globalToScreen(globalPoint:Point):Point

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Converts a point in pixel coordinates relative to the origin of the window stage (a global point in terms of the display list), to a point on the virtual desktop.

Virtual desktop coordinates are relative to the upper, lefthand corner of the primary monitor.

Parameters

globalPoint:Point — The point on the stage to convert to a point on the screen.

Returns
Point — The specified global point relative to the desktop.

Related API Elements

    listOwnedWindows

()method 
public function listOwnedWindows():Vector.<NativeWindow>

Language Version: ActionScript 3.0
Runtime Versions: AIR 2.6

Returns a list of the NativeWindow objects that are owned by this window.

You cannot change ownership of NativeWindows by adding or removing objects from the returned vector. Window ownership cannot be changed after a window is created.

Returns
Vector.<NativeWindow> — an Vector.<NativeWindow> object containing zero or more NativeWindow objects that are owned by this instance.

Related API Elements

    maximize

()method 
public function maximize():void

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Maximizes this window.

Calling maximize() method dispatches a displayStateChange event, and, if applicable, a move and a resize event. Whereas system chrome will dispatch a displayStateChanging event that can be canceled when a maximize command is initiated by a user, your maximize logic must implement this behavior, if desired.

The maximize() method executes asynchronously. To detect the completion of the state change, listen for the displayStateChange event. If the window is already maximized, no action is taken and no events are dispatched.

OS behavior notes:

  • On operating systems, such as Mac OS X, in which maximizing a window does not also prevent resizing, calling maximize() will zoom the window to fill the screen, but will not prevent subsequent resizing of the window. Resizing a zoomed window will also restore the display state.
  • On some operating systems, such as Mac OS X, as well as on some Linux window managers, maximizing a window will not expand the window beyond the width and height specified in the maxSize property. On others, the window will expand to fill the screen even if the screen is larger than the maxSize.
  • Some Linux window managers do not allow utility windows to be maximized.


Throws
IllegalOperationError — If this method is called after this window has been closed.

Related API Elements


Example  ( How to use this example )

The following example illustrates how to allow cancelation of a maximize operation:
public function maximizeWindow(nativeWin:NativeWindow):Boolean{
  if(nativeWin.displayState != NativeWindowDisplayState.MAXIMIZED){
    var beforeState:String = nativeWin.displayState;
    var afterState:String = NativeWindowDisplayState.MAXIMIZED;
    var displayStateEvent:NativeWindowDisplayStateEvent = 
        new NativeWindowDisplayStateEvent(NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING,
                                              true,true,beforeState,afterState);
    nativeWin.dispatchEvent(displayStateEvent);
    if(!displayStateEvent.isDefaultPrevented()){
        nativeWin.maximize();
        return true;
    } else {
      return false;
    }
  }
  return false;
}

The following example illustrates how to allow cancelation of a maximize operation from a JavaScript routine running in an HTMLLoader object on the window (or an HTML window):
function maximizeWindow(nativeWin){
    if(nativeWin.displayState != air.NativeWindowDisplayState.MAXIMIZED){
        var beforeState = nativeWin.displayState;
        var afterState = air.NativeWindowDisplayState.MAXIMIZED;
        var displayStateEvent = 
            new air.NativeWindowDisplayStateEvent(air.NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING,
                                              true,true,beforeState,afterState);
        nativeWin.dispatchEvent(displayStateEvent);
        if(!displayStateEvent.isDefaultPrevented()){
            nativeWin.maximize();
            return true;
        } else {
          return false;
        }
     }
     return false;
}

    minimize

()method 
public function minimize():void

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Minimizes this window.

Calling minimize() dispatches a displayStateChange event, and, if applicable, a move and a resize event. Whereas system chrome will dispatch a displayStateChanging event that can be canceled when a minimize command is initiated by a user, calling minimize() directly does not. Your minimize logic may implement this behavior, if desired.

The minimize() method executes asynchronously. To detect the completion of the state change, listen for the displayStateChange event, which is dispatched on all platforms. If the window is already minimized, no action is taken and no events are dispatched.

Any windows owned by this window are hidden when it is minimized. The owned windows do not dispatch displayStateChanging or displayStateChange events.

Notes:

  • On Windows, minimizing an invisible window (visible == false), will make the window visible.
  • Some Linux window managers do not allow utility windows to be minimized.


Throws
IllegalOperationError — If this method is called after this window has been closed.

Related API Elements


Example  ( How to use this example )

The following example illustrates how to allow cancelation of a call to minimize() by dispatching a displayStateChanging event:
public function minimizeWindow(nativeWin:NativeWindow):Boolean{
    if(nativeWin.displayState != NativeWindowDisplayState.MINIMIZED){
        var beforeState:String = nativeWin.displayState;
        var afterState:String = NativeWindowDisplayState.MINIMIZED;
        var displayStateEvent:NativeWindowDisplayStateEvent = 
            new NativeWindowDisplayStateEvent(NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING,
                                              true,true,beforeState,afterState);
        nativeWin.dispatchEvent(displayStateEvent);
        if(!displayStateEvent.isDefaultPrevented()){
            nativeWin.minimize();
            return true;
        } else {
          return false;
        }
     }
     return false;
}

The following example illustrates how to allow cancelation of a call to minimize() in JavaScript running in an HTMLLoader object (or HTML window):
 
function minimizeWindow(){
    if(window.nativeWindow.displayState != air.NativeWindowDisplayState.MINIMIZED){
        var beforeState = window.nativeWindow.displayState;
        var afterState = air.NativeWindowDisplayState.MINIMIZED;
        var displayStateEvent = 
            new air.NativeWindowDisplayStateEvent(air.NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING,
                                              true,true,beforeState,afterState);
        window.nativeWindow.dispatchEvent(displayStateEvent);
        if(!displayStateEvent.isDefaultPrevented()){
            window.nativeWindow.minimize();
            return true;
        } else {
          return false;
        }
     }
     return false;
}

    notifyUser

()method 
public function notifyUser(type:String):void

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Triggers a visual cue through the operating system that an event of interest has occurred.

When NativeWindow.supportsNotification is true, the visual cue will conform to the operating system convention of the native system. For example, on Windows, the task bar icon will flash.

The type parameter determines the intensity of the cue. Constants for the permitted values are defined in the NotificationType class, and may be:

  • NotificationType.INFORMATIONAL
  • NotificationType.CRITICAL

The cues provided for informational notifications are of short duration; those provided for critical notifications will last until the user activates this window. Not all Linux window managers support two levels of notification. For such window managers, notifyUser() will have the same affect no matter which option is specified.

Note: Calling notifyUser() when NativeWindow.supportsNotification is false is allowed, but does nothing.

Parameters

type:String — A string representing the urgency of the notification.

    orderInBackOf

()method 
public function orderInBackOf(window:NativeWindow):Boolean

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Sends this window directly behind the specified window.

Does not activate or acquire the focus for the window or the application. Minimized or hidden (visible is false) windows cannot be reordered.

An owned window can never be moved behind its owner. If this window has an owner, then the owner and its other owned windows are also ordered behind the target. If the target window has an owner, then this window is ordered behind the owner of the target instead.

Some Linux window managers do not allow utility windows to be ordered behind normal windows.

Parameters

window:NativeWindow — An application window.

Returns
Booleantrue if this window was successfully sent to the back; false if this window is invisible or minimized.

Example  ( How to use this example )

The following examples show how to move a window just below another window with references to the NativeWindow instances:
windowBehind.orderInBackOf(windowFront);

With references to display objects on the window stages:
displayObjBehind.stage.nativeWindow.orderInBackOf(displayObjectFront.stage.nativeWindow);


From a JavaScript routine running in an HTMLLoader object (or HTML root window) using references to two JavaScript Window objects:
jsWindowObjBehind.nativeWindow.orderInBackOf(jsWindowObjFront.nativeWindow);

    orderInFrontOf

()method 
public function orderInFrontOf(window:NativeWindow):Boolean

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Brings this window directly in front of the specified window.

Does not activate or acquire the focus for the window or the application. Minimized or hidden (visible is false) windows cannot be reordered.

A window can never be moved in front of a window that it owns. If this window has an owner, then the owner and its other owned windows are also ordered in front of the target. If the target window has an owner, then this window is also ordered in front of any other windows that have the same owner as the target.

Some Linux window managers do not allow normal windows to be ordered in front of utility windows.

Parameters

window:NativeWindow — An application window.

Returns
Booleantrue if this window was successfully brought to the front; false if this window is invisible or minimized.

Example  ( How to use this example )

The following examples show how to move a window just above another window with references to the NativeWindow instances:
windowFront.orderInFrontOf(windowBehind);

With references to display objects on the window stages:
displayObjFront.stage.nativeWindow.orderInFrontOf(displayObjectBehind.stage.nativeWindow);


From a JavaScript routine running in an HTMLLoader object (or HTML root window) using references to two JavaScript window objects:
jsWindowObjFront.nativeWindow.orderInFrontOf(jsWindowObjBehind.nativeWindow);

    orderToBack

()method 
public function orderToBack():Boolean

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Sends this window behind any other visible windows.

Does not activate or acquire the focus for this window or the application. Minimized or hidden (visible is false) windows cannot be reordered.

If alwaysInFront is true, then calling this method will not send this window behind any windows which have alwaysInFront set to false.

An owned window can never be moved behind its owner. If this window has an owner, then the owner and its other owned windows are also ordered to the bottom of window display list. This window will move behind any other windows owned by the same window. If this window owns other windows, then those windows are also moved to the back, maintaining their current order relative to each other.

Some Linux window managers do not allow utility windows to be ordered behind normal windows.

Returns
Booleantrue if this window was successfully sent to the back; false if this window is invisible or minimized.

Example  ( How to use this example )

The following examples show how to move a window behind all other windows in the application (with the same alwaysInFront setting):
windowObj.orderToBack();


With a reference to a display object on the window stage:
displayObj.stage.nativeWindow.orderToBack();

From a JavaScript routine running in an HTMLLoader object in the window (or a root HTML window):
window.nativeWindow.orderToBack();

    orderToFront

()method 
public function orderToFront():Boolean

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Brings this window in front of any other visible windows.

Does not activate or acquire the focus for this window or the application. Minimized or hidden (visible is false) windows cannot be reordered.

If alwaysInFront is false, then calling this method will not send this window in front of any windows which have alwaysInFront set to true.

A window can never be moved in front of a window that it owns. If this window owns other windows, then those windows are also moved to the front, maintaining their current order relative to each other. If this window has an owner, then the owner and its other owned windows are also ordered to the front of the window display order. This window is moved in front of other windows that have the same owner.

Some Linux window managers do not allow normal windows to be ordered in front of utility windows.

Returns
Booleantrue if this window was successfully brought to the front; false if this window is invisible or minimized.

Example  ( How to use this example )

The following examples show how to move a window in front of all other windows in the application (with the same alwaysInFront setting):
windowObj.orderToFront();


With a reference to a display object on the window stage:
displayObj.stage.nativeWindow.orderToFront();

From a JavaScript routine running in an HTMLLoader object in the window (or a root HTML window):
window.nativeWindow.orderToFront();

    restore

()method 
public function restore():void

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Restores this window from either a minimized or a maximized state.

Calling restore() dispatches a displayStateChange event, and, if applicable, a move and a resize event. Whereas system chrome will dispatch a displayStateChanging event that can be canceled when a restore command is initiated by a user, your restore logic must implement this behavior, if desired.

If the window is already in the NativeWindowDisplayState.NORMAL state, no action is taken and no events are dispatched.

To detect the completion of the state change, listen for the displayStateChange event, which is dispatched on all platforms.


Throws
IllegalOperationError — If the method is called after this window has been closed.

Related API Elements


Example  ( How to use this example )

The following example illustrates how to allow cancelation of a restore operation:
public function restoreWindow(nativeWin:NativeWindow):Boolean{
    if(nativeWin.displayState != NativeWindowDisplayState.NORMAL){
        var beforeState:String = nativeWin.displayState;
        var afterState:String = NativeWindowDisplayState.NORMAL;
        var displayStateChangingEvent:NativeWindowDisplayStateEvent = 
            new NativeWindowDisplayStateEvent(NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING,
                                              true,true,beforeState,afterState);
        nativeWin.dispatchEvent(displayStateChangingEvent);
        if(!displayStateChangingEvent.isDefaultPrevented()){
            nativeWin.restore();
            return true;
        } else {
          return false;
        }
     }
     return false;
}

The following example illustrates how to allow cancelation of a restore operation from a JavaScript routine running in an HTMLLoader object on the window (or an HTML window):
function restoreWindow(nativeWin){
    if(window.nativeWindow.displayState != air.NativeWindowDisplayState.NORMAL){
        var beforeState = window.nativeWindow.displayState;
        var afterState = air.NativeWindowDisplayState.NORMAL;
        var displayStateEvent = 
            new air.NativeWindowDisplayStateEvent(air.NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING,
                                              true,true,beforeState,afterState);
        window.nativeWindow.dispatchEvent(displayStateEvent);
        if(!displayStateEvent.isDefaultPrevented()){
            window.nativeWindow.restore();
            return true;
        } else {
          return false;
        }
     }
     return false;
}

    startMove

()method 
public function startMove():Boolean

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Starts a system-controlled move of this window.

When called from a mouseDown event, this method begins a mouse-driven move sequence that continues until a mouseUp event occurs.

When called from other code this method begins a keyboard- or mouse-driven move sequence consistent with the operating system's default sequence.

During a move sequence, a series of events will be dispatched as the window origin moves. For each incremental move, first a moving event is dispatched and then, if the moving event is not canceled, the window location is updated and a move event is dispatched. If a moving event is canceled, the move sequence is immediately terminated.

Returns
Booleantrue if the move was successfully initiated and false if the window is maximized.

Throws
IllegalOperationError — If the method is called after this window has been closed.

Example  ( How to use this example )

The following example shows how to move a window in response to a mouseDown event:
var initOpts:NativeWindowInitOptions = new NativeWindowInitOptions();
var win:NativeWindow = new NativeWindow(initOpts);
win.activate();
win.stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);

function mouseDownHandler(event:MouseEvent):void
{
    win.startMove();
}

    startResize

()method 
public function startResize(edgeOrCorner:String = "BR"):Boolean

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Starts a system-controlled resize operation of this window.

When called from a mouseDown event handler this method begins a mouse-driven resizing sequence that continues until a mouseUp event occurs.

When called from other code this method begins a keyboard- or mouse-driven resizing sequence consistent with the operating system's default sequence.

During the resize sequence, a series of events will be dispatched as the window dimensions change. For each incremental change, first a resizing event is dispatched and then, if the resizing event is not canceled, the window dimensions are updated and a resize event is dispatched. If a resizing event is canceled, the the sequence is immediately terminated.

Parameters

edgeOrCorner:String (default = "BR") — A constant from the NativeWindowResize class that specifies which edge or corner of this window to resize. The following are valid values:

ValueVertical alignmentHorizontal alignment
NativeWindowResize.TOPTopCenter
NativeWindowResize.BOTTOMBottomCenter
NativeWindowResize.LEFTCenterLeft
NativeWindowResize.RIGHTCenterRight
NativeWindowResize.TOP_LEFTTopLeft
NativeWindowResize.TOP_RIGHTTopRight
NativeWindowResize.BOTTOM_LEFTBottomLeft
NativeWindowResize.BOTTOM_RIGHTBottomRight
NativeWindowResize.NONE----

Returns
Booleantrue if the resize was successfully initiated and false if the window is maximized.

Throws
IllegalOperationError — If the method is called after this window has been closed.

Related API Elements


Example  ( How to use this example )

The following example shows how to resize a window in response to a mouseDown event:
stage.addEventListener(MouseEvent.MOUSE_DOWN, onResizeCommand);

function onResizeCommand(event:MouseEvent):void
{
    var win:NativeWindow = event.target.nativeWindow;
    var resizeFrom:String = "";
    if (event.stageY < win.height * .33)
    {
        resizeFrom = NativeWindowResize.TOP;
    }
    else if (event.stageY > win.height * .66)
    {
        resizeFrom = NativeWindowResize.BOTTOM;
    }
    if (event.stageX < win.width * .33)
    {
        resizeFrom += NativeWindowResize.LEFT;
    }
    else if (event.stageX > win.width * .66)
    {
        resizeFrom += NativeWindowResize.RIGHT;
    }
    win.startResize(resizeFrom);    
}
Event Detail
    

activate

Event
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.ACTIVATE

Runtime Versions: AIR 1.0

Dispatched by this NativeWindow object after the window has been activated.

The ACTIVATE constant defines the value of the type property of an activate event object.

Note: This event has neither a "capture phase" nor a "bubble phase", which means that event listeners must be added directly to any potential targets, whether the target is on the display list or not.

AIR for TV devices never automatically dispatch this event. You can, however, dispatch it manually.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetAny DisplayObject instance with a listener registered for the activate event.
    

close

Event  
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.CLOSE

Runtime Versions: AIR 1.0

Dispatched by this NativeWindow object after the window has been closed.

The Event.CLOSE constant defines the value of the type property of a close event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe object whose connection has been closed.
    

closing

Event  
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.CLOSING

Runtime Versions: AIR 1.0

Dispatched by this NativeWindow object immediately before the window is to be closed. This event can be canceled to prevent the window from being closed.

The Event.CLOSING constant defines the value of the type property of a closing event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelabletrue; canceling this event object stops the close operation.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe object whose connection is to be closed.
    

deactivate

Event  
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.DEACTIVATE

Runtime Versions: AIR 1.0

Dispatched by this NativeWindow object after the window has been deactivated.

The Event.DEACTIVATE constant defines the value of the type property of a deactivate event object.

Note: This event has neither a "capture phase" nor a "bubble phase", which means that event listeners must be added directly to any potential targets, whether the target is on the display list or not.

AIR for TV devices never automatically dispatch this event. You can, however, dispatch it manually.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetAny DisplayObject instance with a listener registered for the deactivate event.
    

displayStateChange

Event  
Event Object Type: flash.events.NativeWindowDisplayStateEvent
property NativeWindowDisplayStateEvent.type = flash.events.NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGE

Runtime Versions: AIR 1.0

Dispatched by this NativeWindow object after the window's displayState property has changed.

Do not resize the window or change its display state in the displayStateChange event handler.

Defines the value of the type property of a displayStateChange event object.

This event has the following properties:

PropertiesValues
afterDisplayStateThe old display state of the window.
beforeDisplayStateThe new display state of the window.
targetThe NativeWindow instance that has just changed state.
bubblesNo.
currentTargetIndicates the object that is actively processing the Event object with an event listener.
cancelablefalse; There is no default behavior to cancel.
    

displayStateChanging

Event  
Event Object Type: flash.events.NativeWindowDisplayStateEvent
property NativeWindowDisplayStateEvent.type = flash.events.NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING

Runtime Versions: AIR 1.0

Dispatched by this NativeWindow object immediately before the window changes its display state. This event can be canceled to prevent the change.

Defines the value of the type property of a displayStateChanging event object.

This event has the following properties:

PropertiesValues
afterDisplayStateThe display state of the window before the pending change.
beforeDisplayStateThe display state of the window after the pending change.
targetThe NativeWindow instance that has just changed state.
bubblesNo.
currentTargetIndicates the object that is actively processing the Event object with an event listener.
cancelabletrue; canceling the event will prevent the change.

Example  ( How to use this example )

The following example demonstrates how to cancel a displayStateChanging event.
function displayStateChanging_handler(displayStateEvent:NativeWindowDisplayStateEvent):void
{
  //shouldStopStateChange is an application-defined Boolean indicating 
  //that display state changes should be canceled
  if (displayStateEvent.type == NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING 
                                  &&    shouldStopStateChange)
  {
    displayStateEvent.preventDefault();
  }
}
    

move

Event  
Event Object Type: flash.events.NativeWindowBoundsEvent
property NativeWindowBoundsEvent.type = flash.events.NativeWindowBoundsEvent.MOVE

Runtime Versions: AIR 1.0

Dispatched by this NativeWindow object after the window has been moved on the desktop.

A move event is dispatched whenever the origin (x or y properties) of the window changes, which can occur because of a system-controlled window move; minimizing, maximizing, or restoring the window; or changing the window location by setting the x, y, or bounds properties.

Note: Avoid actions that may open simultaneous operating system dialogs boxes in the handler functions for both the moving and move events of a NativeWindow object. This may occur, for example, if both handler functions throw an error. If it does occur, the second dialog box opened will not register mouse clicks and must be closed using the keyboard.

Defines the value of the type property of a move event object.

This event has the following properties:

PropertiesValues
afterBoundsThe new bounds of the window.
beforeBoundsThe old bounds of the window.
targetThe NativeWindow object that has just changed state.
bubblesNo.
currentTargetIndicates the object that is actively processing the Event object with an event listener.
cancelablefalse; There is no default behavior to cancel.
    

moving

Event  
Event Object Type: flash.events.NativeWindowBoundsEvent
property NativeWindowBoundsEvent.type = flash.events.NativeWindowBoundsEvent.MOVING

Runtime Versions: AIR 1.0

Dispatched by the NativeWindow object immediately before the window is to be moved on the desktop. This event can be canceled to prevent or modify the move.

Note: Avoid actions that may open simultaneous operating system dialogs boxes in the handler functions for both the moving and move events of a NativeWindow object. This may occur, for example, if both handler functions throw an error. If it does occur, the second dialog box opened will not register mouse clicks and must be closed using the keyboard.

Defines the value of the type property of a moving event object.

This event has the following properties:

PropertiesValues
afterBoundsThe bounds of the window after the pending change.
beforeBoundsThe bounds of the window before the pending change.
bubblesNo.
cancelabletrue; cancelling the event will prevent the window move.
currentTargetIndicates the object that is actively processing the Event object with an event listener.
targetThe NativeWindow object that has just changed state.

Note: On Linux, the preventDefault() method is not supported for this event.

    

resize

Event  
Event Object Type: flash.events.NativeWindowBoundsEvent
property NativeWindowBoundsEvent.type = flash.events.NativeWindowBoundsEvent.RESIZE

Runtime Versions: AIR 1.0

Dispatched by this NativeWindow object after the window has been resized. A resize event is dispatched whenever the size (width or height properties) of the window changes, which can occur because of a system-controlled window resize; minimizing, maximizing, or restoring the window; or changing the window size by setting the width, height, or bounds properties. NativeWindow resize events are dispatched during system-controled resize loops. In contrast, Stage object resize events are dispatched when the Stage is ready for drawing.

Defines the value of the type property of a resize event object.

This event has the following properties:

PropertiesValues
afterBoundsThe new bounds of the window.
beforeBoundsThe old bounds of the window.
targetThe NativeWindow object that has just changed state.
bubblesNo.
currentTargetIndicates the object that is actively processing the Event object with an event listener.
cancelablefalse; There is no default behavior to cancel.

Related API Elements

    

resizing

Event  
Event Object Type: flash.events.NativeWindowBoundsEvent
property NativeWindowBoundsEvent.type = flash.events.NativeWindowBoundsEvent.RESIZING

Runtime Versions: AIR 1.0

Dispatched by this NativeWindow object immediately before the window is to be resized on the desktop. This event can be canceled to prevent or modify the resize.

Defines the value of the type property of a resizing event object.

This event has the following properties:

PropertiesValues
afterBoundsThe bounds of the window after the pending change.
beforeBoundsThe bounds of the window before the pending change.
targetThe NativeWindow object that has just changed state.
bubblesNo.
currentTargetIndicates the object that is actively processing the Event object with an event listener.
cancelabletrue; cancelling the event will prevent the window move.

Note: On Linux, the preventDefault() method is not supported for this event.


Example  ( How to use this example )

The following example demonstrates how to cancel a resizing event.
function boundsChanging_handler(boundsEvent:NativeWindowBoundsEvent):void
{
  //shouldStopResize is an application-defined Boolean indicating 
  //that resize operations should be canceled
  if (boundsEvent.type == NativeWindowBoundsEvent.RESIZING && shouldStopResize)
  {
    boundsEvent.preventDefault();
  }
}