Transferred from the Adobe Open Source Subversion Repository

Revision: 4033
Author:   rfrishbe@adobe.com
Date:     2008-11-06T22:20:42.263178Z

Log Message:
-----------
Fix a bug Steve found when dealing with "justify" for horizontalAlign or verticalAlign.

Add horizontalAlign and verticalAlign to VGroup and HGroup, respectively.  Also fix some ASDoc and code comments.

Ran mustella tests for layout, group, and datagroup.

QE Notes: Continue testing these properties
Doc Notes: None
Bugs: -
Reviewer: Evtim

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/VGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/HGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/VerticalLayout.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1281061 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/VGroup.as
+++ frameworks/projects/spark/src/spark/components/VGroup.as
@@ -76,6 +76,26 @@
     {
         verticalLayout.gap = value;
     }
+
+    //----------------------------------
+    //  horizontalAlign
+    //----------------------------------
+
+    /**
+     * @copy mx.layout.VerticalLayout#horizontalAlign
+     */
+    public function get horizontalAlign():String
+    {
+        return verticalLayout.horizontalAlign;
+    }
+
+    /**
+     *  @private
+     */
+    public function set horizontalAlign(value:String):void
+    {
+        verticalLayout.horizontalAlign = value;
+    }

     //----------------------------------
     //  rowCount


Transferred from the Adobe Open Source Subversion Repository

Revision: 6215
Author:   smgilson@adobe.com
Date:     2009-04-23T17:12:57.259499Z

Log Message:
-----------
ASDoc updates for effect classes

Checkintests: passed

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/RemoveAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/SimpleMotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Rotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Fade.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Resize.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/KeyFrame.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Wipe.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/WipeDirection.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Move.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/CallAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/CrossFade.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransform.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateShaderTransition.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/MotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/SetAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1283809 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/effects/SetAction.as
+++ frameworks/projects/spark/src/spark/effects/SetAction.as
@@ -110,7 +110,7 @@
     /**
      *  The new value for the property.
      *  When run within a transition and value is not specified, Flex determines
-     *  the value based on that set by the new state.
+     *  the value based on that set by the new view state.
      *
      *  @langversion 3.0
      *  @playerversion Flash 10


Transferred from the Adobe Open Source Subversion Repository

Revision: 5067
Author:   smgilson@adobe.com
Date:     2009-02-25T16:21:22.849704Z

Log Message:
-----------
In preparation for adding ASDoc version tags for Flex, remove old tags from AIR files

QE Notes: None
Doc Notes: None
Bugs: -

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/Window.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/events/FlexNativeMenuEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/FlexHTMLLoader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemEnumerationMode.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/WindowMinimizeButtonSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemHistoryButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/WindowRestoreButtonSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/WindowMaximizeButtonSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/StatusBarBackgroundSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemTree.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/HTML.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/IWindow.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/utils/DirectoryEnumeration.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemSizeDisplayMode.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/events/FlexNativeWindowBoundsEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/utils/DirectoryEnumerationMode.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/events/AIREvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/WindowBackground.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/windowClasses/TitleBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/windowClasses/StatusBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/events/FileEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/events/WindowExistenceEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemDataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/WindowCloseButtonSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/ApplicationTitleBarBackgroundSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/WindowedApplication.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FlexNativeMenu.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/NativeDragManagerImpl.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1249840 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/airframework/src/mx/core/Window.as
+++ frameworks/projects/airframework/src/mx/core/Window.as
@@ -125,7 +125,7 @@
 /**
  *  Dispatched when the computer connects to or disconnects from the network.
  *
- *	@eventType flash.events.Event.NETWORK_CHANGE
+ *  @eventType flash.events.Event.NETWORK_CHANGE
  */
 [Event(name="networkChange", type="flash.events.Event")]

@@ -472,7 +472,6 @@
  *
  *  @see mx.core.WindowedApplication
  *
- *  @playerversion AIR 1.1
  */
 public class Window extends LayoutContainer implements IWindow
 {
@@ -519,10 +518,10 @@
      */
     public static function getWindow(component:UIComponent):Window
     {
-    	if (component.systemManager is WindowedSystemManager)
-    		return WindowedSystemManager(component.systemManager).window;
-
-		return null;
+        if (component.systemManager is WindowedSystemManager)
+            return WindowedSystemManager(component.systemManager).window;
+
+        return null;
     }

     //--------------------------------------------------------------------------
@@ -540,8 +539,8 @@

         addEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
         addEventListener(FlexEvent.PREINITIALIZE, preinitializeHandler);
-
-		invalidateProperties();
+
+        invalidateProperties();
     }

     //--------------------------------------------------------------------------
@@ -555,26 +554,26 @@
      */
     private var _nativeWindow:NativeWindow;

-	/**
-	 *  @private
-	 */
-	private var _nativeWindowVisible:Boolean = true;
-
- 	/**
-     *  @private
-     */
- 	private var maximized:Boolean = false;
-
- 	/**
-     *  @private
-     */
- 	private var _cursorManager:ICursorManager;
-
-
- 	/**
-     *  @private
-     */
- 	private var toMax:Boolean = false;
+    /**
+     *  @private
+     */
+    private var _nativeWindowVisible:Boolean = true;
+
+    /**
+     *  @private
+     */
+    private var maximized:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var _cursorManager:ICursorManager;
+
+
+    /**
+     *  @private
+     */
+    private var toMax:Boolean = false;

     /**
      *  @private
@@ -671,7 +670,7 @@
     //
     //--------------------------------------------------------------------------

-   	//----------------------------------
+    //----------------------------------
     //  height
     //----------------------------------

@@ -682,65 +681,65 @@
     /**
      *  @private
      */
-	override public function get height():Number
-    {
-    	return _bounds.height;
-    }
-
-    /**
-     *  @private
-	 *  Also sets the stage's height.
+    override public function get height():Number
+    {
+        return _bounds.height;
+    }
+
+    /**
+     *  @private
+     *  Also sets the stage's height.
      */
     override public function set height(value:Number):void
     {
-		if (value < minHeight)
-     		value = minHeight;
-     	else if (value > maxHeight)
-     		value = maxHeight;
-
-		_bounds.height = value;
-     	boundsChanged = true;
+        if (value < minHeight)
+            value = minHeight;
+        else if (value > maxHeight)
+            value = maxHeight;
+
+        _bounds.height = value;
+        boundsChanged = true;

         invalidateProperties();
         invalidateSize();
         invalidateViewMetricsAndPadding();

-	    dispatchEvent(new Event("heightChanged"));
+        dispatchEvent(new Event("heightChanged"));
         // also dispatched in the resizeHandler
     }

-	//----------------------------------
+    //----------------------------------
     //  maxHeight
     //----------------------------------

-	/**
-     *  @private
-	 *  Storage for the maxHeight property.
-     */
-	private var _maxHeight:Number = 10000;
-
-	/**
-     *  @private
-	 *  Keeps track of whether maxHeight property changed so we can
-	 *  handle it in commitProperties.
+    /**
+     *  @private
+     *  Storage for the maxHeight property.
+     */
+    private var _maxHeight:Number = 10000;
+
+    /**
+     *  @private
+     *  Keeps track of whether maxHeight property changed so we can
+     *  handle it in commitProperties.
      */
     private var maxHeightChanged:Boolean = false;

     [Bindable("maxHeightChanged")]
     [Bindable("windowComplete")]

-	/**
+    /**
      *  @private
      */
     override public function get maxHeight():Number
     {
-    	if (nativeWindow && !maxHeightChanged)
-    		return nativeWindow.maxSize.y - chromeHeight();
+        if (nativeWindow && !maxHeightChanged)
+            return nativeWindow.maxSize.y - chromeHeight();
         else
-        	return _maxHeight;
-    }
-
-	/**
+            return _maxHeight;
+    }
+
+    /**
      *  Specifies the maximum height of the application's window.
      */
     override public function set maxHeight(value:Number):void
@@ -756,29 +755,29 @@

     /**
      *  @private
-	 *  Storage for the maxWidth property.
+     *  Storage for the maxWidth property.
      */
     private var _maxWidth:Number = 10000;

     /**
      *  @private
-	 *  Keeps track of whether maxWidth property changed so we can
-	 *  handle it in commitProperties.
+     *  Keeps track of whether maxWidth property changed so we can
+     *  handle it in commitProperties.
      */
     private var maxWidthChanged:Boolean = false;

     [Bindable("maxWidthChanged")]
     [Bindable("windowComplete")]

-	/**
+    /**
      *  @private
      */
     override public function get maxWidth():Number
     {
-    	if (nativeWindow && !maxWidthChanged)
-    		return nativeWindow.maxSize.x - chromeWidth();
+        if (nativeWindow && !maxWidthChanged)
+            return nativeWindow.maxSize.x - chromeWidth();
         else
-        	return _maxWidth;
+            return _maxWidth;
     }

     /**
@@ -799,11 +798,11 @@
      *  @private
      */
     private var _minHeight:Number = 0;
-
-	/**
-     *  @private
-	 *  Keeps track of whether minHeight property changed so we can
-	 *  handle it in commitProperties.
+
+    /**
+     *  @private
+     *  Keeps track of whether minHeight property changed so we can
+     *  handle it in commitProperties.
      */
     private var minHeightChanged:Boolean = false;

@@ -815,10 +814,10 @@
      */
     override public function get minHeight():Number
     {
-    	if (nativeWindow && !minHeightChanged)
-    		return nativeWindow.minSize.y - chromeHeight();
+        if (nativeWindow && !minHeightChanged)
+            return nativeWindow.minSize.y - chromeHeight();
         else
-        	return _minHeight;
+            return _minHeight;
     }

     /**
@@ -837,14 +836,14 @@

     /**
      *  @private
-	 *  Storage for the minWidth property.
+     *  Storage for the minWidth property.
      */
     private var _minWidth:Number = 0;

    /**
      *  @private
-	 *  Keeps track of whether minWidth property changed so we can
-	 *  handle it in commitProperties.
+     *  Keeps track of whether minWidth property changed so we can
+     *  handle it in commitProperties.
      */
     private var minWidthChanged:Boolean = false;

