Packageflash.display
Classpublic class NativeWindow
InheritanceNativeWindow Inheritance EventDispatcher Inheritance Object

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

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

var window:NativeWindow = displayObject.stage.window;

The Stage.window property is only available in desktop players. You can detect whether the current player supports window instances by checking the System.Capabilities.playerType property.

Content can be added to the stage using normal DisplayObjectContainer APIs such as addChild().

Important: Adding Flex components directly to the display list of an application-created window is not supported in this Alpha release of Apollo. You can add Flex components to the display list of the initial window automatically created on application start up, but not to the display lists of any windows created by your application logic. You can load a Flex-based SWF into a new window as long as the SWF is loaded into its own ApplicationDomain.

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

If the shell.autoExit property is true, which is the default, the application will close when it's last window is closed. If autoExit is false, then the application does not automatically exit even if all windows have closed.

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.


Example
The following function shows one way to identify if the application is running in a desktop player. This function returns true if the application is running in a desktop player, and false if it is not:
  public function isDesktopPlayer():Boolean
  {
      return (Capabilities.playerType == 'Desktop');
  }
  

See also

flash.display.Stage.window
flash.display.NativeWindowInitOptions
flash.system.Shell
flash.system.ApplicationDomain
flash.system.Capabilities.playerType


Public Properties
 PropertyDefined by
  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] A string reporting this window's current display state.
NativeWindow
  height : Number
The height of this window in pixels.
NativeWindow
  initOptions : NativeWindowInitOptions
[read-only] The NativeWindowInitOptions structure used to create this window.
NativeWindow
  maxSize : Point
The maximum size for this window.
NativeWindow
  minSize : Point
The minimum size for this window.
NativeWindow
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  stage : Stage
[read-only] The Stage of this window.
NativeWindow
  title : String
The window title.
NativeWindow
  visible : Boolean
Specifies whether this window is visible.
NativeWindow
  width : Number
The width of this window in pixels.
NativeWindow
  x : Number
The x coordinate of this window's top left corner relative to the upper left corner of the operating system's desktop.
NativeWindow
  y : Number
The y 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
 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
  
maximize():void
Maximizes this native window according to system rules and behavior.
NativeWindow
  
minimize():void
Minimizes this native window according to system rules and behavior.
NativeWindow
 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
setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void
Sets the availability of a dynamic property for loop operations.
Object
  
startMove():void
Starts a system-controlled move of this window.
NativeWindow
  
startResize(edgeOrCorner:String):void
Starts a system-controlled resize operation of this window.
NativeWindow
 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
 EventSummaryDefined by
 Inherited Dispatched when Flash Player gains operating system focus and becomes active.EventDispatcher
   Dispatched by this NativeWindow object after the window has been closed.NativeWindow
   Dispatched by this NativeWindow object immediately before the window is to be closed.NativeWindow
 Inherited Dispatched when Flash Player loses operating system focus and is becoming inactive.EventDispatcher
   Dispatched by this NativeWindow object after the window's displayState has changed.NativeWindow
   Dispatched by this NativeWindow object immediately before the window changes displayState.NativeWindow
   Dispatched by this NativeWindow object after the window has been moved on the desktop.NativeWindow
   Dispatched by the NativeWindow object immediately before the window is to be moved on the desktop.NativeWindow
   Dispatched by this NativeWindow object after the window has been resized.NativeWindow
   Dispatched by this NativeWindow object immediately before the window is to be resized on the desktop.NativeWindow
Property detail
boundsproperty
bounds:Rectangle  [read-write]

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.

A NativeWindowBoundsChangeEvent "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. Setting the bounds property directly will not dispatch a "moving" or "resizing" event. To allow other components to prepare for or cancel an impending move or resize operation, your bounds changing logic can dispatch "moving" and "resizing" events with the NativeWindow.dispatchEvent method and then check whether the event was cancelled by a registered listener.

Setting the bounds property of a window is equivalent to setting its x, y, width, and height properties (and vice-versa).

If the width and the height specified are less than the minimum or greater than the maximum allowed size, either because of the minSize and maxSize properties of the window, or the minimum and maximum operating system limits, then the window dimensions are set to the closest legal size.

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

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

See also