@@ -857,9 +856,9 @@
     override public function get minWidth():Number
     {
         if (nativeWindow && !minWidthChanged)
-    		return nativeWindow.minSize.x - chromeWidth();
+            return nativeWindow.minSize.x - chromeWidth();
         else
-        	return _minWidth;
+            return _minWidth;
     }

     /**
@@ -871,106 +870,106 @@
         minWidthChanged = true;
         invalidateProperties();
     }
-
-	//----------------------------------
-	//  visible
-	//----------------------------------
-
-	[Bindable("hide")]
+
+    //----------------------------------
+    //  visible
+    //----------------------------------
+
+    [Bindable("hide")]
     [Bindable("show")]
     [Bindable("windowComplete")]
-
-	/**
-	 *  Controls the window's visibility. Unlike the
-	 *  UIComponent.visible property of most Flex
-	 *  visual components, this property affects the visibility
-	 *  of the underlying NativeWindow (including operating system
-	 *  chrome) as well as the visibility of the Window's child
-	 *  controls.
-	 *
-	 *
When this property changes, Flex dispatches a show
-	 *  or hide event.

-	 *
-	 *  @default true
-	 */
-	override public function get visible():Boolean
-	{
-		if (!nativeWindow.closed)
-			return _nativeWindow.visible;
-		else
-			return false;
-	}
-	/**
-	 *  @private
-	 */
-	override public function set visible(value:Boolean):void
-	{
-		if (!_nativeWindow)
-		{
-			_nativeWindowVisible = value;
-			invalidateProperties();
-		}
-		else if (!_nativeWindow.closed)
-		{
-			var e:FlexEvent;
-			if (value)
-			{
-				_nativeWindow.visible = value;
-				e = new FlexEvent(FlexEvent.SHOW);
-				dispatchEvent(e);
-			}
-			else
-			{
-				e = new FlexEvent(FlexEvent.HIDE);
-				if (getStyle("hideEffect"))
-    			{
-             		addEventListener("effectEnd", hideEffectEndHandler);
-				}
-				else
-				{
-					_nativeWindow.visible = value;
-					dispatchEvent(e);
-				}
-			}
-		}
-	}
-
-   	//----------------------------------
+
+    /**
+     *  Controls the window's visibility. Unlike the
+     *  UIComponent.visible property of most Flex
+     *  visual components, this property affects the visibility
+     *  of the underlying NativeWindow (including operating system
+     *  chrome) as well as the visibility of the Window's child
+     *  controls.
+     *
+     *
When this property changes, Flex dispatches a show
+     *  or hide event.

+     *
+     *  @default true
+     */
+    override public function get visible():Boolean
+    {
+        if (!nativeWindow.closed)
+            return _nativeWindow.visible;
+        else
+            return false;
+    }
+    /**
+     *  @private
+     */
+    override public function set visible(value:Boolean):void
+    {
+        if (!_nativeWindow)
+        {
+            _nativeWindowVisible = value;
+            invalidateProperties();
+        }
+        else if (!_nativeWindow.closed)
+        {
+            var e:FlexEvent;
+            if (value)
+            {
+                _nativeWindow.visible = value;
+                e = new FlexEvent(FlexEvent.SHOW);
+                dispatchEvent(e);
+            }
+            else
+            {
+                e = new FlexEvent(FlexEvent.HIDE);
+                if (getStyle("hideEffect"))
+                {
+                    addEventListener("effectEnd", hideEffectEndHandler);
+                }
+                else
+                {
+                    _nativeWindow.visible = value;
+                    dispatchEvent(e);
+                }
+            }
+        }
+    }
+
+    //----------------------------------
     //  width
     //----------------------------------
-
+
     [Bindable("widthChanged")]
     [Inspectable(category="General")]
     [PercentProxy("percentWidth")]
-
+
     /**
      *  @private
      */
     override public function get width():Number
     {
-    	return _bounds.width;
-    }
-
-    /**
-     *  @private
-	 *  Also sets the stage's width.
+        return _bounds.width;
+    }
+
+    /**
+     *  @private
+     *  Also sets the stage's width.
      */
     override public function set width(value:Number):void
     {
-     	if (value < minWidth)
-     		value = minWidth;
-     	else if (value > maxWidth)
-     		value = maxWidth;
-
-     	_bounds.width = value;
-     	boundsChanged = true;
+        if (value < minWidth)
+            value = minWidth;
+        else if (value > maxWidth)
+            value = maxWidth;
+
+        _bounds.width = value;
+        boundsChanged = true;

         invalidateProperties();
         invalidateSize();
         invalidateViewMetricsAndPadding();

-	    dispatchEvent(new Event("widthChanged"));
-	    // also dispatched in the resize handler
+        dispatchEvent(new Event("widthChanged"));
+        // also dispatched in the resize handler
     }

     //--------------------------------------------------------------------------
@@ -989,28 +988,28 @@
     override public function get viewMetrics():EdgeMetrics
     {

-  		var bm:EdgeMetrics = super.viewMetrics;
+        var bm:EdgeMetrics = super.viewMetrics;
         var vm:EdgeMetrics = new EdgeMetrics(bm.left, bm.top,
-        									 bm.right, bm.bottom);
-
-   		// Since the header covers the solid portion of the border,
+                                             bm.right, bm.bottom);
+
+        // Since the header covers the solid portion of the border,
         // we need to use the larger of borderThickness or headerHeight

-		if (showTitleBar)
-        {
-	        var hHeight:Number = getHeaderHeight();
-	        if (!isNaN(hHeight))
-	            vm.top += hHeight;
-        }
-
-		if (showStatusBar)
+        if (showTitleBar)
+        {
+            var hHeight:Number = getHeaderHeight();
+            if (!isNaN(hHeight))
+                vm.top += hHeight;
+        }
+
+        if (showStatusBar)
         {
             var sHeight:Number = getStatusBarHeight();
             if (!isNaN(sHeight))
                 vm.bottom += sHeight;
         }

-		if (controlBar && controlBar.includeInLayout)
+        if (controlBar && controlBar.includeInLayout)
         {
             vm.top += controlBar.getExplicitOrMeasuredHeight();
         }
@@ -1030,37 +1029,37 @@

     /**
      *  @private
-	 *  Storage for the alwaysInFront property.
+     *  Storage for the alwaysInFront property.
      */
     private var _alwaysInFront:Boolean = false;

     /**
-	 *  Determines whether the underlying NativeWindow is always in front
-	 *  of other windows (including those of other applications). Setting
-	 *  this property sets the alwaysInFront property of the
-	 *  underlying NativeWindow. See the NativeWindow.alwaysInFront
-	 *  property description for details of how this affects window stacking
-	 *  order.
-	 *
-	 *  @see flash.display.NativeWindow#alwaysInFront
+     *  Determines whether the underlying NativeWindow is always in front
+     *  of other windows (including those of other applications). Setting
+     *  this property sets the alwaysInFront property of the
+     *  underlying NativeWindow. See the NativeWindow.alwaysInFront
+     *  property description for details of how this affects window stacking
+     *  order.
+     *
+     *  @see flash.display.NativeWindow#alwaysInFront
      */
     public function get alwaysInFront():Boolean
     {
-    	if (_nativeWindow && !_nativeWindow.closed)
-    		return nativeWindow.alwaysInFront;
-    	else
-    		return _alwaysInFront;
-    }
-
-	/**
-     *  @private
-	 */
-	public function set alwaysInFront(value:Boolean):void
-	{
-		_alwaysInFront = value;
-		if (_nativeWindow && !_nativeWindow.closed)
-			nativeWindow.alwaysInFront = value;
-	}
+        if (_nativeWindow && !_nativeWindow.closed)
+            return nativeWindow.alwaysInFront;
+        else
+            return _alwaysInFront;
+    }
+
+    /**
+     *  @private
+     */
+    public function set alwaysInFront(value:Boolean):void
+    {
+        _alwaysInFront = value;
+        if (_nativeWindow && !_nativeWindow.closed)
+            nativeWindow.alwaysInFront = value;
+    }

     //----------------------------------
     //  bounds
@@ -1080,7 +1079,7 @@
     /**
      *  @private
      *  A Rectangle specifying the window's bounds
-	 *  relative to the screen.
+     *  relative to the screen.
      */
     protected function get bounds():Rectangle
     {
@@ -1100,7 +1099,7 @@
         invalidateViewMetricsAndPadding();
     }

-   	//----------------------------------
+    //----------------------------------
     //  closed
     //----------------------------------

@@ -1109,10 +1108,10 @@
      */
     public function get closed():Boolean
     {
-    	return nativeWindow.closed;
-    }
-
-   	//----------------------------------
+        return nativeWindow.closed;
+    }
+
+    //----------------------------------
     //  controlBar
     //----------------------------------

@@ -1124,50 +1123,50 @@
      */
     public var controlBar:IUIComponent;

-	//----------------------------------
-	//  maximizable
-	//----------------------------------
-
-	/**
-	 *  @private
-	 *  Storage for the maximizable property.
-	 */
-	private var _maximizable:Boolean = true;
-
-	/**
-	 *  Specifies whether the window can be maximized.
-	 *  This property's value is read-only after the window
-	 *  has been opened.
-	 */
-	public function get maximizable():Boolean
-	{
-		return _maximizable;
-	}
-
-	/**
-	 *  @private
-	 */
-	public function set maximizable(value:Boolean):void
-	{
-		if (!_nativeWindow)
-		{
-			_maximizable = value;
-
-			invalidateProperties();
-		}
-	}
-
-	//----------------------------------
-	//  menu
-	//----------------------------------
-
-	/**
-     *  @private
-	 *  Storage for the menu property.
+    //----------------------------------
+    //  maximizable
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the maximizable property.
+     */
+    private var _maximizable:Boolean = true;
+
+    /**
+     *  Specifies whether the window can be maximized.
+     *  This property's value is read-only after the window
+     *  has been opened.
+     */
+    public function get maximizable():Boolean
+    {
+        return _maximizable;
+    }
+
+    /**
+     *  @private
+     */
+    public function set maximizable(value:Boolean):void
+    {
+        if (!_nativeWindow)
+        {
+            _maximizable = value;
+
+            invalidateProperties();
+        }
+    }
+
+    //----------------------------------
+    //  menu
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the menu property.
      */
     private var _menu:FlexNativeMenu;

-   	//----------------------------------
+    //----------------------------------
     //  cursorManager
     //----------------------------------
     /**
@@ -1175,7 +1174,7 @@
      */
     override public function get cursorManager():ICursorManager
     {
-    	return _cursorManager;
+        return _cursorManager;
     }

@@ -1189,103 +1188,103 @@
      */
     public function get menu():FlexNativeMenu
     {
-    	return _menu;
+        return _menu;
     }

     /**
      *  The window menu for this window.
-	 *  Some operating systems do not support window menus,
-	 *  in which case this property is ignored.
+     *  Some operating systems do not support window menus,
+     *  in which case this property is ignored.
      */
     public function set menu(value:FlexNativeMenu):void
     {
-    	_menu = value;
-    	menuChanged = true;
-    }
-
-	//----------------------------------
-	//  minimizable
-	//----------------------------------
-
-	/**
-	 *  @private
-	 *  Storage for the minimizable property.
-	 */
-	private var _minimizable:Boolean = true;
-
-	/**
-	 *  Specifies whether the window can be minimized.
-	 *  This property is read-only after the window has
-	 *  been opened.
-	 */
-	public function get minimizable():Boolean
-	{
-		return _minimizable;
-	}
-
-	/**
-	 *  @private
-	 */
-	public function set minimizable(value:Boolean):void
-	{
-		if (!_nativeWindow)
-		{
-			_minimizable = value;
-
-			invalidateProperties();
-		}
-	}
-
-	//----------------------------------
-	//  nativeWindow
-	//----------------------------------
+        _menu = value;
+        menuChanged = true;
+    }
+
+    //----------------------------------
+    //  minimizable
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the minimizable property.
+     */
+    private var _minimizable:Boolean = true;
+
+    /**
+     *  Specifies whether the window can be minimized.
+     *  This property is read-only after the window has
+     *  been opened.
+     */
+    public function get minimizable():Boolean
+    {
+        return _minimizable;
+    }
+
+    /**
+     *  @private
+     */
+    public function set minimizable(value:Boolean):void
+    {
+        if (!_nativeWindow)
+        {
+            _minimizable = value;
+
+            invalidateProperties();
+        }
+    }
+
+    //----------------------------------
+    //  nativeWindow
+    //----------------------------------

     /**
      *  The underlying NativeWindow that this Window component uses.
      */
     public function get nativeWindow():NativeWindow
     {
-    	if (systemManager && systemManager.stage)
-    		return systemManager.stage.nativeWindow;
-
-		return null;
-    }
-
-	//----------------------------------
-	//  resizable
-	//----------------------------------
-
-	/**
-	 *  @private
-	 *  Storage for the resizable property.
-	 */
-	private var _resizable:Boolean = true;
-
-	/**
-	 *  Specifies whether the window can be resized.
-	 *  This property is read-only after the window
-	 *  has been opened.
-	 */
-	public function get resizable():Boolean
-	{
-		return _resizable;
-	}
-
-	/**
-	 *  @private
-	 */
-	public function set resizable(value:Boolean):void
-	{
-
-		if (!_nativeWindow)
-		{
-			_resizable = value;
-
-			invalidateProperties();
-		}
-	}
-
-	//----------------------------------
+        if (systemManager && systemManager.stage)
+            return systemManager.stage.nativeWindow;
+
+        return null;
+    }
+
+    //----------------------------------
+    //  resizable
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the resizable property.
+     */
+    private var _resizable:Boolean = true;
+
+    /**
+     *  Specifies whether the window can be resized.
+     *  This property is read-only after the window
+     *  has been opened.
+     */
+    public function get resizable():Boolean
+    {
+        return _resizable;
+    }
+
+    /**
+     *  @private
+     */
+    public function set resizable(value:Boolean):void
+    {
+
+        if (!_nativeWindow)
+        {
+            _resizable = value;
+
+            invalidateProperties();
+        }
+    }
+
+    //----------------------------------
     //  showGripper
     //----------------------------------

@@ -1302,9 +1301,9 @@

     /**
      *  If true, the gripper is visible.
-	 *
+     *
      *
On Mac OS X a window with systemChrome
-	 *  set to "standard"
+     *  set to "standard"
      *  always has an operating system gripper, so this property is ignored
      *  in that case.

      *
@@ -1414,7 +1413,7 @@

     /**
      *  @private
-	 *  Storage for the status property.
+     *  Storage for the status property.
      */
     private var _status:String = "";

@@ -1441,14 +1440,14 @@
     public function set status(value:String):void
     {

-       	_status = value;
-       	statusChanged = true;
+        _status = value;
+        statusChanged = true;

         invalidateProperties();
         invalidateSize();
         invalidateViewMetricsAndPadding();

-		dispatchEvent(new Event("statusChanged"));
+        dispatchEvent(new Event("statusChanged"));
     }

     //----------------------------------
@@ -1456,7 +1455,7 @@
     //----------------------------------

     /**
-	 *  @private
+     *  @private
      *  Storage for the statusBar property.
      */
     private var _statusBar:UIComponent;
@@ -1466,27 +1465,27 @@
      */
     public function get statusBar():UIComponent
     {
-    	return _statusBar;
+        return _statusBar;
     }

     //----------------------------------
     //  statusBarFactory
     //----------------------------------
-
-	/**
-	 *  @private
-	 *  Storage for the statusBarFactory property
-	 */
-	private var _statusBarFactory:IFactory = new ClassFactory(StatusBar);
-
-    /**
-     *  @private
-     */
-	private var statusBarFactoryChanged:Boolean = false;
-
-	[Bindable("statusBarFactoryChanged")]
-
-	/**
+
+    /**
+     *  @private
+     *  Storage for the statusBarFactory property
+     */
+    private var _statusBarFactory:IFactory = new ClassFactory(StatusBar);
+
+    /**
+     *  @private
+     */
+    private var statusBarFactoryChanged:Boolean = false;
+
+    [Bindable("statusBarFactoryChanged")]
+
+    /**
      *  The IFactory that creates an instance to use
      *  as the status bar.
      *  The default value is an IFactory for StatusBar.
@@ -1505,9 +1504,9 @@
     public function set statusBarFactory(value:IFactory):void
     {
         _statusBarFactory = value;
-		statusBarFactoryChanged = true;
-
-		invalidateProperties();
+        statusBarFactoryChanged = true;
+
+        invalidateProperties();

         dispatchEvent(new Event("statusBarFactoryChanged"));
     }
@@ -1525,7 +1524,7 @@

     /**
      *  Set of styles to pass from the window to the status bar.
-	 *
+     *
      *  @see mx.styles.StyleProxy
      */
     protected function get statusBarStyleFilters():Object
@@ -1533,46 +1532,46 @@
         return _statusBarStyleFilters;
     }

-	//----------------------------------
-	//  systemChrome
-	//----------------------------------
-
-	/**
-	 *  @private
-	 *  Storage for the systemChrome property.
-	 */
-	private var _systemChrome:String = "standard";
-
-	/**
-	 *  Specifies the type of system chrome (if any) the window has.
-	 *  The set of possible values is defined by the constants
-	 *  in the NativeWindowSystemChrome class.
-	 *
-	 *
This property is read-only once the window has been opened.

-	 *
-	 *
The default value is NativeWindowSystemChrome.STANDARD.

-	 *
-	 *  @see flash.display.NativeWindowSystemChrome
-	 *  @see flash.display.NativeWindowInitOptions#systemChrome
-	 */
-	public function get systemChrome():String
-	{
-		return _systemChrome;
-	}
-
-	/**
-	 *  @private
-	 */
-	public function set systemChrome(value:String):void
-	{
-		if (!_nativeWindow)
-		{
-			_systemChrome = value;
-
-			invalidateProperties();
-		}
-	}
-
+    //----------------------------------
+    //  systemChrome
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the systemChrome property.
+     */
+    private var _systemChrome:String = "standard";
+
+    /**
+     *  Specifies the type of system chrome (if any) the window has.
+     *  The set of possible values is defined by the constants
+     *  in the NativeWindowSystemChrome class.
+     *
+     *
This property is read-only once the window has been opened.

+     *
+     *
The default value is NativeWindowSystemChrome.STANDARD.

+     *
+     *  @see flash.display.NativeWindowSystemChrome
+     *  @see flash.display.NativeWindowInitOptions#systemChrome
+     */
+    public function get systemChrome():String
+    {
+        return _systemChrome;
+    }
+
+    /**
+     *  @private
+     */
+    public function set systemChrome(value:String):void
+    {
+        if (!_nativeWindow)
+        {
+            _systemChrome = value;
+
+            invalidateProperties();
+        }
+    }
+
     //----------------------------------
     //  title
     //----------------------------------
@@ -1606,8 +1605,8 @@
      */
     public function set title(value:String):void
     {
-       	titleChanged = true;
-       	_title = value;
+        titleChanged = true;
+        _title = value;

         invalidateProperties();
         invalidateSize();
@@ -1622,7 +1621,7 @@
     //----------------------------------

     /**
-	 *  @private
+     *  @private
      *  Storage for the titleBar property.
      */
     private var _titleBar:UIComponent;
@@ -1632,27 +1631,27 @@
      */
     public function get titleBar():UIComponent
     {
-    	return _titleBar;
+        return _titleBar;
     }

     //----------------------------------
     //  titleBarFactory
     //----------------------------------
-
-	/**
-	 *  @private
-	 *  Storage for the titleBarFactory property
-	 */
-	private var _titleBarFactory:IFactory = new ClassFactory(TitleBar);
-
-	/**
-     *  @private
-     */
-	private var titleBarFactoryChanged:Boolean = false;
-
-	[Bindable("titleBarFactoryChanged")]
-
-	/**
+
+    /**
+     *  @private
+     *  Storage for the titleBarFactory property
+     */
+    private var _titleBarFactory:IFactory = new ClassFactory(TitleBar);
+
+    /**
+     *  @private
+     */
+    private var titleBarFactoryChanged:Boolean = false;
+
+    [Bindable("titleBarFactoryChanged")]
+
+    /**
      *  The IFactory that creates an instance to use
      *  as the title bar.
      *  The default value is an IFactory for TitleBar.
@@ -1672,9 +1671,9 @@
     public function set titleBarFactory(value:IFactory):void
     {
         _titleBarFactory = value;
-		titleBarFactoryChanged = true;
-
-		invalidateProperties();
+        titleBarFactoryChanged = true;
+
+        invalidateProperties();

         dispatchEvent(new Event("titleBarFactoryChanged"));
     }
@@ -1685,24 +1684,24 @@

     private static var _titleBarStyleFilters:Object =
     {
-		"buttonAlignment" : "buttonAlignment",
-		"buttonPadding" : "buttonPadding",
-		"closeButtonSkin" : "closeButtonSkin",
-		"cornerRadius" : "cornerRadius",
-		"headerHeight" : "headerHeight",
-		"maximizeButtonSkin" : "maximizeButtonSkin",
-		"minimizeButtonSkin" : "minimizeButtonSkin",
-		"restoreButtonSkin" : "restoreButtonSkin",
-		"titleAlignment" : "titleAlignment",
-		"titleBarBackgroundSkin" : "titleBarBackgroundSkin",
-		"titleBarButtonPadding" : "titleBarButtonPadding",
-		"titleBarColors" : "titleBarColors",
-		"titleTextStyleName" : "titleTextStyleName"
-	};
+        "buttonAlignment" : "buttonAlignment",
+        "buttonPadding" : "buttonPadding",
+        "closeButtonSkin" : "closeButtonSkin",
+        "cornerRadius" : "cornerRadius",
+        "headerHeight" : "headerHeight",
+        "maximizeButtonSkin" : "maximizeButtonSkin",
+        "minimizeButtonSkin" : "minimizeButtonSkin",
+        "restoreButtonSkin" : "restoreButtonSkin",
+        "titleAlignment" : "titleAlignment",
+        "titleBarBackgroundSkin" : "titleBarBackgroundSkin",
+        "titleBarButtonPadding" : "titleBarButtonPadding",
+        "titleBarColors" : "titleBarColors",
+        "titleTextStyleName" : "titleTextStyleName"
+    };

     /**
      *  Set of styles to pass from the Window to the titleBar.
-	 *
+     *
      *  @see mx.styles.StyleProxy
      */
     protected function get titleBarStyleFilters():Object
@@ -1710,10 +1709,10 @@
         return _titleBarStyleFilters;
     }

-	//----------------------------------
-	//  titleIcon
-	//----------------------------------
-
+    //----------------------------------
+    //  titleIcon
+    //----------------------------------
+
     /**
      *  @private
      *  Storage for the titleIcon property.
@@ -1742,8 +1741,8 @@
      */
     public function set titleIcon(value:Class):void
     {
-       	_titleIcon = value;
-       	titleIconChanged = true;
+        _titleIcon = value;
+        titleIconChanged = true;

         invalidateProperties();
         invalidateSize();
@@ -1753,81 +1752,81 @@
         dispatchEvent(new Event("titleIconChanged"));
     }