Example
The following example illustrates how to allow cancellation of a window bounds change using a resizing event:
      public function setBounds(newBounds:Rectangle):void{
          var resizingEvent:NativeWindowBoundsEvent = 
                new NativeWindowBoundsEvent(NativeWindowBoundsEvent.RESIZING,true,true);
          //"this" must be a reference to the window being changed
          this.dispatchEvent(resizingEvent);
          if(!resizingEvent.isDefaultPrevented()){
              this.bounds = newBounds.clone();
          }
      }  
      

closedproperty 
closed:Boolean  [read-only]

Indicates whether this window has been closed.

Accessing the following properties on a closed window will throw an IllegalOperationError:

Likewise, calling the following methods on a closed window will also throw an IllegalOperationError:

  • minimize()
  • maximize()
  • restore()
  • startResize()
  • startMove()
  • Implementation
        public function get closed():Boolean
    displayStateproperty 
    displayState:String  [read-only]

    A string reporting this window's current display state.

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

    Implementation
        public function get displayState():String

    Throws
    IllegalOperationError — if the displayState is read after the window has been closed.

    See also

    heightproperty 
    height:Number  [read-write]

    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, either because of the minSize and maxSize properties of the window, or the minimum and maximum operating system limits, then the window height is set to the closest legal size.

    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 the window has been closed.

    See also

    initOptionsproperty 
    initOptions:NativeWindowInitOptions  [read-only]

    The NativeWindowInitOptions structure used to create this window.

    Implementation
        public function get initOptions():NativeWindowInitOptions

    See also

    maxSizeproperty 
    maxSize:Point  [read-write]

    The maximum size for this window.

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

    maxSize is passed to the operating system and is enforced for window resizing operations invoked both through ActionScript and through the operating system.

    Note: 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 size is not within the operating system minimum and maximum window sizes.
     
    SecurityError — if size is forbidden for the content's current privilege.

    See also

    minSizeproperty 
    minSize:Point  [read-write]

    The minimum size for this window.

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

    minSize is passed to the operating system and is enforced for window resizing operations invoked both through ActionScript and through the operating system.

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

    Throws
    IllegalOperationError — if size is not within the operating system minimum and maximum window sizes.
     
    SecurityError — if size is forbidden for the content's current privilege.

    See also

    stageproperty 
    stage:Stage  [read-only]

    The Stage of this window.

    The stage is the root of the display list for the window. Add visual 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 that 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

    See also

    titleproperty 
    title:String  [read-write]

    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 the window has been closed.
    visibleproperty 
    visible:Boolean  [read-write]

    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 true. To create a window in an invisible state, set the visible parameter passed to the window constructor to false.

    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 the window has been closed.
    widthproperty 
    width:Number  [read-write]

    The width of this window in pixels.

    The dimensions of a NativeWindow 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, either because of the minSize and maxSize properties of the window, or the minimum and maximum operating system limits, then the window width is set to the closest legal size.

    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 the window has been closed.

    See also

    xproperty 
    x:Number  [read-write]

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

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

    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 the window has been closed.

    See also

    yproperty 
    y:Number  [read-write]

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

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

    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 the window has been closed.

    See also

    Constructor detail
    NativeWindow()constructor
    public function NativeWindow(visible:Boolean, initOptions:NativeWindowInitOptions)

    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. Entirely invalid initOptions will cause an IllegalOperationError to be thrown. Settings that are valid but not available on the current system will not throw an exception. These cases can be detected, if desired, using NativeWindowCapabilities.

    Parameters
    visible:Boolean — If true, the window will be visible on creation. Otherwise, the application must set the window's visible property for the window to be displayed.
     
    initOptions:NativeWindowInitOptions — An object containing the initialization properties for the window.

    Throws
    IllegalOperationError — If the initOptions parameter is invalid.

    See also

    Method detail
    close()method
    public function close():void

    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.

    If DisplayObject instances that are currently in the window are not referenced elsewhere they will be garbage collected and destroyed.

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

    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 temporarily, set the window's visible property to false.

    See also


    Example
    The following example illustrates how to allow cancellation of a close operation:
          public function closeCommand():Boolean{
              var closeEvent:Event = new Event(Event.CLOSING,true,true);
              dispatchEvent(closeEvent);
              if(!closeEvent.isDefaultPrevented()){
                  nativeWin.close();
                  return true;
              } else {
                return false;
              }
          }  
          

    globalToScreen()method 
    public function 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.

    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 screen.
    maximize()method 
    public function maximize():void

    Maximizes this native window according to system rules and behavior.

    Calling maximize() dispatches a displayStateChange event, and, if applicable, a move and a resize event. Wheras 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.

    maximize() 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.


    Throws
    IllegalOperationError — if the maximizable property of the window initOptions is false or if the method is called after the window has been closed.

    See also


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

    minimize()method 
    public function minimize():void

    Minimizes this native window according to system rules and behavior.

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

    minimize() executes asynchronously. To detect the completion of the state change, listen for the "displayStateChange" event.

    If the window is already minimized, no action is taken and no events are dispatched.


    Throws
    IllegalOperationError — if the minimizable property of the window initOptions is false or if the method is called after the window has been closed.

    See also


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

    restore()method 
    public function restore():void

    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. Wheras 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.

    restore() executes asynchronously. To detect the completion of the state change, listen for the "displayStateChange" event.

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


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

    See also


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

    startMove()method 
    public function startMove():void

    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 the 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.


    Throws
    IllegalOperationError — if the method is called after the window has been closed.
    startResize()method 
    public function startResize(edgeOrCorner:String):void

    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 — A constant from the NativeWindowResize class that specifies which edge or corner of the window to resize. The following are valid values:

    Value Vertical Alignment Horizontal
    NativeWindowResize.TOP Top Center
    NativeWindowResize.BOTTOM Bottom Center
    NativeWindowResize.LEFT Center Left
    NativeWindowResize.RIGHT Center Right
    NativeWindowResize.TOP_LEFT Top Left
    NativeWindowResize.TOP_RIGHT Top Right
    NativeWindowResize.BOTTOM_LEFT Bottom Left
    NativeWindowResize.BOTTOM_RIGHT Bottom Right
    NativeWindowResize.NONE Bottom Right


    Throws
    IllegalOperationError — if the method is called after the window has been closed.
    Event detail
    closeevent  
    Event object type: flash.events.Event
    Event.type property = flash.events.Event.CLOSE

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

    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.
    closingevent  
    Event object type: flash.events.Event
    Event.type property = flash.events.Event.CLOSING

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

    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.

    Example
    The following example demonstrates how to cancel a "closing" event.
     function closing_handler(closingEvent:Event):void
     {
       if (document.isDirty)
       {
         closingEvent.preventDefault();
         // raise save dialog...
       }
     }
     

    displayStateChangeevent  
    Event object type: flash.events.NativeWindowDisplayStateEvent
    NativeWindowDisplayStateEvent.type property = flash.events.NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGE

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

    Defines the value of the type property of a displayStateChange event object. This event has the following properties:

    PropertiesValues
    afterStatethe old display state of the window.
    beforeStatethe new display state of the window.
    targetThe NativeWindow 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.

    displayStateChangingevent  
    Event object type: flash.events.NativeWindowDisplayStateEvent
    NativeWindowDisplayStateEvent.type property = flash.events.NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING

    Dispatched by this NativeWindow object immediately before the window changes displayState. This event can be cancelled to prevent the change.

    Defines the value of the type property of a displayStateChanging event object. This event has the following properties:

    PropertiesValues
    afterStatethe display state of the window before the pending change.
    beforeStatethe display state of the window after the pending change.
    targetThe NativeWindow 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 change.


    Example
    The following example demonstrates how to cancel a "displayStateChange" 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();
       }
     }
     

    moveevent  
    Event object type: flash.events.NativeWindowBoundsEvent
    NativeWindowBoundsEvent.type property = flash.events.NativeWindowBoundsEvent.MOVE

    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.

    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 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.

    movingevent  
    Event object type: flash.events.NativeWindowBoundsEvent
    NativeWindowBoundsEvent.type property = flash.events.NativeWindowBoundsEvent.MOVING

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

    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 that has just changed state.

    resizeevent  
    Event object type: flash.events.NativeWindowBoundsEvent
    NativeWindowBoundsEvent.type property = flash.events.NativeWindowBoundsEvent.RESIZE

    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 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.

    See also

    resizingevent  
    Event object type: flash.events.NativeWindowBoundsEvent
    NativeWindowBoundsEvent.type property = flash.events.NativeWindowBoundsEvent.RESIZING

    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 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.


    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();
       }
     }
     





     

    Send me an e-mail when comments are added to this page | Comment Report

    Current page: http://livedocs.adobe.com/apollo/1.0/aslr/flash/display/NativeWindow.html