-	//----------------------------------
-	//  transparent
-	//----------------------------------
-
-	/**
-	 *  @private
-	 *  Storage for the transparent property.
-	 */
-	private var _transparent:Boolean = false;
-
-	/**
-	 *  Specifies whether the window is transparent. Setting this
-	 *  property to true for a window that uses
-	 *  system chrome is not supported.
-	 *
-	 *
This property is read-only after the window has been opened.

-	 */
-	public function get transparent():Boolean
-	{
-		return _transparent;
-	}
-
-	/**
-	 *  @private
-	 */
-	public function set transparent(value:Boolean):void
-	{
-		if (!_nativeWindow)
-		{
-			_transparent = value;
-
-			invalidateProperties();
-		}
-	}
-
-	//----------------------------------
-	//  type
-	//----------------------------------
-
-	/**
-	 *  @private
-	 *  Storage for the type property.
-	 */
-	private var _type:String = "normal";
-
-	/**
-	 *  Specifies the type of NativeWindow that this component
-	 *  represents. The set of possible values is defined by the constants
-	 *  in the NativeWindowType class.
-	 *
-	 *
This property is read-only once the window has been opened.

-	 *
-	 *
The default value is NativeWindowType.NORMAL.

-	 *
-	 *  @see flash.display.NativeWindowType
-	 *  @see flash.display.NativeWindowInitOptions#type
-	 */
-	public function get type():String
-	{
-		return _type;
-	}
-
-	/**
-	 *  @private
-	 */
-	public function set type(value:String):void
-	{
-		if (!_nativeWindow)
-		{
-			_type = value;
-
-			invalidateProperties();
-		}
-	}
-
+    //----------------------------------
+    //  transparent
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the transparent property.
+     */
+    private var _transparent:Boolean = false;
+
+    /**
+     *  Specifies whether the window is transparent. Setting this
+     *  property to true for a window that uses
+     *  system chrome is not supported.
+     *
+     *
This property is read-only after the window has been opened.

+     */
+    public function get transparent():Boolean
+    {
+        return _transparent;
+    }
+
+    /**
+     *  @private
+     */
+    public function set transparent(value:Boolean):void
+    {
+        if (!_nativeWindow)
+        {
+            _transparent = value;
+
+            invalidateProperties();
+        }
+    }
+
+    //----------------------------------
+    //  type
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the type property.
+     */
+    private var _type:String = "normal";
+
+    /**
+     *  Specifies the type of NativeWindow that this component
+     *  represents. The set of possible values is defined by the constants
+     *  in the NativeWindowType class.
+     *
+     *
This property is read-only once the window has been opened.

+     *
+     *
The default value is NativeWindowType.NORMAL.

+     *
+     *  @see flash.display.NativeWindowType
+     *  @see flash.display.NativeWindowInitOptions#type
+     */
+    public function get type():String
+    {
+        return _type;
+    }
+
+    /**
+     *  @private
+     */
+    public function set type(value:String):void
+    {
+        if (!_nativeWindow)
+        {
+            _type = value;
+
+            invalidateProperties();
+        }
+    }
+
     //--------------------------------------------------------------------------
     //
     //  Overridden methods: UIComponent
@@ -1870,61 +1869,61 @@
      */
     override protected function createChildren():void
     {
-    	// this is to help initialize the stage
+        // this is to help initialize the stage
         width = _bounds.width;
         height = _bounds.height;

-		super.createChildren();
-
-		if (getStyle("showFlexChrome") == false ||
-			getStyle("showFlexChrome") == "false")
-        {
-        	setStyle("borderStyle", "none");
-        	setStyle("backgroundAlpha", 0);
-        	return;
-        }
-
-      	if (systemManager.stage.nativeWindow.type != "utility")
-        {
-	        if (!_statusBar)
-	        {
-          		_statusBar = statusBarFactory.newInstance();
-            	_statusBar.styleName = new StyleProxy(this, statusBarStyleFilters);
-            	rawChildren.addChild(DisplayObject(_statusBar));
-      	        showStatusBarChanged = true;
-	        }
-	    }
+        super.createChildren();
+
+        if (getStyle("showFlexChrome") == false ||
+            getStyle("showFlexChrome") == "false")
+        {
+            setStyle("borderStyle", "none");
+            setStyle("backgroundAlpha", 0);
+            return;
+        }
+
+        if (systemManager.stage.nativeWindow.type != "utility")
+        {
+            if (!_statusBar)
+            {
+                _statusBar = statusBarFactory.newInstance();
+                _statusBar.styleName = new StyleProxy(this, statusBarStyleFilters);
+                rawChildren.addChild(DisplayObject(_statusBar));
+                showStatusBarChanged = true;
+            }
+        }

         if (!gripper)
         {
-        	gripper = new Button();
-        	var gripSkin:String = getStyle("gripperStyleName");
-        	if (gripSkin)
-        	{
-        		var tmp:CSSStyleDeclaration =
+            gripper = new Button();
+            var gripSkin:String = getStyle("gripperStyleName");
+            if (gripSkin)
+            {
+                var tmp:CSSStyleDeclaration =
                     StyleManager.getStyleDeclaration("." + gripSkin);
                 gripper.styleName = gripSkin;
             }
-			gripper.tabEnabled = false;
+            gripper.tabEnabled = false;
             rawChildren.addChild(gripper);
             gripperHit = new Sprite();
-  			rawChildren.addChild(gripperHit);
+            rawChildren.addChild(gripperHit);
             gripperHit.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
         }

-    	if (systemManager.stage.nativeWindow.systemChrome != "none")
-        {
-			setStyle("borderStyle", "none");
+        if (systemManager.stage.nativeWindow.systemChrome != "none")
+        {
+            setStyle("borderStyle", "none");
             return;
         }
-
+
         if (!_titleBar)
         {
             _titleBar = titleBarFactory.newInstance();
-        	_titleBar.styleName = new StyleProxy(this, titleBarStyleFilters);
-        	rawChildren.addChild(DisplayObject(titleBar));
-        	showTitleBarChanged = true;
-		}
+            _titleBar.styleName = new StyleProxy(this, titleBarStyleFilters);
+            rawChildren.addChild(DisplayObject(titleBar));
+            showTitleBarChanged = true;
+        }
     }

     /**
@@ -1937,86 +1936,86 @@
         // Create and open window.
         if (flagForOpen && !_nativeWindow)
         {
-        	var init:NativeWindowInitOptions = new NativeWindowInitOptions();
-        	init.maximizable = _maximizable;
-        	init.minimizable = _minimizable;
-        	init.resizable = _resizable;
-        	init.type = _type;
-        	init.systemChrome = _systemChrome;
-        	init.transparent = _transparent;
-
-        	_nativeWindow = new NativeWindow(init);
-			var sm:WindowedSystemManager = new WindowedSystemManager(this);
-			_nativeWindow.stage.addChild(sm);
-	    	systemManager = sm;
-
-	    	sm.window = this;
-
-	    	_nativeWindow.alwaysInFront = _alwaysInFront;
-	    	initManagers(sm);
-	     	addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
-
-	        var nativeApplication:NativeApplication = NativeApplication.nativeApplication;
-	 		nativeApplication.addEventListener(Event.ACTIVATE, nativeApplication_activateHandler, false, 0, true);
-	 		nativeApplication.addEventListener(Event.DEACTIVATE, nativeApplication_deactivateHandler, false, 0, true);
-	 		nativeApplication.addEventListener(Event.NETWORK_CHANGE,
- 				nativeApplication_networkChangeHandler, false, 0, true);
- 			_nativeWindow.addEventListener("activate", nativeWindow_activateHandler, false, 0, true);
+            var init:NativeWindowInitOptions = new NativeWindowInitOptions();
+            init.maximizable = _maximizable;
+            init.minimizable = _minimizable;
+            init.resizable = _resizable;
+            init.type = _type;
+            init.systemChrome = _systemChrome;
+            init.transparent = _transparent;
+
+            _nativeWindow = new NativeWindow(init);
+            var sm:WindowedSystemManager = new WindowedSystemManager(this);
+            _nativeWindow.stage.addChild(sm);
+            systemManager = sm;
+
+            sm.window = this;
+
+            _nativeWindow.alwaysInFront = _alwaysInFront;
+            initManagers(sm);
+            addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
+
+            var nativeApplication:NativeApplication = NativeApplication.nativeApplication;
+            nativeApplication.addEventListener(Event.ACTIVATE, nativeApplication_activateHandler, false, 0, true);
+            nativeApplication.addEventListener(Event.DEACTIVATE, nativeApplication_deactivateHandler, false, 0, true);
+            nativeApplication.addEventListener(Event.NETWORK_CHANGE,
+                nativeApplication_networkChangeHandler, false, 0, true);
+            _nativeWindow.addEventListener("activate", nativeWindow_activateHandler, false, 0, true);
             _nativeWindow.addEventListener("deactivate", nativeWindow_deactivateHandler, false, 0, true);

- 			addEventListener(Event.ENTER_FRAME, enterFrameHandler);
-
- 			//'register' with WindowedSystemManager so it can cleanup when done.
- 			sm.addWindow(this);
+            addEventListener(Event.ENTER_FRAME, enterFrameHandler);
+
+            //'register' with WindowedSystemManager so it can cleanup when done.
+            sm.addWindow(this);
         }

         // minimum width and height
-		if (minWidthChanged || minHeightChanged)
-		{
-			var newMinWidth:Number = minWidthChanged ? _minWidth + chromeWidth() : nativeWindow.minSize.x;
-			var newMinHeight:Number = minHeightChanged ? _minHeight + chromeHeight() : nativeWindow.minSize.y;
-
-			nativeWindow.minSize = new Point(newMinWidth, newMinHeight);
-
-			if (minWidthChanged)
-			{
-				minWidthChanged = false;
-				if (width < minWidth)
-            		width = minWidth;
-        		dispatchEvent(new Event("minWidthChanged"));
-   			}
-        	if (minHeightChanged)
-        	{
-        		minHeightChanged = false;
-        		if (height < minHeight)
-            		height = minHeight;
-        		dispatchEvent(new Event("minHeightChanged"));
-        	}
-		}
-
-		// maximum width and height
-		if (maxWidthChanged || maxHeightChanged)
-		{
-			var newMaxWidth:Number = maxWidthChanged ? _maxWidth + chromeWidth() : nativeWindow.maxSize.x;
-			var newMaxHeight:Number = maxHeightChanged ? _maxHeight + chromeHeight() : nativeWindow.maxSize.y;
-
-			nativeWindow.maxSize = new Point(newMaxWidth, newMaxHeight);
-
-			if (maxWidthChanged)
-			{
-				maxWidthChanged = false;
-				if (width > maxWidth)
-            		width = maxWidth;
-        		dispatchEvent(new Event("maxWidthChanged"));
-   			}
-			if (maxHeightChanged)
-			{
-				maxHeightChanged = false;
-				if (height > maxHeight)
-            		height = maxHeight;
-        		dispatchEvent(new Event("maxHeightChanged"));
-   			}
-		}
+        if (minWidthChanged || minHeightChanged)
+        {
+            var newMinWidth:Number = minWidthChanged ? _minWidth + chromeWidth() : nativeWindow.minSize.x;
+            var newMinHeight:Number = minHeightChanged ? _minHeight + chromeHeight() : nativeWindow.minSize.y;
+
+            nativeWindow.minSize = new Point(newMinWidth, newMinHeight);
+
+            if (minWidthChanged)
+            {
+                minWidthChanged = false;
+                if (width < minWidth)
+                    width = minWidth;
+                dispatchEvent(new Event("minWidthChanged"));
+            }
+            if (minHeightChanged)
+            {
+                minHeightChanged = false;
+                if (height < minHeight)
+                    height = minHeight;
+                dispatchEvent(new Event("minHeightChanged"));
+            }
+        }
+
+        // maximum width and height
+        if (maxWidthChanged || maxHeightChanged)
+        {
+            var newMaxWidth:Number = maxWidthChanged ? _maxWidth + chromeWidth() : nativeWindow.maxSize.x;
+            var newMaxHeight:Number = maxHeightChanged ? _maxHeight + chromeHeight() : nativeWindow.maxSize.y;
+
+            nativeWindow.maxSize = new Point(newMaxWidth, newMaxHeight);
+
+            if (maxWidthChanged)
+            {
+                maxWidthChanged = false;
+                if (width > maxWidth)
+                    width = maxWidth;
+                dispatchEvent(new Event("maxWidthChanged"));
+            }
+            if (maxHeightChanged)
+            {
+                maxHeightChanged = false;
+                if (height > maxHeight)
+                    height = maxHeight;
+                dispatchEvent(new Event("maxHeightChanged"));
+            }
+        }

         if (boundsChanged)
         {
@@ -2032,27 +2031,27 @@

         if (menuChanged && !nativeWindow.closed)
         {
-			menuChanged = false;
-
-			if (menu == null)
-			{
-		    	if (NativeWindow.supportsMenu)
-		    		nativeWindow.menu = null;
-			}
-			else if (menu.nativeMenu)
-			{
-		    	if (NativeWindow.supportsMenu)
-		    		nativeWindow.menu = menu.nativeMenu;
-		    }
-
-		    dispatchEvent(new Event("menuChanged"));
+            menuChanged = false;
+
+            if (menu == null)
+            {
+                if (NativeWindow.supportsMenu)
+                    nativeWindow.menu = null;
+            }
+            else if (menu.nativeMenu)
+            {
+                if (NativeWindow.supportsMenu)
+                    nativeWindow.menu = menu.nativeMenu;
+            }
+
+            dispatchEvent(new Event("menuChanged"));
         }

         if (titleBarFactoryChanged)
         {
-        	if (_titleBar)
-            {
-           		// Remove old titleBar.
+            if (_titleBar)
+            {
+                // Remove old titleBar.
                 rawChildren.removeChild(DisplayObject(titleBar));
                 _titleBar = null;
             }
@@ -2065,30 +2064,30 @@

         if (showTitleBarChanged)
         {
-        	if (_titleBar)
-        		_titleBar.visible = _showTitleBar;
-        	showTitleBarChanged = false;
+            if (_titleBar)
+                _titleBar.visible = _showTitleBar;
+            showTitleBarChanged = false;
         }

         if (titleIconChanged)
         {
-        	if (_titleBar && "titleIcon" in _titleBar)
-        		_titleBar["titleIcon"] = _titleIcon;
-        	titleIconChanged = false;
+            if (_titleBar && "titleIcon" in _titleBar)
+                _titleBar["titleIcon"] = _titleIcon;
+            titleIconChanged = false;
         }

         if (titleChanged)
         {
             if (!nativeWindow.closed)
-            	systemManager.stage.nativeWindow.title = _title;
-        	if (_titleBar && "title" in _titleBar)
-        		_titleBar["title"] = _title;
+                systemManager.stage.nativeWindow.title = _title;
+            if (_titleBar && "title" in _titleBar)
+                _titleBar["title"] = _title;
             titleChanged = false;
         }

         if (statusBarFactoryChanged)
         {
-        	if (_statusBar)
+            if (_statusBar)
             {
                 // Remove old status bar.
                 rawChildren.removeChild(DisplayObject(_statusBar));
@@ -2098,9 +2097,9 @@
             _statusBar.styleName = new StyleProxy(this, statusBarStyleFilters);
             // Add it underneath the gripper.
             if (gripper)
-            	rawChildren.addChildAt(DisplayObject(_statusBar), rawChildren.getChildIndex(gripper));
+                rawChildren.addChildAt(DisplayObject(_statusBar), rawChildren.getChildIndex(gripper));
             else
-            	rawChildren.addChild(DisplayObject(_statusBar));
+                rawChildren.addChild(DisplayObject(_statusBar));
             statusBarFactoryChanged = false;
             showStatusBarChanged = true;
             invalidateDisplayList();
@@ -2109,32 +2108,32 @@
         if (showStatusBarChanged)
         {
             if (_statusBar)
-	            _statusBar.visible = _showStatusBar;
+                _statusBar.visible = _showStatusBar;
             showStatusBarChanged = false;
         }

         if (statusChanged)
         {
-        	if (_statusBar && "status" in _statusBar)
-        		_statusBar["status"] = _status;
-        	statusChanged = false;
+            if (_statusBar && "status" in _statusBar)
+                _statusBar["status"] = _status;
+            statusChanged = false;
         }

         if (showGripperChanged)
         {
-        	if (gripper)
-        	{
-        		gripper.visible = _showGripper;
-        		gripperHit.visible = _showGripper;
-        	}
-        	showGripperChanged = false;
+            if (gripper)
+            {
+                gripper.visible = _showGripper;
+                gripperHit.visible = _showGripper;
+            }
+            showGripperChanged = false;
         }

         if (toMax)
         {
-        	toMax = false;
-        	if (!nativeWindow.closed)
-        		nativeWindow.maximize();
+            toMax = false;
+            if (!nativeWindow.closed)
+                nativeWindow.maximize();
         }

         // If nativeWindow has not been created yet, it's time.
@@ -2147,97 +2146,97 @@
     {
         if (maximized)
         {
-        	maximized = false;
-        	if (!nativeWindow.closed)
-        		systemManager.stage.nativeWindow.maximize();
+            maximized = false;
+            if (!nativeWindow.closed)
+                systemManager.stage.nativeWindow.maximize();
         }

         super.measure();
     }

-	/**
-     *  @private
-     */
-	override public function validateDisplayList():void
-	{
-		super.validateDisplayList();
-		if (Capabilities.os.substring(0, 3) == "Mac" && systemChrome == "standard")
-        {
-        	//need to move the scroll bars to not overlap the systemChrome gripper
-        	//if both scrollbars are already visible, this has been done for us
-        	if ((horizontalScrollBar || verticalScrollBar) && !(horizontalScrollBar && verticalScrollBar) && !showStatusBar)
-        	{
-            	if (!whiteBox)
-	            {
-	                whiteBox = new FlexShape();
-	                whiteBox.name = "whiteBox";
-
-	                var g:Graphics = whiteBox.graphics;
-	                g.beginFill(0xFFFFFF);
-	                g.drawRect(0, 0, verticalScrollBar ? verticalScrollBar.minWidth : 15, horizontalScrollBar ? horizontalScrollBar.minHeight : 15);
-	                g.endFill()
-
-	                rawChildren.addChild(whiteBox);
-	            }
-        		whiteBox.visible = true;
-
-
-	        	if (horizontalScrollBar)
-				{
-	                horizontalScrollBar.setActualSize(
-						horizontalScrollBar.width - whiteBox.width,
-						horizontalScrollBar.height);
-				}
-	            if (verticalScrollBar)
-				{
-	                verticalScrollBar.setActualSize(
-						verticalScrollBar.width,
-						verticalScrollBar.height - whiteBox.height);
-				}
-	            whiteBox.x = systemManager.stage.stageWidth - whiteBox.width;
-	            whiteBox.y = systemManager.stage.stageHeight - whiteBox.height;
-         	}
-         	else if (!(horizontalScrollBar && verticalScrollBar))
-         	{
-         		if (whiteBox)
-	            {
-	                rawChildren.removeChild(whiteBox);
-	                whiteBox = null;
-	            }
-          	}
-        }
-		else if (gripper && showGripper && !showStatusBar)
-		{
-			//see if there are both scrollbars
-       		if (whiteBox)
-       		{
-       			whiteBox.visible = false;
-       			//if gripper + padding > whiteBox size, we need to move scrollbars
-       			//this is, um, generally non-optimal looking
-       			if (gripperHit.height > whiteBox.height)
-       				verticalScrollBar.setActualSize(verticalScrollBar.width,
-       					verticalScrollBar.height - (gripperHit.height - whiteBox.height));
-       			if (gripperHit.width > whiteBox.width)
-       				horizontalScrollBar.setActualSize(
-       						horizontalScrollBar.width - (gripperHit.width  - whiteBox.height),
-       						horizontalScrollBar.height);
-       		}
-       		else if (horizontalScrollBar)
-       		{
-       			horizontalScrollBar.setActualSize(
-					horizontalScrollBar.width - gripperHit.width,
-					horizontalScrollBar.height);
-       		}
-       		else if (verticalScrollBar)
-       		{
-       			verticalScrollBar.setActualSize(
-					verticalScrollBar.width,
-					verticalScrollBar.height - gripperHit.height);
-       		}
-  		}
-  		else if (whiteBox)//if there's no gripper, we need to show the white box, if appropriate
-  			whiteBox.visible = true;
-	}
+    /**
+     *  @private
+     */
+    override public function validateDisplayList():void
+    {
+        super.validateDisplayList();
+        if (Capabilities.os.substring(0, 3) == "Mac" && systemChrome == "standard")
+        {
+            //need to move the scroll bars to not overlap the systemChrome gripper
+            //if both scrollbars are already visible, this has been done for us
+            if ((horizontalScrollBar || verticalScrollBar) && !(horizontalScrollBar && verticalScrollBar) && !showStatusBar)
+            {
+                if (!whiteBox)
+                {
+                    whiteBox = new FlexShape();
+                    whiteBox.name = "whiteBox";
+
+                    var g:Graphics = whiteBox.graphics;
+                    g.beginFill(0xFFFFFF);
+                    g.drawRect(0, 0, verticalScrollBar ? verticalScrollBar.minWidth : 15, horizontalScrollBar ? horizontalScrollBar.minHeight : 15);
+                    g.endFill()
+
+                    rawChildren.addChild(whiteBox);
+                }
+                whiteBox.visible = true;
+
+
+                if (horizontalScrollBar)
+                {
+                    horizontalScrollBar.setActualSize(
+                        horizontalScrollBar.width - whiteBox.width,
+                        horizontalScrollBar.height);
+                }
+                if (verticalScrollBar)
+                {
+                    verticalScrollBar.setActualSize(
+                        verticalScrollBar.width,
+                        verticalScrollBar.height - whiteBox.height);
+                }
+                whiteBox.x = systemManager.stage.stageWidth - whiteBox.width;
+                whiteBox.y = systemManager.stage.stageHeight - whiteBox.height;
+            }
+            else if (!(horizontalScrollBar && verticalScrollBar))
+            {
+                if (whiteBox)
+                {
+                    rawChildren.removeChild(whiteBox);
+                    whiteBox = null;
+                }
+            }
+        }
+        else if (gripper && showGripper && !showStatusBar)
+        {
+            //see if there are both scrollbars
+            if (whiteBox)
+            {
+                whiteBox.visible = false;
+                //if gripper + padding > whiteBox size, we need to move scrollbars
+                //this is, um, generally non-optimal looking
+                if (gripperHit.height > whiteBox.height)
+                    verticalScrollBar.setActualSize(verticalScrollBar.width,
+                        verticalScrollBar.height - (gripperHit.height - whiteBox.height));
+                if (gripperHit.width > whiteBox.width)
+                    horizontalScrollBar.setActualSize(
+                            horizontalScrollBar.width - (gripperHit.width  - whiteBox.height),
+                            horizontalScrollBar.height);
+            }
+            else if (horizontalScrollBar)
+            {
+                horizontalScrollBar.setActualSize(
+                    horizontalScrollBar.width - gripperHit.width,
+                    horizontalScrollBar.height);
+            }
+            else if (verticalScrollBar)
+            {
+                verticalScrollBar.setActualSize(
+                    verticalScrollBar.width,
+                    verticalScrollBar.height - gripperHit.height);
+            }
+        }
+        else if (whiteBox)//if there's no gripper, we need to show the white box, if appropriate
+            whiteBox.visible = true;
+    }

     /**
      *  @private
@@ -2247,77 +2246,77 @@
     {
         if (!nativeWindow.closed)
         {
-	        super.updateDisplayList(unscaledWidth, unscaledHeight);
-	        // Application.updateDisplayList can change the width and height.
-	        // We use their new values.
-
-			resizeWidth = isNaN(explicitWidth);
-	        resizeHeight = isNaN(explicitHeight);
-	        if (resizeWidth || resizeHeight)
-	        {
-	            resizeHandler(new Event(Event.RESIZE));
-
-	            if (!resizeHandlerAdded)
-	            {
-	                // weak reference
-	                systemManager.addEventListener(Event.RESIZE, resizeHandler, false, 0, true);
-	                resizeHandlerAdded = true;
-	            }
-	        }
-	        else
-	        {
-	            if (resizeHandlerAdded)
-	            {
-	                systemManager.removeEventListener(Event.RESIZE, resizeHandler);
-	                resizeHandlerAdded = false;
-	            }
-	        }
-
-	        // Wait to layout the border after all the children
-	        // have been positioned.
-	        createBorder();
-
-	        var bm:EdgeMetrics = borderMetrics;
-
-	        var leftOffset:Number = 10;
-	        var rightOffset:Number = 10;
-
-	        if (_statusBar)
-	        {
-	        	_statusBar.move(bm.left, unscaledHeight - bm.bottom - getStatusBarHeight());
-	        	_statusBar.setActualSize(unscaledWidth - bm.left - bm.right, getStatusBarHeight());
-
-	        }
-
-	        if (systemManager.stage.nativeWindow.systemChrome != "none")
-	            return;
-
-	        var buttonAlign:String =
-				String(getStyle("buttonAlignment"));
-	        if (titleBar)
-	        {
-		        titleBar.move(bm.left, bm.top);
-		        titleBar.setActualSize(unscaledWidth - bm.left - bm.right,
-		                               getHeaderHeight());
-	        }
-	        if (titleBar && controlBar)
-	        	controlBar.move(0, titleBar.height);
-	        if (gripper && showGripper)
-	       	{
-	       		var gripperPadding:Number = getStyle("gripperPadding");
-	       		gripper.setActualSize(gripper.measuredWidth,
-	       							  gripper.measuredHeight);
-	       		gripperHit.graphics.beginFill(0xffffff, .0001);
-	       		gripperHit.graphics.drawRect(0, 0, gripper.width + (2 * gripperPadding), gripper.height + (2 * gripperPadding));
-	       		gripper.move(unscaledWidth - gripper.measuredWidth - gripperPadding,
-	       					unscaledHeight - gripper.measuredHeight - gripperPadding);
-	       		gripperHit.x = gripper.x - gripperPadding;
-	       		gripperHit.y = gripper.y - gripperPadding;
-	       	}
-	    }
-    }
-
-	/**
+            super.updateDisplayList(unscaledWidth, unscaledHeight);
+            // Application.updateDisplayList can change the width and height.
+            // We use their new values.
+
+            resizeWidth = isNaN(explicitWidth);
+            resizeHeight = isNaN(explicitHeight);
+            if (resizeWidth || resizeHeight)
+            {
+                resizeHandler(new Event(Event.RESIZE));
+
+                if (!resizeHandlerAdded)
+                {
+                    // weak reference
+                    systemManager.addEventListener(Event.RESIZE, resizeHandler, false, 0, true);
+                    resizeHandlerAdded = true;
+                }
+            }
+            else
+            {
+                if (resizeHandlerAdded)
+                {
+                    systemManager.removeEventListener(Event.RESIZE, resizeHandler);
+                    resizeHandlerAdded = false;
+                }
+            }
+
+            // Wait to layout the border after all the children
+            // have been positioned.
+            createBorder();
+
+            var bm:EdgeMetrics = borderMetrics;
+
+            var leftOffset:Number = 10;
+            var rightOffset:Number = 10;
+
+            if (_statusBar)
+            {
+                _statusBar.move(bm.left, unscaledHeight - bm.bottom - getStatusBarHeight());
+                _statusBar.setActualSize(unscaledWidth - bm.left - bm.right, getStatusBarHeight());
+
+            }
+
+            if (systemManager.stage.nativeWindow.systemChrome != "none")
+                return;
+
+            var buttonAlign:String =
+                String(getStyle("buttonAlignment"));
+            if (titleBar)
+            {
+                titleBar.move(bm.left, bm.top);
+                titleBar.setActualSize(unscaledWidth - bm.left - bm.right,
+                                       getHeaderHeight());
+            }
+            if (titleBar && controlBar)
+                controlBar.move(0, titleBar.height);
+            if (gripper && showGripper)
+            {
+                var gripperPadding:Number = getStyle("gripperPadding");
+                gripper.setActualSize(gripper.measuredWidth,
+                                      gripper.measuredHeight);
+                gripperHit.graphics.beginFill(0xffffff, .0001);
+                gripperHit.graphics.drawRect(0, 0, gripper.width + (2 * gripperPadding), gripper.height + (2 * gripperPadding));
+                gripper.move(unscaledWidth - gripper.measuredWidth - gripperPadding,
+                            unscaledHeight - gripper.measuredHeight - gripperPadding);
+                gripperHit.x = gripper.x - gripperPadding;
+                gripperHit.y = gripper.y - gripperPadding;
+            }
+        }
+    }
+
+    /**
      *  @private
      */
     override public function styleChanged(styleProp:String):void
@@ -2325,16 +2324,16 @@
         super.styleChanged(styleProp);
         if (!nativeWindow.closed)
         {
-	        if (!(getStyle("showFlexChrome") == "false" || getStyle("showFlexChrome") == false))
-			{
-		     	if (styleProp == null || styleProp == "headerHeight"
-		     			|| styleProp == "gripperPadding")
-		 		{
-		 			invalidateViewMetricsAndPadding();
-		 			invalidateDisplayList();
-		 			invalidateSize();
-		 		}
-		 	}
+            if (!(getStyle("showFlexChrome") == "false" || getStyle("showFlexChrome") == false))
+            {
+                if (styleProp == null || styleProp == "headerHeight"
+                        || styleProp == "gripperPadding")
+                {
+                    invalidateViewMetricsAndPadding();
+                    invalidateDisplayList();
+                    invalidateSize();
+                }
+            }
         }
     }

@@ -2342,17 +2341,17 @@
      *  @private
      */
     override public function move(x:Number, y:Number):void
-	{
-		if (nativeWindow && !nativeWindow.closed)
-		{
-			var tmp:Rectangle = nativeWindow.bounds;
-			tmp.x = x;
-			tmp.y = y;
-			nativeWindow.bounds = tmp;
-		}
-	}
-
-	/**
+    {
+        if (nativeWindow && !nativeWindow.closed)
+        {
+            var tmp:Rectangle = nativeWindow.bounds;
+            tmp.x = x;
+            tmp.y = y;
+            nativeWindow.bounds = tmp;
+        }
+    }
+
+    /**
      *  @private
      *  Window also handles themeColor defined
      *  on the global selector. (Stolen from Application)
@@ -2397,17 +2396,17 @@
      */
     public function close():void
     {
-    	if (_nativeWindow && !nativeWindow.closed)
-    	{
-	    	var e:Event = new Event("closing", false, true);
-	    	stage.nativeWindow.dispatchEvent(e);
-	    	if (!(e.isDefaultPrevented()))
-	    	{
-	    		stage.nativeWindow.close();
-	    		_nativeWindow = null;
-	    		systemManager.removeChild(this);
-	    	}
-    	}
+        if (_nativeWindow && !nativeWindow.closed)
+        {
+            var e:Event = new Event("closing", false, true);
+            stage.nativeWindow.dispatchEvent(e);
+            if (!(e.isDefaultPrevented()))
+            {
+                stage.nativeWindow.close();
+                _nativeWindow = null;
+                systemManager.removeChild(this);
+            }
+        }
     }

     /**
@@ -2416,19 +2415,19 @@
      */
     private function getHeaderHeight():Number
     {
-    	if (!nativeWindow.closed)
-    	{
-	        if (getStyle("headerHeight") != null)
-	        	return getStyle("headerHeight");
-	 		if (!systemManager.stage)
-	 			return 0;
-	        if (systemManager.stage.nativeWindow.systemChrome != "none")
-	            return 0;
-	        if (titleBar)
-		        return(titleBar.getExplicitOrMeasuredHeight());
-	    }
-	    return 0;
-
+        if (!nativeWindow.closed)
+        {
+            if (getStyle("headerHeight") != null)
+                return getStyle("headerHeight");
+            if (!systemManager.stage)
+                return 0;
+            if (systemManager.stage.nativeWindow.systemChrome != "none")
+                return 0;
+            if (titleBar)
+                return(titleBar.getExplicitOrMeasuredHeight());
+        }
+        return 0;
+
     }

     /**
@@ -2438,8 +2437,8 @@
     public function getStatusBarHeight():Number
     {
         if (_statusBar)
-	        return _statusBar.getExplicitOrMeasuredHeight();
-	    return 0;
+            return _statusBar.getExplicitOrMeasuredHeight();
+        return 0;
     }

     /**
@@ -2451,30 +2450,30 @@
         {
             focusManager = new FocusManager(this);
             sm.activate(this);
-			_cursorManager = new CursorManagerImpl(sm);
-        }
-    }
-
- 	/**
+            _cursorManager = new CursorManagerImpl(sm);
+        }
+    }
+
+    /**
      *  Maximizes the window, or does nothing if it's already maximized.
      */
     public function maximize():void
     {
         if (!nativeWindow || !nativeWindow.maximizable || nativeWindow.closed)
-    		return;
+            return;
         if (stage.nativeWindow.displayState!= NativeWindowDisplayState.MAXIMIZED)
         {
-         	var f:NativeWindowDisplayStateEvent = new NativeWindowDisplayStateEvent(
+            var f:NativeWindowDisplayStateEvent = new NativeWindowDisplayStateEvent(
                         NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING,
                         false, true, stage.nativeWindow.displayState,
                         NativeWindowDisplayState.MAXIMIZED);
             stage.nativeWindow.dispatchEvent(f);
-        	if (!f.isDefaultPrevented())
-        	{
-        		toMax = true;
-        		invalidateProperties();
-        		invalidateSize();
-        	}
+            if (!f.isDefaultPrevented())
+            {
+                toMax = true;
+                invalidateProperties();
+                invalidateSize();
+            }
         }
     }

@@ -2483,58 +2482,58 @@
      */
     public function minimize():void
     {
-    	if (!nativeWindow.closed)
-    	{
-	        var e:NativeWindowDisplayStateEvent = new NativeWindowDisplayStateEvent(
-	        		NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING,
-	        		false, true, nativeWindow.displayState,
-	        		NativeWindowDisplayState.MINIMIZED)
-	        stage.nativeWindow.dispatchEvent(e);
-	        if (!e.isDefaultPrevented())
-	        	stage.nativeWindow.minimize();
-     	}
+        if (!nativeWindow.closed)
+        {
+            var e:NativeWindowDisplayStateEvent = new NativeWindowDisplayStateEvent(
+                    NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING,
+                    false, true, nativeWindow.displayState,
+                    NativeWindowDisplayState.MINIMIZED)
+            stage.nativeWindow.dispatchEvent(e);
+            if (!e.isDefaultPrevented())
+                stage.nativeWindow.minimize();
+        }
     }

     /**
      *  Restores the window (unmaximizes it if it's maximized, or
      *  unminimizes it if it's minimized).
      */
-	public function restore():void
-    {
-    	if (!nativeWindow.closed)
-    	{
-	    	var e:NativeWindowDisplayStateEvent;
-	    	if (stage.nativeWindow.displayState == NativeWindowDisplayState.MAXIMIZED)
-	        {
-	          	e = new NativeWindowDisplayStateEvent(
-	                        NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING,
-	                        false, true, NativeWindowDisplayState.MAXIMIZED,
-	                        NativeWindowDisplayState.NORMAL);
-	            stage.nativeWindow.dispatchEvent(e);
-	            if (!e.isDefaultPrevented())
-	            	nativeWindow.restore();
-	        }
-	        else if (stage.nativeWindow.displayState == NativeWindowDisplayState.MINIMIZED)
-	        {
-	        	e = new NativeWindowDisplayStateEvent(
-	                NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING,
-	                false, true, NativeWindowDisplayState.MINIMIZED,
-	                NativeWindowDisplayState.NORMAL);
-	            stage.nativeWindow.dispatchEvent(e);
-	            if (!e.isDefaultPrevented())
-	            	nativeWindow.restore();
-	        }
-	    }
+    public function restore():void
+    {
+        if (!nativeWindow.closed)
+        {
+            var e:NativeWindowDisplayStateEvent;
+            if (stage.nativeWindow.displayState == NativeWindowDisplayState.MAXIMIZED)
+            {
+                e = new NativeWindowDisplayStateEvent(
+                            NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING,
+                            false, true, NativeWindowDisplayState.MAXIMIZED,
+                            NativeWindowDisplayState.NORMAL);
+                stage.nativeWindow.dispatchEvent(e);
+                if (!e.isDefaultPrevented())
+                    nativeWindow.restore();
+            }
+            else if (stage.nativeWindow.displayState == NativeWindowDisplayState.MINIMIZED)
+            {
+                e = new NativeWindowDisplayStateEvent(
+                    NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING,
+                    false, true, NativeWindowDisplayState.MINIMIZED,
+                    NativeWindowDisplayState.NORMAL);
+                stage.nativeWindow.dispatchEvent(e);
+                if (!e.isDefaultPrevented())
+                    nativeWindow.restore();
+            }
+        }
     }

     /**
      *  Activates the underlying NativeWindow (even if this Window's application
-	 *  is not currently active).
+     *  is not currently active).
      */
     public function activate():void
     {
-    	if (!nativeWindow.closed)
-    		_nativeWindow.activate();
+        if (!nativeWindow.closed)
+            _nativeWindow.activate();
     }

     /**
@@ -2542,15 +2541,15 @@
      *
      *  @param  openWindowActive specifies whether the Window opens
      *  activated (that is, whether it has focus). The default value
-	 *  is true.
+     *  is true.
      */
     public function open(openWindowActive:Boolean = true):void
     {
-    	flagForOpen = true;
-    	openActive = openWindowActive;
-    	commitProperties();
-    }
-
+        flagForOpen = true;
+        openActive = openWindowActive;
+        commitProperties();
+    }
+
     /**
      *  Orders the window just behind another. To order the window behind
      *  a NativeWindow that does not implement IWindow, use this window's
@@ -2564,10 +2563,10 @@
      */
     public function orderInBackOf(window:IWindow):Boolean
     {
-     	if (nativeWindow && !nativeWindow.closed)
-     		return nativeWindow.orderInBackOf(window.nativeWindow);
-     	else
-     		return false;
+        if (nativeWindow && !nativeWindow.closed)
+            return nativeWindow.orderInBackOf(window.nativeWindow);
+        else
+            return false;
     }

     /**
@@ -2583,41 +2582,41 @@
      */
     public function orderInFrontOf(window:IWindow):Boolean
     {
-     	if (nativeWindow && !nativeWindow.closed)
-     		return nativeWindow.orderInFrontOf(window.nativeWindow);
-     	else
-     		return false;
-    }
-
-	/**
+        if (nativeWindow && !nativeWindow.closed)
+            return nativeWindow.orderInFrontOf(window.nativeWindow);
+        else
+            return false;
+    }
+
+    /**
      *  Orders the window behind all others in the same application.
      *
      *  @return true if the window was succesfully sent to the back;
      *  false if the window is invisible or minimized.
      */
-	public function orderToBack():Boolean
-	{
-     	if (nativeWindow && !nativeWindow.closed)
-     		return nativeWindow.orderToBack();
-     	else
-     		return false;
-	}
-
-	/**
+    public function orderToBack():Boolean
+    {
+        if (nativeWindow && !nativeWindow.closed)
+            return nativeWindow.orderToBack();
+        else
+            return false;
+    }
+
+    /**
      *  Orders the window in front of all others in the same application.
      *
      *  @return true if the window was succesfully sent to the front;
      *  false if the window is invisible or minimized.
      */
-	public function orderToFront():Boolean
-	{
-		if (nativeWindow && !nativeWindow.closed)
-     		return nativeWindow.orderToFront();
-     	else
-     		return false;
-	}
-
-	/**
+    public function orderToFront():Boolean
+    {
+        if (nativeWindow && !nativeWindow.closed)
+            return nativeWindow.orderToFront();
+        else
+            return false;
+    }
+
+    /**
      *  @private
      *  Returns the width of the chrome for the window
      */
@@ -2634,7 +2633,7 @@
     {
         return nativeWindow.height - systemManager.stage.stageHeight;
     }
-
+
     /**
      *  @private
      *  Starts a system move.
@@ -2674,7 +2673,7 @@
             removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
             _nativeWindow.visible = _nativeWindowVisible;
             dispatchEvent(new AIREvent(AIREvent.WINDOW_COMPLETE));
-
+
             // Event for Automation so we know when windows
             // are created or destroyed.
             if (ApplicationGlobals.application)
@@ -2693,23 +2692,23 @@
         frameCounter++;
     }

-	/**
-	 *  @private
-	 */
-	private function hideEffectEndHandler(event:Event):void
-	{
-		_nativeWindow.visible = false;
-
-		dispatchEvent(new FlexEvent(FlexEvent.HIDE));
-	}
+    /**
+     *  @private
+     */
+    private function hideEffectEndHandler(event:Event):void
+    {
+        _nativeWindow.visible = false;
+
+        dispatchEvent(new FlexEvent(FlexEvent.HIDE));
+    }

     /**
      *  @private
      */
     private function windowMinimizeHandler(event:Event):void
     {
-    	if (!nativeWindow.closed)
-        	stage.nativeWindow.minimize();
+        if (!nativeWindow.closed)
+            stage.nativeWindow.minimize();
         removeEventListener("effectEnd", windowMinimizeHandler);
     }

@@ -2726,19 +2725,19 @@
      */
     private function window_moveHandler(event:NativeWindowBoundsEvent):void
     {
-		var newEvent:FlexNativeWindowBoundsEvent =
-			new FlexNativeWindowBoundsEvent(
-				FlexNativeWindowBoundsEvent.WINDOW_MOVE,
-				event.bubbles, event.cancelable,
-				event.beforeBounds, event.afterBounds);
-		dispatchEvent(newEvent);
+        var newEvent:FlexNativeWindowBoundsEvent =
+            new FlexNativeWindowBoundsEvent(
+                FlexNativeWindowBoundsEvent.WINDOW_MOVE,
+                event.bubbles, event.cancelable,
+                event.beforeBounds, event.afterBounds);
+        dispatchEvent(newEvent);
     }

     /**
      *  @private
      */
     private function window_displayStateChangeHandler(
-                    		event:NativeWindowDisplayStateEvent):void
+                            event:NativeWindowDisplayStateEvent):void
     {
         // Redispatch event .
         dispatchEvent(event);
@@ -2751,13 +2750,13 @@
      *  @private
      */
     private function window_displayStateChangingHandler(
-                    		event:NativeWindowDisplayStateEvent):void
+                            event:NativeWindowDisplayStateEvent):void
     {
         // Redispatch event for cancellation purposes.
         dispatchEvent(event);

         if (event.isDefaultPrevented())
-        	return;
+            return;
         if (event.afterDisplayState == NativeWindowDisplayState.MINIMIZED)
         {
             if (getStyle("minimizeEffect"))
@@ -2783,17 +2782,17 @@
     {
         removeEventListener("effectEnd", windowMaximizeHandler);
         if (!nativeWindow.closed)
-        	stage.nativeWindow.maximize();
-    }
-
-	/**
+            stage.nativeWindow.maximize();
+    }
+
+    /**
      *  @private
      */
     private function windowUnmaximizeHandler(event:Event):void
     {
         removeEventListener("effectEnd", windowUnmaximizeHandler);
         if (!nativeWindow.closed)
-        	stage.nativeWindow.restore();
+            stage.nativeWindow.restore();
     }

     /**
@@ -2805,56 +2804,56 @@
             return;
         if (event.target == gripperHit)
         {
-       		startResize(NativeWindowResize.BOTTOM_RIGHT);
-        	event.stopPropagation();
+            startResize(NativeWindowResize.BOTTOM_RIGHT);
+            event.stopPropagation();
         }
         else
         {
-	        var dragWidth:int = Number(getStyle("borderThickness")) + 6;
-	        var cornerSize:int = 12;
-	        // we short the top a little
-
-	        if (event.stageY < Number(getStyle("borderThickness")))
-	        {
-	            if (event.stageX < cornerSize)
-	                startResize(NativeWindowResize.TOP_LEFT);
-	            else if (event.stageX > width - cornerSize)
-	                startResize(NativeWindowResize.TOP_RIGHT);
-	            else
-	                startResize(NativeWindowResize.TOP);
-	        }
-
-	        else if (event.stageY > (height - dragWidth))
-	        {
-	            if (event.stageX < cornerSize)
-	                 startResize(NativeWindowResize.BOTTOM_LEFT);
-	            else if (event.stageX > width - cornerSize)
-	                startResize(NativeWindowResize.BOTTOM_RIGHT);
-	            else
-	                startResize(NativeWindowResize.BOTTOM);
-	        }
-
-	        else if (event.stageX < dragWidth )
-	        {
-	            if (event.stageY < cornerSize)
-	                startResize(NativeWindowResize.TOP_LEFT);
-	            else if (event.stageY > height - cornerSize)
-	                startResize(NativeWindowResize.BOTTOM_LEFT);
-	            else
-	                startResize(NativeWindowResize.LEFT);
-	            event.stopPropagation();
-	        }
-
-	        else if (event.stageX > width - dragWidth)
-	        {
-	            if (event.stageY < cornerSize)
-	                startResize(NativeWindowResize.TOP_RIGHT);
-	            else if (event.stageY > height - cornerSize)
-	                startResize(NativeWindowResize.BOTTOM_RIGHT);
-	            else
-	                startResize(NativeWindowResize.RIGHT);
-	        }
-	    }
+            var dragWidth:int = Number(getStyle("borderThickness")) + 6;
+            var cornerSize:int = 12;
+            // we short the top a little
+
+            if (event.stageY < Number(getStyle("borderThickness")))
+            {
+                if (event.stageX < cornerSize)
+                    startResize(NativeWindowResize.TOP_LEFT);
+                else if (event.stageX > width - cornerSize)
+                    startResize(NativeWindowResize.TOP_RIGHT);
+                else
+                    startResize(NativeWindowResize.TOP);
+            }
+
+            else if (event.stageY > (height - dragWidth))
+            {
+                if (event.stageX < cornerSize)
+                     startResize(NativeWindowResize.BOTTOM_LEFT);
+                else if (event.stageX > width - cornerSize)
+                    startResize(NativeWindowResize.BOTTOM_RIGHT);
+                else
+                    startResize(NativeWindowResize.BOTTOM);
+            }
+
+            else if (event.stageX < dragWidth )
+            {
+                if (event.stageY < cornerSize)
+                    startResize(NativeWindowResize.TOP_LEFT);
+                else if (event.stageY > height - cornerSize)
+                    startResize(NativeWindowResize.BOTTOM_LEFT);
+                else
+                    startResize(NativeWindowResize.LEFT);
+                event.stopPropagation();
+            }
+
+            else if (event.stageX > width - dragWidth)
+            {
+                if (event.stageY < cornerSize)
+                    startResize(NativeWindowResize.TOP_RIGHT);
+                else if (event.stageY > height - cornerSize)
+                    startResize(NativeWindowResize.BOTTOM_RIGHT);
+                else
+                    startResize(NativeWindowResize.RIGHT);
+            }
+        }
     }

     /**
@@ -2863,7 +2862,7 @@
     private function closeButton_clickHandler(event:Event):void
     {
         if (!nativeWindow.closed)
-       		stage.nativeWindow.close();
+            stage.nativeWindow.close();
     }

     /**
@@ -2977,7 +2976,7 @@
      */
     private function preinitializeHandler(event:FlexEvent):void
     {
-    	systemManager.stage.nativeWindow.addEventListener(
+        systemManager.stage.nativeWindow.addEventListener(
             NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING,
             window_displayStateChangingHandler);
         systemManager.stage.nativeWindow.addEventListener(
@@ -3013,49 +3012,49 @@
         var r:Rectangle;
         if (event.type == NativeWindowBoundsEvent.MOVING)
         {
-        	dispatchEvent(event);
-        	if (event.isDefaultPrevented())
-        		return;
+            dispatchEvent(event);
+            if (event.isDefaultPrevented())
+                return;
         }
         else //event is resizing
         {
-        	dispatchEvent(event);
-        	if (event.isDefaultPrevented())
-        		return;
-        	var cancel:Boolean = false;
-        	if (newBounds.width < nativeWindow.minSize.x)
-        	{
-        		cancel = true;
-        		if (newBounds.x != event.beforeBounds.x && !isNaN(oldX))
-        			newBounds.x = oldX;
-        		newBounds.width = nativeWindow.minSize.x;
-        	}
-        	else if (newBounds.width > nativeWindow.maxSize.x)
-        	{
-        		cancel = true;
-        		if (newBounds.x != event.beforeBounds.x && !isNaN(oldX))
-        			newBounds.x = oldX;
-        		newBounds.width = nativeWindow.maxSize.x;
-        	}
-        	if (newBounds.height < nativeWindow.minSize.y)
-        	{
-        		cancel = true;
-        		if (event.afterBounds.y != event.beforeBounds.y && !isNaN(oldY))
- 	       			newBounds.y = oldY;
-        		newBounds.height = nativeWindow.minSize.y;
-        	}
-        	else if (newBounds.height > nativeWindow.maxSize.y)
-        	{
-        		cancel = true;
-        		if (event.afterBounds.y != event.beforeBounds.y && !isNaN(oldY))
- 	       			newBounds.y = oldY;
-        		newBounds.height = nativeWindow.maxSize.y;
-        	}
-        	if (cancel)
-        	{
-        		event.preventDefault();
-        		stage.nativeWindow.bounds = newBounds;
-        	}
+            dispatchEvent(event);
+            if (event.isDefaultPrevented())
+                return;
+            var cancel:Boolean = false;
+            if (newBounds.width < nativeWindow.minSize.x)
+            {
+                cancel = true;
+                if (newBounds.x != event.beforeBounds.x && !isNaN(oldX))
+                    newBounds.x = oldX;
+                newBounds.width = nativeWindow.minSize.x;
+            }
+            else if (newBounds.width > nativeWindow.maxSize.x)
+            {
+                cancel = true;
+                if (newBounds.x != event.beforeBounds.x && !isNaN(oldX))
+                    newBounds.x = oldX;
+                newBounds.width = nativeWindow.maxSize.x;
+            }
+            if (newBounds.height < nativeWindow.minSize.y)
+            {
+                cancel = true;
+                if (event.afterBounds.y != event.beforeBounds.y && !isNaN(oldY))
+                    newBounds.y = oldY;
+                newBounds.height = nativeWindow.minSize.y;
+            }
+            else if (newBounds.height > nativeWindow.maxSize.y)
+            {
+                cancel = true;
+                if (event.afterBounds.y != event.beforeBounds.y && !isNaN(oldY))
+                    newBounds.y = oldY;
+                newBounds.height = nativeWindow.maxSize.y;
+            }
+            if (cancel)
+            {
+                event.preventDefault();
+                stage.nativeWindow.bounds = newBounds;
+            }
         }
         oldX = newBounds.x;
         oldY = newBounds.y;
@@ -3068,7 +3067,7 @@
     {
         removeEventListener("effectEnd", window_closeEffectEndHandler);
         if (!nativeWindow.closed)
-        	stage.nativeWindow.close();
+            stage.nativeWindow.close();
     }

     /**
@@ -3126,55 +3125,55 @@

         validateNow();
         var e:FlexNativeWindowBoundsEvent =
-        	new FlexNativeWindowBoundsEvent(FlexNativeWindowBoundsEvent.WINDOW_RESIZE, event.bubbles, event.cancelable,
-        			event.beforeBounds, event.afterBounds);
+            new FlexNativeWindowBoundsEvent(FlexNativeWindowBoundsEvent.WINDOW_RESIZE, event.bubbles, event.cancelable,
+                    event.beforeBounds, event.afterBounds);
         dispatchEvent(e);

         if (dispatchWidthChangeEvent)
-    		dispatchEvent(new Event("widthChanged"));
-    	if (dispatchHeightChangeEvent)
-    		dispatchEvent(new Event("heightChanged"));
-    }
-
- 	/**
- 	 *  @private
- 	 */
- 	private function nativeApplication_activateHandler(event:Event):void
- 	{
- 		dispatchEvent(new AIREvent(AIREvent.APPLICATION_ACTIVATE));
- 	}
-
- 	/**
- 	 *  @private
- 	 */
- 	private function nativeApplication_deactivateHandler(event:Event):void
- 	{
- 		dispatchEvent(new AIREvent(AIREvent.APPLICATION_DEACTIVATE));
- 	}
-
- 	/**
- 	 *  @private
- 	 */
- 	private function nativeWindow_activateHandler(event:Event):void
- 	{
- 		dispatchEvent(new AIREvent(AIREvent.WINDOW_ACTIVATE));
- 	}
-
- 	/**
- 	 *  @private
- 	 */
- 	private function nativeWindow_deactivateHandler(event:Event):void
- 	{
- 		dispatchEvent(new AIREvent(AIREvent.WINDOW_DEACTIVATE));
- 	}
-
- 	/**
- 	 *  @private
- 	 */
- 	private function nativeApplication_networkChangeHandler(event:Event):void
- 	{
- 		dispatchEvent(event);
- 	}
+            dispatchEvent(new Event("widthChanged"));
+        if (dispatchHeightChangeEvent)
+            dispatchEvent(new Event("heightChanged"));
+    }
+
+    /**
+     *  @private
+     */
+    private function nativeApplication_activateHandler(event:Event):void
+    {
+        dispatchEvent(new AIREvent(AIREvent.APPLICATION_ACTIVATE));
+    }
+
+    /**
+     *  @private
+     */
+    private function nativeApplication_deactivateHandler(event:Event):void
+    {
+        dispatchEvent(new AIREvent(AIREvent.APPLICATION_DEACTIVATE));
+    }
+
+    /**
+     *  @private
+     */
+    private function nativeWindow_activateHandler(event:Event):void
+    {
+        dispatchEvent(new AIREvent(AIREvent.WINDOW_ACTIVATE));
+    }
+
+    /**
+     *  @private
+     */
+    private function nativeWindow_deactivateHandler(event:Event):void
+    {
+        dispatchEvent(new AIREvent(AIREvent.WINDOW_DEACTIVATE));
+    }
+
+    /**
+     *  @private
+     */
+    private function nativeApplication_networkChangeHandler(event:Event):void
+    {
+        dispatchEvent(event);
+    }
 }

 }