Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

Modified Paths:
--------------
2361 paths were modified

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

--- frameworks/projects/advancedgrids/src/mx/printing/PrintAdvancedDataGrid.as
+++ frameworks/projects/advancedgrids/src/mx/printing/PrintAdvancedDataGrid.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////

 package mx.printing
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 11899
Author:   rfrishbe@adobe.com
Date:     2009-11-17T18:24:33.641492Z

Log Message:
-----------
Cleaning up some FIXMEs assigned to me in the code:

In UIMC, we now call invalidateParentSizeAndDL() on setting explicitMaxWidth.  We already do this for explicitMaxHeight.  I also changed a FIXME around invalidateLayering() in to a TODO.

In GroupBase, I removed a FIXME around the focusPane as we are using the overlay API now.

In DataGroup, I changed a FIXME to a TODO with some clarifying comments.

In SkinnableContainer, I removed a FIXME and just commented on why it was needed.  I also removed another FIXME and some code now that it seems like we don’t need to do the array conversion with IDefferedInstance since the compiler handles it for us now.

In SkinnableDataContainer, I changed a FIXME around event delegation to a TODO.

In DropDownController, when you drag around the volume bar, the popup stays open even if the mouse isn’t over the open button or the dropdown.  However, when the mouse is released, we should immediately close the drop down, rather than wait for another mouseMove to occur.  This involved some refactoring of some code in to a private helper method.  The "@private" protected methods in DropDownController should probably be made mx_internal.  I will do that in a subsequent checkin.

QE notes: -
Doc notes: -
Bugs: -
Reviewer: Jason for the DropDownController change, Glenn for the rest
Tests run: checkintests, mustella FCK, Panel, SkinnableContainer, DropDownList
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/DropDownController.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableDataContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataGroup.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as
@@ -1405,11 +1405,6 @@
     private var _focusPane:Sprite;

     [Inspectable(environment="none")]
-
-    // FIXME (rfrishbe): only reason we need to override focusPane getter/setter
-    // is because addChild/removeChild for Groups throw an RTE.
-    // This is the same as UIComponent's focusPane getter/setter but it uses
-    // super.add/removeChild.

     /**
      *  @private


Transferred from the Adobe Open Source Subversion Repository

Revision: 23243
Author:   cframpto@adobe.com
Date:     2011-12-20T00:59:57.384047Z

Log Message:
-----------
In frameworks, remove Adobe headers from all files except xml/mxml file types.  There are also a few .txt files that are license files that I didn't touch yet.

Modified Paths:
--------------
2361 paths were modified

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

--- frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2009 Adobe Systems Incorporated
-//  All Rights Reserved.
-//
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
-//
-////////////////////////////////////////////////////////////////////////////////

 package spark.components.supportClasses
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 5573
Author:   jimurphy@adobe.com
Date:     2009-03-26T15:11:59.159776Z

Log Message:
-----------
-more updated package and class names that were missed in the first pass
-remove the mx folder

qa: probably
doc: this updated more asdoc comments so you may want to make sure that this pass made the correct updates
checkintests: pass

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DropDownList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layout/supportClasses/LayoutBase.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/core/IViewport.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VideoDisplay.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/interpolation/HSBInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/SetActionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/core/IGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/HGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/easing/IEaser.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Animate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/DataGroupExample.mxml</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/components/supportClasses/Slider.as</path>
<path kind="dir" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Spinner.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/CheckBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/pathSegments/PathSegment.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/Animation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/HScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/FxToggleButtonExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AddActionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/events/AnimationEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableDataContainer.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/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/WipeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/SkinnableComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/SetAction.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as
@@ -124,8 +124,8 @@
  *  A group component does not control the layout of the visual items that it contains.
  *  Instead, the layout is handled by a separate layout component.
  *
- *  @see mx.layout.LayoutBase
- *  @see mx.components.ResizeMode
+ *  @see spark.layout.supportClasses.LayoutBase
+ *  @see spark.components.ResizeMode
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
@@ -204,7 +204,7 @@
      *  This object is responsible for the measurement and layout of
      *  the visual elements in the container.
      *
-     *  @default mx.layout.BasicLayout
+     *  @default spark.layout.BasicLayout
      *
      *  @see LayoutBase
      *
@@ -265,7 +265,7 @@
     [Bindable]

     /**
-     *  @copy mx.core.IViewport#horizontalScrollPosition
+     *  @copy spark.core.IViewport#horizontalScrollPosition
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -297,7 +297,7 @@
     [Bindable]

     /**
-     *  @copy mx.core.IViewport#verticalScrollPosition
+     *  @copy spark.core.IViewport#verticalScrollPosition
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -327,7 +327,7 @@
     //----------------------------------

     /**
-     *  @copy mx.core.IViewport#clipAndEnableScrolling
+     *  @copy spark.core.IViewport#clipAndEnableScrolling
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -488,7 +488,7 @@
  *
  * @default ResizeMode.NORMAL
  *
- * @see mx.components.ResizeMode
+ * @see spark.components.ResizeMode
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
@@ -816,7 +816,7 @@
     //----------------------------------

     /**
-     *  @copy mx.core.IViewport#horizontalScrollPositionDelta
+     *  @copy spark.core.IViewport#horizontalScrollPositionDelta
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -829,7 +829,7 @@
     }

     /**
-     *  @copy mx.core.IViewport#verticalScrollPositionDelta
+     *  @copy spark.core.IViewport#verticalScrollPositionDelta
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -857,7 +857,7 @@
     [Inspectable(category="General")]

     /**
-     *  @copy mx.core.IViewport#contentWidth
+     *  @copy spark.core.IViewport#contentWidth
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -891,7 +891,7 @@
     [Inspectable(category="General")]

     /**
-     *  @copy mx.core.IViewport#contentWidth
+     *  @copy spark.core.IViewport#contentWidth
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -1123,7 +1123,7 @@
      *  The mask type.
      *  Possible values are MaskType.CLIP and MaskType.ALPHA.
      *
-     *  @see  mx.graphics.MaskType
+     *  @see  spark.core.MaskType
      *
      *  @langversion 3.0
      *  @playerversion Flash 10


reorganized code

reorganized code

--- WeaveCore/src/weave/utils/AsyncSort.as
+++ WeaveCore/src/weave/utils/AsyncSort.as
@@ -203,22 +203,7 @@

 			// if one sub-array includes the entire array, we're done
 			if (subArraySize >= length)
-			{
-				// source array is completely sorted
-				if (source != original) // if source isn't the original
-				{
-					// copy the sorted values to the original
-					var i:int = length;
-					while (i--)
-						original[i] = source[i];
-				}
-
-				// clean up so the "get result()" function knows we're done
-				source = null;
-				destination = null;
-
 				return 1; // done
-			}

 			//TODO: improve progress calculation
 			return subArraySize / length; // not exactly accurate, but returns a number < 1
@@ -226,6 +211,19 @@

 		private function done():void
 		{
+			// source array is completely sorted
+			if (source != original) // if source isn't the original
+			{
+				// copy the sorted values to the original
+				var i:int = length;
+				while (i--)
+					original[i] = source[i];
+			}
+
+			// clean up so the "get result()" function knows we're done
+			source = null;
+			destination = null;
+
 			if (debug && elapsed > 0)
 				debugTrace(this,result.length,'in',elapsed/1000,'seconds');


Fixed bug in stepback

Fixed bug in stepback

--- src/LevelStates/Time.as
+++ src/LevelStates/Time.as
@@ -54,7 +54,7 @@

 			moment -= 1;
 			var ll:int = deltas.length;
-			while (deltas.length && deltas[deltas.length - 1].moment > moment)
+			while (deltas.length && deltas[deltas.length - 1].moment >= moment)
 				deltas.pop().revert();

 			return true;


F Fix bug in arcballcontroller

F Fix bug in arcballcontroller

--- src/aerys/minko/scene/controller/camera/ArcBallController.as
+++ src/aerys/minko/scene/controller/camera/ArcBallController.as
@@ -212,7 +212,7 @@

 		protected function mouseWheelHandler(e : MouseEvent) : void
 		{
-			_distance	-=	e.delta;
+			_distance	-=	e.delta * _distanceStep;
 			_update		=	true;
 		}


Small fix: removeAll only hides modal sprite if it has been created

--- src/org/openPyro/managers/OverlayManager.as
+++ src/org/openPyro/managers/OverlayManager.as
@@ -118,7 +118,9 @@
 			while(_overlayDisplayObject.numChildren > 1){
 				_overlayDisplayObject.removeChildAt(1);
 			}
-			bgSprite.visible = false;
+			if(bgSprite){
+				bgSprite.visible = false;
+			}
 		}

 		private function onBaseStageResize(event:Event):void{


fixed bugs in GlobalLib, added trace

fixed bugs in GlobalLib, added trace

--- WeaveCore/src/weave/compiler/GlobalLib.as
+++ WeaveCore/src/weave/compiler/GlobalLib.as
@@ -59,17 +59,20 @@
 	 */
 	public class GlobalLib
 	{
-		public static const decodeURI:Function = decodeURI;
-		public static const decodeURIComponent:Function = decodeURIComponent;
-		public static const encodeURI:Function = encodeURI;
-		public static const encodeURIComponent:Function = encodeURIComponent;
-		public static const escape:Function = escape;
-		public static const isFinite:Function = isFinite;
-		public static const isNaN:Function = isNaN;
-		public static const isXMLName:Function = isXMLName;
-		public static const parseFloat:Function = parseFloat;
-		public static const parseInt:Function = parseInt;
-		public static const unescape:Function = unescape;
+		private static function $(str:String):Function { return flash.utils.getDefinitionByName(str) as Function; }
+
+		public static const trace:Function = $('trace');
+		public static const decodeURI:Function = $('decodeURI');
+		public static const decodeURIComponent:Function = $('decodeURIComponent');
+		public static const encodeURI:Function = $('encodeURI');
+		public static const encodeURIComponent:Function = $('encodeURIComponent');
+		public static const escape:Function = $('escape');
+		public static const isFinite:Function = $('isFinite');
+		public static const isNaN:Function = $('isNaN');
+		public static const isXMLName:Function = $('isXMLName');
+		public static const parseFloat:Function = $('parseFloat');
+		public static const parseInt:Function = $('parseInt');
+		public static const unescape:Function = $('unescape');

 		public static const enterDebugger:Function = flash.debugger.enterDebugger;


added toolToggles backwards compatibility for old session states

--- WeaveUISpark/src/weave/WeaveProperties.as
+++ WeaveUISpark/src/weave/WeaveProperties.as
@@ -253,10 +253,24 @@
 			var className:String = getQualifiedClassName(classDef).split('::').pop();
 			var existsPreviously:Boolean = toolToggles.getObject(className) is LinkableBoolean;
 			var toggle:LinkableBoolean = toolToggles.requestObject(className, LinkableBoolean, true); // lock
+			var deprecatedToggle:LinkableBoolean = toolToggles.getObject(toolToggleBackwardsCompatibility[className]) as LinkableBoolean;
 			if (!existsPreviously)
-				toggle.value = true; // default value
+			{
+				if (deprecatedToggle)
+				{
+					// backwards compatibility for old session states
+					toggle.value = deprecatedToggle.value;
+					toolToggles.removeObject(toolToggleBackwardsCompatibility[className]);
+				}
+				else
+				{
+					toggle.value = true; // default value
+				}
+			}
 			return toggle;
 		}
+		// maps new tool name to old tool name
+		private const toolToggleBackwardsCompatibility:Object = {"AdvancedDataTable": "DataTableTool", "TableTool": "DataTableTool"};

 		public const enableToolAttributeEditing:LinkableBoolean = new LinkableBoolean(true);
 		public const enableToolSelection:LinkableBoolean = new LinkableBoolean(true);


Transferred from the Adobe Open Source Subversion Repository

Revision: 23243
Author:   cframpto@adobe.com
Date:     2011-12-20T00:59:57.384047Z

Log Message:
-----------
In frameworks, remove Adobe headers from all files except xml/mxml file types.  There are also a few .txt files that are license files that I didn't touch yet.

Modified Paths:
--------------
2361 paths were modified

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

--- frameworks/projects/charts/src/mx/charts/chartClasses/ChartItemDragProxy.as
+++ frameworks/projects/charts/src/mx/charts/chartClasses/ChartItemDragProxy.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2009 Adobe Systems Incorporated
-//  All Rights Reserved.
-//
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
-//
-////////////////////////////////////////////////////////////////////////////////

 package mx.charts.chartClasses
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 8
Author:   open-source-svn-admin@adobe.com
Date:     2007-12-15T01:49:31.087529Z

Log Message:
-----------
The beginning of the open-source Flex SDK.

Populated the flex/sdk/trunk directory with an open-source subset of files from //depot/flex/sdk/...@191097 in the Faramir Perforce server. This changelist is a bit past the 3.0rc0 build.

The Ant scripts will not successfully build yet. They need to be adapted to the open-source subset.

Modified Paths:
--------------
2532 paths were modified

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

--- frameworks/projects/framework/src/mx/logging/targets/LineFormattedTarget.as
+++ frameworks/projects/framework/src/mx/logging/targets/LineFormattedTarget.as
@@ -0,0 +1,207 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2005-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.logging.targets
+{
+
+import mx.core.mx_internal;
+import mx.logging.AbstractTarget;
+import mx.logging.ILogger;
+import mx.logging.LogEvent;
+
+use namespace mx_internal;
+
+/**
+ *  All logger target implementations that have a formatted line style output
+ *  should extend this class.
+ *  It provides default behavior for including date, time, category, and level
+ *  within the output.
+ *
+ */
+public class LineFormattedTarget extends AbstractTarget
+{
+    include "../../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *
Constructs an instance of a logger target that will format
+     *  the message data on a single line.

+     */
+    public function LineFormattedTarget()
+    {
+        super();
+
+        includeTime = false;
+        includeDate = false;
+        includeCategory = false;
+        includeLevel = false;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  fieldSeparator
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue=" ")]
+
+    /**
+     *  The separator string to use between fields (the default is " ")
+     */
+    public var fieldSeparator:String = " ";
+
+    //----------------------------------
+    //  includeCategory
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="false")]
+
+    /**
+     *  Indicates if the category for this target should added to the trace.
+     */
+    public var includeCategory:Boolean;
+
+    //----------------------------------
+    //  includeDate
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="false")]
+
+    /**
+     *  Indicates if the date should be added to the trace.
+     */
+    public var includeDate:Boolean;
+
+    //----------------------------------
+    //  includeLevel
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="false")]
+
+    /**
+     *  Indicates if the level for the event should added to the trace.
+     */
+    public var includeLevel:Boolean;
+
+    //----------------------------------
+    //  includeTime
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="false")]
+
+    /**
+     *  Indicates if the time should be added to the trace.
+     */
+    public var includeTime:Boolean;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  This method handles a LogEvent from an associated logger.
+     *  A target uses this method to translate the event into the appropriate
+     *  format for transmission, storage, or display.
+     *  This method is called only if the event's level is in range of the
+     *  target's level.
+     *
+     *  @param event The LogEvent handled by this method.
+     */
+    override public function logEvent(event:LogEvent):void
+    {
+        var date:String = ""
+        if (includeDate || includeTime)
+        {
+            var d:Date = new Date();
+            if (includeDate)
+            {
+                date = Number(d.getMonth() + 1).toString() + "/" +
+                       d.getDate().toString() + "/" +
+                       d.getFullYear() + fieldSeparator;
+            }
+            if (includeTime)
+            {
+                date += padTime(d.getHours()) + ":" +
+                        padTime(d.getMinutes()) + ":" +
+                        padTime(d.getSeconds()) + "." +
+                        padTime(d.getMilliseconds(), true) + fieldSeparator;
+            }
+        }
+
+        var level:String = "";
+        if (includeLevel)
+        {
+            level = "[" + LogEvent.getLevelString(event.level) +
+                    "]" + fieldSeparator;
+        }
+
+        var category:String = includeCategory ?
+                              ILogger(event.target).category + fieldSeparator :
+                              "";
+
+        internalLog(date + level + category + event.message);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function padTime(num:Number, millis:Boolean = false):String
+    {
+        if (millis)
+        {
+            if (num < 10)
+                return "00" + num.toString();
+            else if (num < 100)
+                return "0" + num.toString();
+            else
+                return num.toString();
+        }
+        else
+        {
+            return num > 9 ? num.toString() : "0" + num.toString();
+        }
+    }
+
+    /**
+     *  Descendants of this class should override this method to direct the
+     *  specified message to the desired output.
+     *
+     *  @param  message String containing preprocessed log message which may
+     *              include time, date, category, etc. based on property settings,
+     *              such as includeDate, includeCategory,
+     *          etc.
+     */
+    mx_internal function internalLog(message:String):void
+    {
+        // override this method to perform the redirection to the desired output
+    }
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 11273
Author:   aharui@adobe.com
Date:     2009-10-29T18:57:54.403337Z

Log Message:
-----------
Initial check in of MXItemRenderer and friends

QE Notes: New Classes and Code
Doc Notes: New Classes and Code
Bugs: None
Reviewer: Ryan
API Change: yes
Is noteworthy for integration: No
tests: checkintests

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/BaseListData.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListData.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/mx/controls/treeClasses</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridListData.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/treeClasses/TreeListData.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/tests/basicTests/halo/scripts/MXItemRendererTestScript.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/mx/controls/listClasses/MXItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/basicTests/BasicTests-config.xml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/tests/basicTests/halo/views/MXItemRendererTests.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/mx/controls/dataGridClasses/MXDataGridItemRenderer.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/mx/controls/listClasses</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/mx/controls/treeClasses/MXTreeItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/spark-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/basicTests/BasicTests.mxml</path>

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

--- frameworks/projects/spark/src/mx/controls/treeClasses/MXTreeItemRenderer.as
+++ frameworks/projects/spark/src/mx/controls/treeClasses/MXTreeItemRenderer.as
@@ -0,0 +1,179 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2008 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.controls.treeClasses
+{
+import flash.events.MouseEvent;
+
+import mx.controls.listClasses.MXItemRenderer;
+import mx.controls.Tree;
+import mx.core.mx_internal;
+import mx.events.TreeEvent;
+import spark.components.Group;
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  Excluded APIs
+//--------------------------------------
+
+[Exclude(name="listData", kind="property")]
+
+/**
+ *  The MXItemRenderer class is the base class for Spark item renderers in
+ *  Halo (mx) classes
+ *
+ *  @mxml
+ *
+ *
The <s:MXItemRenderer> tag inherits all of the tag
+ *  attributes of its superclass and adds the following tag attributes:

+ *
+ *

+ *  <s:MXItemRenderer
+ *    Properties
+ *  />
+ *

+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+public class MXTreeItemRenderer extends MXItemRenderer
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function MXTreeItemRenderer()
+    {
+        super();
+    }
+
+    //----------------------------------
+    //  disclosureGroup
+    //----------------------------------
+
+    /**
+     *  storage for disclosureGroup
+     */
+    private var _disclosureGroup:Group;
+
+    /**
+     *  ID of the component that will receive focus as the editor
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get disclosureGroup():Group
+    {
+        return _disclosureGroup;
+    }
+
+    /**
+     *  @private
+     */
+    public function set disclosureGroup(value:Group):void
+    {
+        if (value != _disclosureGroup)
+        {
+            if (_disclosureGroup)
+            {
+                _disclosureGroup.removeEventListener(MouseEvent.MOUSE_DOWN,
+                        disclosureGroup_mouseDownHandler);
+                _disclosureGroup.removeEventListener(MouseEvent.CLICK,
+                        disclosureGroup_clickHandler);
+            }
+            _disclosureGroup = value;
+            if (_disclosureGroup)
+            {
+                _disclosureGroup.addEventListener(MouseEvent.MOUSE_DOWN,
+                        disclosureGroup_mouseDownHandler);
+                _disclosureGroup.addEventListener(MouseEvent.CLICK,
+                        disclosureGroup_clickHandler);
+            }
+        }
+    }
+
+    //----------------------------------
+    //  treeListData
+    //----------------------------------
+
+    [Bindable("dataChange")]
+
+    /**
+     *  The implementation of the listData property
+     *  as defined by the IDropInListItemRenderer interface.
+     *
+     *  @see mx.controls.listClasses.IDropInListItemRenderer
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get treeListData():TreeListData
+    {
+        return listData as TreeListData;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Handle special behavior when clicking on the disclosure icon
+     */
+    protected function disclosureGroup_mouseDownHandler(event:MouseEvent):void
+    {
+        event.stopPropagation();
+
+        if (Tree(listData.owner).isOpening || !listData.owner.enabled)
+            return;
+
+        treeListData.open = !treeListData.open;
+
+        Tree(listData.owner).dispatchTreeEvent(TreeEvent.ITEM_OPENING,
+                                data,      //item
+                                this,      //renderer
+                                event,     //trigger
+                                treeListData.open,      //opening
+                                true,      //animate
+                                true)      //dispatch
+    }
+
+    /**
+     *  Handle special behavior when clicking on the disclosure icon
+     */
+    protected function disclosureGroup_clickHandler(event:MouseEvent):void
+    {
+        // stop this event from bubbling up because the click is
+        // for item selection and clicking on the disclosureIcon doesn't
+        // select the items (only expands/closes them).
+        event.stopPropagation();
+    }
+
+}
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 18765
Author:   klin@adobe.com
Date:     2010-11-21T07:18:04.332221Z

Log Message:
-----------
Fix for RTE when sorting complex datafields. Added an internal GridSortField class that captures the full dataField when sorting on a complex dataField. This is required because sort currently RTE's when the dataField is set to a property that doesn't exist on the data object even though a sortCompareFunction is defined. I've also changed the default compare function for complex dataFields to compare the data instead of using the itemToLabel function. I've modified DataGrid to take advantage of GridSortField for figuring out when to reverse the sort of a column with a complex dataField.

QE notes: No
Doc notes: No
Bugs: SDK-28610
Reviewer: Hans
Tests run: cyclone, checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridSortField.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridColumn.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as</path>

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

--- frameworks/projects/spark/src/spark/components/gridClasses/GridSortField.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridSortField.as
@@ -0,0 +1,69 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2010 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package spark.components.gridClasses
+{
+
+import mx.collections.SortField;
+
+[ExcludeClass]
+
+/**
+ *  A subclass of SortField used by DataGrid and GridColumn to keep track
+ *  of complex dataFields when trying to reverse the sort.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+public class GridSortField extends SortField
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function GridSortField(name:String=null, caseInsensitive:Boolean=false, descending:Boolean=false, numeric:Object=null)
+    {
+        super(name, caseInsensitive, descending, numeric);
+    }
+
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  The complex dataField in dot notation
+     *  of the column associated with this SortField.
+     *
+     *  If dataFieldPath is specified, the name is null.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public var dataFieldPath:String;
+}
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 12925
Author:   klin@adobe.com
Date:     2009-12-14T22:19:53.559159Z

Log Message:
-----------
Remove FIXME from SliderBase. It is correct for Slider to set the pendingValue during an animation, and it should not actually set the value or dispatch valueCommit events for an animation.

QE notes: No
Doc notes: No
Bugs: None
Reviewer: -
Tests run: -
Is noteworthy for integration: No

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as
@@ -551,9 +551,6 @@
      */
     private function animationUpdateHandler(animation:Animation):void
     {
-        // FIXME (klin): Should the animation be setting the value
-        // as it goes like ScrollBar does? Should this behavior
-        // depend on liveDragging?
         pendingValue = animation.currentValue["value"];
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

Modified Paths:
--------------
2361 paths were modified

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

--- frameworks/projects/spark/src/spark/accessibility/VideoPlayerAccImpl.as
+++ frameworks/projects/spark/src/spark/accessibility/VideoPlayerAccImpl.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////

 package spark.accessibility
 {


Prefix symbol names with the document path to make things easier in Betwixt.

--- exporter/src/main/as/flump/export/BetwixtPublisher.as
+++ exporter/src/main/as/flump/export/BetwixtPublisher.as
@@ -69,9 +69,11 @@
         switch (Files.getExtension(dest)) {
         case "xml":
             var xml :XML = <resources md5={lib.md5}/>;
+            var prefix :String = lib.location.replace("/", "_") + "_";
             for each (var movie :XflMovie in lib.movies) {
                 var movieXml :XML = movie.toXML();
                 movieXml.@authoredDevice = authoredDevice.name();
+                movieXml.@name = prefix + movieXml.@name;
                 xml.appendChild(movieXml);
             }
             var groupsXml :XML = <textureGroups/>;
@@ -82,6 +84,9 @@
                 for each (var atlas :Atlas in packer.atlases) {
                     groupXml.appendChild(atlas.toXML());
                 }
+            }
+            for each (var texture :XML in groupsXml..texture) {
+                texture.@name = prefix + texture.@name;
             }
             out.writeUTFBytes(xml.toString());
             break;


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

Modified Paths:
--------------
2361 paths were modified

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

--- frameworks/projects/charts/src/mx/charts/PlotChart.as
+++ frameworks/projects/charts/src/mx/charts/PlotChart.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////

 package mx.charts
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 8
Author:   open-source-svn-admin@adobe.com
Date:     2007-12-15T01:49:31.087529Z

Log Message:
-----------
The beginning of the open-source Flex SDK.

Populated the flex/sdk/trunk directory with an open-source subset of files from //depot/flex/sdk/...@191097 in the Faramir Perforce server. This changelist is a bit past the 3.0rc0 build.

The Ant scripts will not successfully build yet. They need to be adapted to the open-source subset.

Modified Paths:
--------------
2532 paths were modified

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

--- frameworks/projects/mx/src/mx/controls/ColorPicker.as
+++ frameworks/projects/mx/src/mx/controls/ColorPicker.as
@@ -0,0 +1,1537 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2004-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.controls
+{
+
+import flash.events.Event;
+import flash.events.FocusEvent;
+import flash.events.KeyboardEvent;
+import flash.events.MouseEvent;
+import flash.geom.Point;
+import flash.geom.Rectangle;
+import flash.ui.Keyboard;
+import flash.utils.getTimer;
+import mx.controls.colorPickerClasses.SwatchPanel;
+import mx.controls.colorPickerClasses.WebSafePalette;
+import mx.core.FlexVersion;
+import mx.core.UIComponent;
+import mx.core.UIComponentGlobals;
+import mx.core.mx_internal;
+import mx.effects.Tween;
+import mx.events.ColorPickerEvent;
+import mx.events.DropdownEvent;
+import mx.events.FlexEvent;
+import mx.events.FlexMouseEvent;
+import mx.managers.IFocusManager;
+import mx.managers.ISystemManager;
+import mx.managers.PopUpManager;
+import mx.managers.SystemManager;
+import mx.skins.halo.SwatchSkin;
+import mx.styles.StyleProxy;
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  Events
+//--------------------------------------
+
+/**
+ *  Dispatched when the selected color
+ *  changes as a result of user interaction.
+ *
+ *  @eventType mx.events.ColorPickerEvent.CHANGE
+ *  @helpid 4918
+ */
+[Event(name="change", type="mx.events.ColorPickerEvent")]
+
+/**
+ *  Dispatched when the swatch panel closes.
+ *
+ *  @eventType mx.events.DropdownEvent.CLOSE
+ *  @helpid 4921
+ */
+[Event(name="close", type="mx.events.DropdownEvent")]
+
+/**
+ *  Dispatched if the ColorPicker editable
+ *  property is set to true
+ *  and the user presses Enter after typing in a hexadecimal color value.
+ *
+ *  @eventType mx.events.ColorPickerEvent.ENTER
+ *  @helpid 4919
+ */
+[Event(name="enter", type="mx.events.ColorPickerEvent")]
+
+/**
+ *  Dispatched when the user rolls the mouse out of a swatch
+ *  in the SwatchPanel object.
+ *
+ *  @eventType mx.events.ColorPickerEvent.ITEM_ROLL_OUT
+ *  @helpid 4924
+ */
+[Event(name="itemRollOut", type="mx.events.ColorPickerEvent")]
+
+/**
+ *  Dispatched when the user rolls the mouse over a swatch
+ *  in the SwatchPanel object.
+ *
+ *  @eventType mx.events.ColorPickerEvent.ITEM_ROLL_OVER
+ *  @helpid 4923
+ */
+[Event(name="itemRollOver", type="mx.events.ColorPickerEvent")]
+
+/**
+ *  Dispatched when the color swatch panel opens.
+ *
+ *  @eventType mx.events.DropdownEvent.OPEN
+ *  @helpid 4920
+ */
+[Event(name="open", type="mx.events.DropdownEvent")]
+
+//--------------------------------------
+//  Styles
+//--------------------------------------
+
+include "../styles/metadata/FocusStyles.as"
+include "../styles/metadata/IconColorStyles.as"
+include "../styles/metadata/LeadingStyle.as"
+include "../styles/metadata/TextStyles.as"
+
+/**
+ *  Color of the SwatchPanel object's background.
+ *  The default value is 0xE5E6E7.
+ */
+[Style(name="backgroundColor", type="uint", format="Color", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]
+
+/**
+ *  Color of the outer border on the SwatchPanel object.
+ *  The default value is 0xA5A9AE.
+ */
+[Style(name="borderColor", type="uint", format="Color", inherit="no")]
+
+/**
+ *  Length of a close transition, in milliseconds.
+ *  The default value is 250.
+ */
+[Style(name="closeDuration", type="Number", format="Time", inherit="no")]
+
+/**
+ *  Easing function to control component tweening.
+ *  The default value is undefined.
+ */
+[Style(name="closeEasingFunction", type="Function", inherit="no")]
+
+/**
+ *  Number of columns in the swatch grid.
+ *  The default value is 20.
+ */
+[Style(name="columnCount", type="int", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]
+
+/**
+ *  Alphas used for the background fill of controls.
+ *  The default value is [ 0.6, 0.4 ].
+ */
+[Style(name="fillAlphas", type="Array", arrayType="Number", inherit="no")]
+
+/**
+ *  Colors used to tint the background of the control.
+ *  Pass the same color for both values for a flat-looking control.
+ *  The default value is [ 0xFFFFFF, 0xCCCCCC ].
+ */
+[Style(name="fillColors", type="Array", arrayType="uint", format="Color", inherit="no")]
+
+/**
+ *  Alphas used for the highlight fill of controls.
+ *  The default value is [ 0.3, 0.0 ].
+ */
+[Style(name="highlightAlphas", type="Array", arrayType="Number", inherit="no")]
+
+/**
+ *  Horizontal gap between swatches in the swatch grid.
+ *  The default value is 0.
+ */
+[Style(name="horizontalGap", type="Number", format="Length", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]
+
+/**
+ *  Length of an open transition, in milliseconds.
+ *  The default value is 250.
+ */
+[Style(name="openDuration", type="Number", format="Time", inherit="no")]
+
+/**
+ *  Easing function to control component tweening.
+ *  The default value is undefined.
+ */
+[Style(name="openEasingFunction", type="Function", inherit="no")]
+
+/**
+ *  Bottom padding of SwatchPanel object below the swatch grid.
+ *  The default value is 5.
+ */
+[Style(name="paddingBottom", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Left padding of SwatchPanel object to the side of the swatch grid.
+ *  The default value is 5.
+ */
+[Style(name="paddingLeft", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Right padding of SwatchPanel object to the side of the swatch grid.
+ *  The default value is 5.
+ */
+[Style(name="paddingRight", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Top padding of SwatchPanel object above the swatch grid.
+ *  The default value is 4.
+ */
+[Style(name="paddingTop", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Height of the larger preview swatch that appears above the swatch grid on
+ *  the upper left of the SwatchPanel object.
+ *  The default value is 22.
+ */
+[Style(name="previewHeight", type="Number", format="Length", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]
+
+/**
+ *  Width of the larger preview swatch.
+ *  The default value is 45.
+ */
+[Style(name="previewWidth", type="Number", format="Length", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]
+
+/**
+ *  Color of the swatches' borders.
+ *  The default value is 0x000000.
+ */
+[Style(name="swatchBorderColor", type="uint", format="Color", inherit="no")]
+
+/**
+ *  Size of the outlines of the swatches' borders.
+ *  The default value is 1.
+ */
+[Style(name="swatchBorderSize", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Color of the background rectangle behind the swatch grid.
+ *  The default value is 0x000000.
+ */
+[Style(name="swatchGridBackgroundColor", type="uint", format="Color", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]
+
+/**
+ *  Size of the single border around the grid of swatches.
+ *  The default value is 0.
+ */
+[Style(name="swatchGridBorderSize", type="Number", format="Length", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]
+
+/**
+ *  Height of each swatch.
+ *  The default value is 12.
+ */
+[Style(name="swatchHeight", type="Number", format="Length", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]
+
+/**
+ *  Color of the highlight that appears around the swatch when the user
+ *  rolls over a swatch.
+ *  The default value is 0xFFFFFF.
+ */
+[Style(name="swatchHighlightColor", type="uint", format="Color", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]
+
+/**
+ *  Size of the highlight that appears around the swatch when the user
+ *  rolls over a swatch.
+ *  The default value is 1.
+ */
+[Style(name="swatchHighlightSize", type="Number", format="Length", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]
+
+/**
+ *  Name of the class selector that defines style properties for the swatch panel.
+ *  The default value is undefined. The following example shows the default style properties
+ *  that are defined by the swatchPanelStyleName.
+ *

+ *  ColorPicker {
+ *      swatchPanelStyleName:mySwatchPanelStyle;
+ *  }
+ *
+ *  .mySwatchPanelStyle {
+ *      backgroundColor:#E5E6E7;
+ *      columnCount:20;
+ *      horizontalGap:0;
+ *      previewHeight:22;
+ *      previewWidth:45;
+ *      swatchGridBackgroundColor:#000000;
+ *      swatchGridBorderSize:0;
+ *      swatchHeight:12;
+ *      swatchHighlightColor:#FFFFFF;
+ *      swatchHighlightSize:1;
+ *      swatchWidth:12;
+ *      textFieldWidth:72;
+ *      verticalGap:0;
+ *  }
+ *

+ */
+[Style(name="swatchPanelStyleName", type="String", inherit="no")]
+
+/**
+ *  Width of each swatch.
+ *  The default value is 12.
+ */
+[Style(name="swatchWidth", type="Number", format="Length", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]
+
+/**
+ *  Name of the style sheet definition to configure the text input control.
+ *  The default value is "swatchPanelTextField"
+ */
+[Style(name="textFieldStyleName", type="String", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]
+
+/**
+ *  Width of the text box that appears above the swatch grid.
+ *  The default value is 72.
+ */
+[Style(name="textFieldWidth", type="Number", format="Length", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]
+
+/**
+ *  Vertical gap between swatches in the grid.
+ *  The default value is 0.
+ */
+[Style(name="verticalGap", type="Number", format="Length", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]
+
+//--------------------------------------
+//  Excluded APIs
+//--------------------------------------
+
+[Exclude(name="text", kind="property")]
+
+[Exclude(name="fillAlphas", kind="style")]
+
+[Exclude(name="fillColors", kind="style")]
+
+[Exclude(name="highlightAlphas", kind="style")]
+
+//--------------------------------------
+//  Other metadata
+//--------------------------------------
+
+
+[AccessibilityClass(implementation="mx.accessibility.ColorPickerAccImpl")]
+
+[DataBindingInfo("acceptedTypes", "{ dataProvider: { label: "String" } }")]
+
+[DefaultBindingProperty(source="selectedItem", destination="dataProvider")]
+
+[DefaultTriggerEvent("change")]
+
+[IconFile("ColorPicker.png")]
+
+
+
+/**
+ *  The ColorPicker control provides a way for a user to choose a color from a swatch list.
+ *  The default mode of the component shows a single swatch in a square button.
+ *  When the user clicks the swatch button, the swatch panel appears and
+ *  displays the entire swatch list.
+ *
+ *
The ColorPicker control has the following default sizing characteristics:

+ *

+ *

+ *           Characteristic
+ *           Description
+ *

+ *

+ *           Default size
+ *           ColorPicker: 22 by 22 pixels
+ *
Swatch panel: Sized to fit the ColorPicker control width

+ *

+ *

+ *           Minimum size
+ *           0 pixels by 0 pixels
+ *

+ *

+ *           Maximum size
+ *           Undefined
+ *

+ *

+ *
+ *  @mxml
+ *
+ *
The <mx:ColorPicker> tag inherits all of the properties of its
+ *  superclass, and the following properties:

+ *
+ *

+ *  <mx:ColorPicker
+ *    Properties
+ *    colorField="color"
+ *    labelField="label"
+ *    selectedColor="0x000000"
+ *    selectedIndex="0"
+ *    showTextField="true|false"
+ *
+ *    Styles
+ *    borderColor="0xA5A9AE"
+ *    closeDuration="250"
+ *    closeEasingFunction="undefined"
+ *    color="0x0B333C"
+ *    disabledIconColor="0x999999"
+ *    fillAlphas="[0.6,0.4]"
+ *    fillColors="[0xFFFFFF, 0xCCCCCC]"
+ *    focusAlpha="0.5"
+ *    focusRoundedCorners="tl tr bl br"
+ *    fontAntiAliasType="advanced"
+ *    fontfamily="Verdana"
+ *    fontGridFitType="pixel"
+ *    fontSharpness="0""
+ *    fontSize="10"
+ *    fontStyle="normal"
+ *    fontThickness="0"
+ *    fontWeight="normal"
+ *    highlightAlphas="[0.3,0.0]"
+ *    iconColor="0x000000"
+ *    leading="2"
+ *    openDuration="250"
+ *    openEasingFunction="undefined"
+ *    paddingBottom="5"
+ *    paddingLeft="5"
+ *    paddingRight="5"
+ *    paddingTop="4"
+ *    swatchBorderColor="0x000000"
+ *    swatchBorderSize="1"
+ *    swatchPanelStyleName="undefined"
+ *    textAlign="left"
+ *    textDecoration="none"
+ *    textIndent="0"
+ *
+ *    Events
+ *    change="No default"
+ *    close="No default"
+ *    enter="No default"
+ *    itemRollOut="No default"
+ *    itemRollOver="No default"
+ *    open="No default"
+ *    />
+ *

+ *
+ *  @see mx.controls.List
+ *  @see mx.effects.Tween
+ *  @see mx.managers.PopUpManager
+ *
+ *  @includeExample examples/ColorPickerExample.mxml
+ *
+ *  @helpid 4917
+ */
+public class ColorPicker extends ComboBase
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class mixins
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Placeholder for mixin by SliderAccImpl.
+     */
+    mx_internal static var createAccessibilityImplementation:Function;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     */
+    public function ColorPicker()
+    {
+        super();
+
+        if (!isModelInited)
+            loadDefaultPalette();
+
+        // Make editable false so that focus doesn't go
+        // to the comboBase's textInput which is not used by CP
+        super.editable = false;
+
+        // Register for events.
+        addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Used by SwatchPanel
+     */
+    mx_internal var showingDropdown:Boolean = false;
+
+    /**
+     *  @private
+     *  Used by SwatchPanel
+     */
+    mx_internal var isDown:Boolean = false;
+
+    /**
+     *  @private
+     *  Used by SwatchPanel
+     */
+    mx_internal var isOpening:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var dropdownGap:Number = 6;
+
+    /**
+     *  @private
+     */
+    private var indexFlag:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var initializing:Boolean = true;
+
+    /**
+     *  @private
+     */
+    private var isModelInited:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var collectionChanged:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var swatchPreview:SwatchSkin;
+
+    /**
+     *  @private
+     */
+    private var dropdownSwatch:SwatchPanel;
+
+    /**
+     *  @private
+     */
+    private var triggerEvent:Event;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  dataProvider
+    //----------------------------------
+
+    [Bindable("collectionChange")]
+    [Inspectable(category="Data")]
+
+    /**
+     *  @private
+     *  The dataProvider for the ColorPicker control.
+     *  The default dataProvider is an Array that includes all
+     *  the web-safe colors.
+     *
+     *  @helpid 4929
+     */
+    override public function set dataProvider(value:Object):void
+    {
+        super.dataProvider = value;
+
+        isModelInited = true;
+
+        if (dropdownSwatch)
+            dropdownSwatch.dataProvider = value;
+    }
+
+    //----------------------------------
+    //  editable
+    //----------------------------------
+
+    [Bindable("editableChanged")]
+    [Inspectable(category="General", defaultValue="true")]
+
+    /**
+     *  @private
+     */
+    private var _editable:Boolean = true;
+
+    /**
+     *  @private
+     *  Specifies whether the user can type a hexadecimal color value
+     *  in the text box.
+     *
+     *  @default true
+     *  @helpid 4930
+     */
+    override public function get editable():Boolean
+    {
+        return _editable;
+    }
+
+    /**
+     *  @private
+     */
+    override public function set editable(value:Boolean):void
+    {
+        _editable = value;
+
+        if (dropdownSwatch)
+            dropdownSwatch.editable = value;
+
+        dispatchEvent(new Event("editableChanged"));
+    }
+
+    //----------------------------------
+    //  selectedIndex
+    //----------------------------------
+
+    [Bindable("change")]
+    [Bindable("collectionChange")]
+    [Inspectable(defaultValue="0")]
+
+    /**
+     *  Index in the dataProvider of the selected item in the
+     *  SwatchPanel object.
+     *  Setting this property sets the selected color to the color that
+     *  corresponds to the index, sets the selected index in the drop-down
+     *  swatch to the selectedIndex property value,
+     *  and displays the associated label in the text box.
+     *  The default value is the index corresponding to
+     *  black(0x000000) color if found, else it is 0.
+     *
+     *  @helpid 4931
+     */
+    override public function set selectedIndex(value:int):void
+    {
+        if ((selectedIndex != -1 || !isNaN(selectedColor)) &&
+            value != selectedIndex)
+        {
+            if (value >= 0)
+            {
+                indexFlag = true;
+                selectedColor = getColor(value);
+                // Call super in mixed-in DataSelector
+                super.selectedIndex = value;
+            }
+
+            if (dropdownSwatch)
+                dropdownSwatch.selectedIndex = value;
+        }
+    }
+
+    //----------------------------------
+    //  selectedItem
+    //----------------------------------
+
+    [Bindable("change")]
+    [Bindable("collectionChange")]
+    [Inspectable(defaultValue="0")]
+
+    /**
+     *  @private
+     *  If the dataProvider is a complex object, this property is a
+     *  reference to the selected item in the SwatchPanel object.
+     *  If the dataProvider is an Array of color values, this
+     *  property is the selected color value.
+     *  If the dataProvider is a complex object, modifying fields of
+     *  this property modifies the dataProvider and its views.
+     *
+     *
If the dataProvider is a complex object, this property is
+     *  read-only. You cannot change its value directly.
+     *  If the dataProvider is an Array of hexadecimal color values,
+     *  you can change this value directly.
+     *  The default value is undefined for complex dataProviders;
+     *  0 if the dataProvider is an Array of color values.
+     *
+     *  @helpid 4933
+     */
+    override public function set selectedItem(value:Object):void
+    {
+        if (value != selectedItem)
+        {
+            // Call super in mixed-in DataSelector
+            super.selectedItem = value;
+
+            if (typeof(value) == "object")
+                selectedColor = Number(value[colorField]);
+            else if (typeof(value) == "number")
+                selectedColor = Number(value);
+
+            indexFlag = true;
+
+            if (dropdownSwatch)
+                dropdownSwatch.selectedItem = value;
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  colorField
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the colorField property.
+     */
+    private var _colorField:String = "color";
+
+    [Bindable("colorFieldChanged")]
+    [Inspectable(category="Data", defaultValue="color")]
+
+    /**
+     *  Name of the field in the objects of the dataProvider Array that
+     *  specifies the hexadecimal values of the colors that the swatch
+     *  panel displays.
+     *
+     *
If the dataProvider objects do not contain a color
+     *  field, set the colorField property to use the correct field name.
+     *  This property is available, but not meaningful, if the
+     *  dataProvider is an Array of hexadecimal color values.

+     *
+     *  @default "color"
+     *  @helpid 4927
+     */
+    public function get colorField():String
+    {
+        return _colorField;
+    }
+
+    /**
+     *  @private
+     */
+    public function set colorField(value:String):void
+    {
+        _colorField = value;
+
+        if (dropdownSwatch)
+            dropdownSwatch.colorField = value;
+
+        dispatchEvent(new Event("colorFieldChanged"));
+    }
+
+    //----------------------------------
+    //  dropdown
+    //----------------------------------
+
+    /**
+     *  A reference to the SwatchPanel object that appears when you expand
+     *  the ColorPicker control.
+     *
+     *  @helpid 4922
+     */
+    mx_internal function get dropdown():SwatchPanel
+    {
+        return dropdownSwatch; // null if not created yet
+    }
+
+    //----------------------------------
+    //  labelField
+    //----------------------------------
+
+    /**
+     *  Storage for the labelField property.
+     */
+    private var _labelField:String = "label";
+
+    [Bindable("labelFieldChanged")]
+    [Inspectable(category="Data", defaultValue="label")]
+
+    /**
+     *  Name of the field in the objects of the dataProvider Array that
+     *  contain text to display as the label in the SwatchPanel object text box.
+     *
+     *
If the dataProvider objects do not contain a label
+     *  field, set the labelField property to use the correct field name.
+     *  This property is available, but not meaningful, if the
+     *  dataProvider is an Array of hexadecimal color values.

+     *
+     *  @default "label"
+     *  @helpid 4928
+     */
+    public function get labelField():String
+    {
+        return _labelField;
+    }
+
+    /**
+     *  @private
+     */
+    public function set labelField(value:String):void
+    {
+        _labelField = value;
+
+        if (dropdownSwatch)
+            dropdownSwatch.labelField = value;
+
+        dispatchEvent(new Event("labelFieldChanged"));
+    }
+
+    //----------------------------------
+    //  selectedColor
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the selectedColor property.
+     */
+    private var _selectedColor:uint = 0x000000;
+
+    [Bindable("change")]
+    [Bindable("valueCommit")]
+    [Inspectable(category="General", defaultValue="0", format="Color")]
+
+    /**
+     *  The value of the currently selected color in the
+     *  SwatchPanel object.
+     *  In the <mx:ColorPicker> tag only, you can set this property to
+     *  a standard string color name, such as "blue".
+     *  If the dataProvider contains an entry for black (0x000000), the
+     *  default value is 0; otherwise, the default value is the color of
+     *  the item at index 0 of the data provider.
+     *
+     *  @helpid 4932
+     */
+    public function get selectedColor():uint
+    {
+        return _selectedColor;
+    }
+
+    /**
+     *  @private
+     */
+    public function set selectedColor(value:uint):void
+    {
+        if (!indexFlag)
+        {
+            var SI:int = findColorByName(value);
+            if (SI != -1)
+                super.selectedIndex = SI;
+        }
+        else
+        {
+            indexFlag = false;
+        }
+
+        if (value != selectedColor)
+        {
+            _selectedColor = value;
+
+            updateColor(value);
+
+            if (dropdownSwatch)
+                dropdownSwatch.selectedColor = value;
+        }
+
+        dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
+    }
+
+    //----------------------------------
+    //  showTextField
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the showTextField property.
+     */
+    private var _showTextField:Boolean = true;
+
+    [Inspectable(category="General", defaultValue="true")]
+
+    /**
+     *  Specifies whether to show the text box that displays the color
+     *  label or hexadecimal color value.
+     *
+     *  @default true
+     */
+    public function get showTextField():Boolean
+    {
+        return _showTextField;
+    }
+
+    /**
+     *  @private
+     */
+    public function set showTextField(value:Boolean):void
+    {
+        _showTextField = value;
+
+        if (dropdownSwatch)
+            dropdownSwatch.showTextField = value;
+    }
+
+    //----------------------------------
+    //  swatchStyleFilters
+    //----------------------------------
+
+    /**
+     *  Set of styles to pass from the ColorPicker through to the preview swatch.
+     *  @see mx.styles.StyleProxy
+     *  @review
+     */
+    protected function get swatchStyleFilters():Object
+    {
+        return _swatchStyleFilters;
+    }
+
+    private static const _swatchStyleFilters:Object =
+    {
+        "swatchBorderColor" : "swatchBorderColor",
+        "swatchBorderSize" : "swatchBorderSize"
+    };
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods: UIComponent
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function initializeAccessibility():void
+    {
+        if (ColorPicker.createAccessibilityImplementation != null)
+            ColorPicker.createAccessibilityImplementation(this);
+    }
+
+    /**
+     *  @private
+     */
+    override protected function createChildren():void
+    {
+        super.createChildren();
+
+        // Create swatch preview
+        if (!swatchPreview)
+        {
+            swatchPreview = new SwatchSkin();
+
+            swatchPreview.styleName = new StyleProxy(this, swatchStyleFilters);
+            swatchPreview.color = selectedColor;
+            swatchPreview.name = "colorPickerSwatch";
+            if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
+                swatchPreview.setStyle("swatchBorderSize", 0);
+
+            addChild(swatchPreview);
+        }
+
+        setChildIndex(swatchPreview, getChildIndex(downArrowButton));
+        textInput.visible = false;
+
+        // Update the preview swatch
+        if (!enabled)
+            super.enabled = enabled;
+
+        initializing = false;
+    }
+
+    /**
+     *  @private
+     */
+    override protected function commitProperties():void
+    {
+        super.commitProperties();
+
+        // Code executed when model (dataProvider changes)
+        // If dataProvider is changed, selectedColor if found in
+        // the new dataProvider is selected
+        // else selectedColor is color at selectedIndex = 0;
+        if (collectionChanged)
+        {
+            if (findColorByName(selectedColor) == -1)
+            {
+                if (dataProvider.length > 0 && selectedIndex > dataProvider.length)
+                    selectedIndex = 0;
+                if (getColor(selectedIndex) >= 0)
+                {
+                    selectedColor = getColor(selectedIndex);
+                    swatchPreview.color = selectedColor;
+                }
+                else
+                {
+                    if (dropdownSwatch)
+                        swatchPreview.color = dropdownSwatch.selectedColor;
+                }
+            }
+            else
+                selectedIndex = findColorByName(selectedColor);
+            collectionChanged = false;
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function measure():void
+    {
+        // Though deriving from ComboBase this doesnot implement
+        // calcPreferredSizeFromData required by the super measure.
+        // Hence do not call it.
+        // super.measure();
+
+        // Make sure we're a small square, so we use HEIGHT for both
+        measuredMinWidth = measuredWidth = DEFAULT_MEASURED_MIN_HEIGHT;
+        measuredMinHeight = measuredHeight = DEFAULT_MEASURED_MIN_HEIGHT;
+    }
+
+    /**
+     *  @private
+     */
+    override protected function updateDisplayList(unscaledWidth:Number,
+                                                  unscaledHeight:Number):void
+    {
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        swatchPreview.color = selectedColor;
+        swatchPreview.setActualSize(unscaledWidth, unscaledHeight);
+
+        // super may push it around
+        downArrowButton.move(0, 0);
+        downArrowButton.setActualSize(unscaledWidth, unscaledHeight);
+
+        if (dropdownSwatch)
+        {
+            dropdownSwatch.setActualSize(
+                dropdownSwatch.getExplicitOrMeasuredWidth(),
+                dropdownSwatch.getExplicitOrMeasuredHeight());
+        }
+    }
+
+    /**
+     *  @private
+     *  Invalidate Style
+     */
+    override public function styleChanged(styleProp:String):void
+    {
+
+        if (dropdownSwatch)
+        {
+            // VERSION check
+            if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0)
+            {
+                if (styleProp == "swatchPanelStyleName")
+                {
+                    var swatchPanelStyleName:Object = getStyle("swatchPanelStyleName");
+                    if (swatchPanelStyleName)
+                        dropdownSwatch.styleName = swatchPanelStyleName;
+                }
+            }
+            dropdownSwatch.styleChanged(styleProp);
+        }
+
+
+        super.styleChanged(styleProp);
+
+        // Adjust tweenMask size if needed
+        invalidateDisplayList();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Displays the drop-down SwatchPanel object
+     *  that shows colors that users can select.
+     *
+     *  @helpid 4925
+     */
+    public function open():void
+    {
+        displayDropdown(true);
+    }
+
+    /**
+     *  Hides the drop-down SwatchPanel object.
+     *
+     *  @helpid 4926
+     */
+    public function close(trigger:Event = null):void
+    {
+        displayDropdown(false, trigger);
+    }
+
+    /**
+     *  @private
+     *  Dropdown Creation
+     */
+    mx_internal function getDropdown():SwatchPanel
+    {
+        if (initializing)
+            return null;
+
+        if (!dropdownSwatch)
+        {
+            dropdownSwatch = new SwatchPanel();
+            dropdownSwatch.owner = this;
+            dropdownSwatch.editable = editable;
+            dropdownSwatch.colorField = colorField;
+            dropdownSwatch.labelField = labelField;
+            dropdownSwatch.dataProvider = dataProvider;
+            dropdownSwatch.showTextField = showTextField;
+            dropdownSwatch.selectedColor = selectedColor;
+            dropdownSwatch.selectedIndex = selectedIndex;
+
+            var swatchPanelStyleName:Object = getStyle("swatchPanelStyleName");
+            if (swatchPanelStyleName)
+                dropdownSwatch.styleName = swatchPanelStyleName;
+            else if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
+                dropdownSwatch.styleName = this;
+
+            // Assign event handlers
+            dropdownSwatch.addEventListener(ColorPickerEvent.ITEM_ROLL_OVER,
+                                            dropdownSwatch_itemRollOverHandler);
+            dropdownSwatch.addEventListener(ColorPickerEvent.ITEM_ROLL_OUT,
+                                            dropdownSwatch_itemRollOutHandler);
+
+            dropdownSwatch.cacheAsBitmap = true;
+            dropdownSwatch.scrollRect = new Rectangle(0, 0, 0, 0);
+        }
+
+        dropdownSwatch.scaleX = scaleX;
+        dropdownSwatch.scaleY = scaleY;
+
+        return dropdownSwatch;
+    }
+
+    /**
+     *  @private
+     *  Display Dropdown
+     */
+    mx_internal function displayDropdown(show:Boolean, trigger:Event = null):void
+    {
+        if (show == showingDropdown)
+            return;
+
+        // Find global position for the dropdown
+        var point:Point = new Point(0, 0);
+        point = localToGlobal(point);
+
+        // Show or hide the dropdown
+        var initY:Number;
+        var endY:Number;
+        var tween:Tween = null;
+        var easingFunction:Function;
+        var duration:Number;
+
+        // Save the current triggerEvent
+        triggerEvent = trigger;
+
+        if (show) // Open
+        {
+            getDropdown();
+            if (dropdownSwatch.parent == null)
+                PopUpManager.addPopUp(dropdownSwatch, parent, false);
+            else
+                PopUpManager.bringToFront(dropdownSwatch);
+
+            dropdownSwatch.addEventListener(FlexMouseEvent.MOUSE_DOWN_OUTSIDE,
+                                            dropdownSwatch_mouseDownOutsideHandler);
+            dropdownSwatch.addEventListener(FlexMouseEvent.MOUSE_WHEEL_OUTSIDE,
+                                            dropdownSwatch_mouseDownOutsideHandler);
+
+            dropdownSwatch.isOpening = true;
+            dropdownSwatch.showTextField = showTextField;
+            dropdownSwatch.selectedColor = selectedColor;
+            dropdownSwatch.owner = this;
+            point = dropdownSwatch.parent.globalToLocal(point);
+
+            // Position: top or bottom
+            var yOffset:Number = point.y;
+            var sm:ISystemManager = systemManager;
+            if (point.y + dropdownSwatch.height > sm.screen.height && point.y > (height + dropdownSwatch.height)) // Up
+            {
+                // Dropdown opens up instead of down
+                yOffset -= dropdownGap + dropdownSwatch.height;
+                initY = -dropdownSwatch.height/scaleY;
+                dropdownSwatch.tweenUp = true;
+            }
+            else // Down
+            {
+                yOffset += dropdownGap + height;
+                initY = dropdownSwatch.height/scaleY;
+                dropdownSwatch.tweenUp = false;
+            }
+
+            // Position: left or right
+            var xOffset:Number = point.x;
+            if (point.x + dropdownSwatch.width > sm.screen.width && point.x > (width + dropdownSwatch.width))
+            {
+                // Dropdown appears to the left instead of right
+                xOffset -= (dropdownSwatch.width - width);
+            }
+
+            // Position the dropdown
+            dropdownSwatch.move(xOffset, yOffset);
+
+            //dropdownSwatch.setFocus();
+
+            isDown = true;
+            isOpening = true;
+
+            endY = 0;
+            duration = getStyle("openDuration");
+            easingFunction = getStyle("openEasingFunction") as Function;
+            showingDropdown = show;
+        }
+        else // Close
+        {
+            initY = 0;
+
+            endY = dropdownSwatch.tweenUp ?
+                   -dropdownSwatch.height/scaleY :
+                   dropdownSwatch.height/scaleY;
+
+            isDown = false;
+            duration = getStyle("closeDuration");
+            easingFunction = getStyle("closeEasingFunction") as Function;
+            showingDropdown = show;
+            dropdownSwatch.removeEventListener(FlexMouseEvent.MOUSE_DOWN_OUTSIDE,
+                                               dropdownSwatch_mouseDownOutsideHandler);
+            dropdownSwatch.removeEventListener(FlexMouseEvent.MOUSE_WHEEL_OUTSIDE,
+                                               dropdownSwatch_mouseDownOutsideHandler);
+
+            PopUpManager.removePopUp(dropdownSwatch);
+        }
+
+        if (dropdownSwatch)
+        {
+            dropdownSwatch.visible = true;
+            dropdownSwatch.enabled = false;
+        }
+
+        UIComponentGlobals.layoutManager.validateNow();
+        // Block all layout, responses from web service, and other background
+        // processing until the tween finishes executing.
+        UIComponent.suspendBackgroundProcessing();
+
+        tween = new Tween(this, initY, endY, duration);
+        if (easingFunction != null)
+            tween.easingFunction = easingFunction;
+    }
+
+    /**
+     *  @private
+     *  Load Default Palette
+     */
+    private function loadDefaultPalette():void
+    {
+        // Initialize default swatch list
+        if (!dataProvider || dataProvider.length < 1)
+        {
+            var wsp:WebSafePalette = new WebSafePalette();
+            dataProvider = wsp.getList();
+        }
+        selectedIndex = findColorByName(selectedColor);
+    }
+
+    /**
+     *  @private
+     *  Update Color Preview
+     */
+    private function updateColor(color:Number):void
+    {
+        if (initializing || isNaN(color))
+            return;
+
+        // Update the preview swatch
+        swatchPreview.updateSkin(color);
+    }
+
+    /**
+     *  @private
+     *  Find Color by Name
+     */
+    private function findColorByName(name:Number):int
+    {
+        if (name == getColor(selectedIndex))
+            return selectedIndex;
+
+        var n:int = dataProvider.length;
+        for (var i:int = 0; i < dataProvider.length; i++)
+        {
+            if (name == getColor(i))
+                return i;
+        }
+
+        return -1;
+    }
+
+    /**
+     *  @private
+     *  Get Color Value
+     */
+    private function getColor(location:int):Number
+    {
+        if (!dataProvider || dataProvider.length < 1 ||
+            location < 0 || location >= dataProvider.length)
+        {
+            return -1;
+        }
+
+        return Number(typeof(dataProvider.getItemAt(location)) == "object" ?
+                      dataProvider.getItemAt(location)[colorField] :
+                      dataProvider.getItemAt(location));
+
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden event handlers: UIComponent
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function focusInHandler(event:FocusEvent):void
+    {
+        var fm:IFocusManager = focusManager;
+        if (fm)
+            fm.showFocusIndicator = true;
+
+        if (isDown && !isOpening)
+            close();
+        else if (isOpening)
+            isOpening = false;
+
+        super.focusInHandler(event);
+    }
+
+    /**
+     *  @private
+     */
+    override protected function keyDownHandler(event:KeyboardEvent):void
+    {
+        var cpEvent:ColorPickerEvent = null;
+
+        if (event.ctrlKey && event.keyCode == Keyboard.DOWN)
+        {
+            displayDropdown(true, event);
+        }
+
+        else if ((event.ctrlKey && event.keyCode == Keyboard.UP) ||
+                 event.keyCode == Keyboard.ESCAPE)
+        {
+            if (dropdownSwatch && dropdownSwatch.enabled)
+                close(event);
+        }
+
+        else if (showingDropdown && event.keyCode == Keyboard.ENTER && dropdownSwatch.enabled)
+        {
+            if (!dropdownSwatch.isOverGrid && editable)
+            {
+                if (selectedColor != dropdownSwatch.selectedColor)
+                {
+                    selectedColor = dropdownSwatch.selectedColor;
+
+                    cpEvent = new ColorPickerEvent(ColorPickerEvent.CHANGE);
+                    cpEvent.index = selectedIndex;
+                    cpEvent.color = selectedColor;
+                    dispatchEvent(cpEvent);
+
+                    cpEvent = new ColorPickerEvent(ColorPickerEvent.ENTER);
+                    // The index isn't set for an ENTER event,
+                    // because the user can enter an RGB hex string that
+                    // doesn't correspond to any color in the dataProvider.
+                    cpEvent.color = selectedColor;
+                    dispatchEvent(cpEvent);
+                }
+            }
+            else if (selectedIndex != dropdownSwatch.focusedIndex)
+            {
+                dropdownSwatch.selectedIndex = dropdownSwatch.focusedIndex;
+                selectedIndex = dropdownSwatch.selectedIndex;
+
+                cpEvent = new ColorPickerEvent(ColorPickerEvent.CHANGE);
+                cpEvent.index = selectedIndex;
+                cpEvent.color = selectedColor;
+                dispatchEvent(cpEvent);
+            }
+            close();
+        }
+
+        else if (showingDropdown &&
+                 (event.keyCode == Keyboard.HOME ||
+                  event.keyCode == Keyboard.END ||
+                  event.keyCode == Keyboard.PAGE_UP ||
+                  event.keyCode == Keyboard.PAGE_DOWN ||
+                  event.keyCode == Keyboard.LEFT ||
+                  event.keyCode == Keyboard.RIGHT ||
+                  event.keyCode == Keyboard.UP ||
+                  event.keyCode == Keyboard.DOWN))
+        {
+            // Redispatch the event from the SwatchPanel
+            // so that its keyDownHandler() can handle it.
+            dropdownSwatch.dispatchEvent(event);
+        }
+
+        else if (event.keyCode == Keyboard.LEFT)
+        {
+            if (selectedIndex == -1)
+            {
+                selectedIndex = findColorByName(selectedColor);
+            }
+            if (selectedIndex - 1 >= 0)
+            {
+                selectedIndex--;
+
+                cpEvent = new ColorPickerEvent(ColorPickerEvent.CHANGE);
+                cpEvent.index = selectedIndex;
+                cpEvent.color = selectedColor;
+                dispatchEvent(cpEvent);
+            }
+        }
+
+        else if (event.keyCode == Keyboard.RIGHT)
+        {
+            if (selectedIndex == -1)
+            {
+                selectedIndex = findColorByName(selectedColor);
+            }
+            if (selectedIndex + 1 < dataProvider.length)
+            {
+                selectedIndex++;
+
+                cpEvent = new ColorPickerEvent(ColorPickerEvent.CHANGE);
+                cpEvent.index = selectedIndex;
+                cpEvent.color = selectedColor;
+                dispatchEvent(cpEvent);
+            }
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden event handlers: ComboBase
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function collectionChangeHandler(event:Event):void
+    {
+        // Change index to match selectedcolor if the model changes.
+        if (!initializing)
+        {
+            if (dataProvider.length > 0)
+                invalidateProperties();
+            else
+            {
+                selectedColor = 0x000000;
+                selectedIndex = -1;
+            }
+            collectionChanged = true;
+        }
+
+        if (dropdownSwatch)
+            dropdownSwatch.dataProvider = dataProvider;
+    }
+
+    /**
+     *  @private
+     *  On Down Arrow
+     */
+    override protected function downArrowButton_buttonDownHandler(
+                                    event:FlexEvent):void
+    {
+        // The down arrow should always toggle the visibility of the dropdown
+        displayDropdown(!showingDropdown, event);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function dropdownSwatch_itemRollOverHandler(event:ColorPickerEvent):void
+    {
+        dispatchEvent(event);
+    }
+
+    /**
+     *  @private
+     */
+    private function dropdownSwatch_itemRollOutHandler(event:ColorPickerEvent):void
+    {
+        dispatchEvent(event);
+    }
+
+    /**
+     *  @private
+     */
+    private function dropdownSwatch_mouseDownOutsideHandler(event:MouseEvent):void
+    {
+        if (!hitTestPoint(event.stageX, event.stageY, true))
+            close(event);
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal function onTweenUpdate(value:Number):void
+    {
+        dropdownSwatch.scrollRect = new Rectangle(0, value, dropdownSwatch.width, dropdownSwatch.height);
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal function onTweenEnd(value:Number):void
+    {
+        if (showingDropdown)
+        {
+            dropdownSwatch.scrollRect = null;
+        }
+        else
+        {
+            onTweenUpdate(value);
+            dropdownSwatch.visible = false;
+            isOpening = false;
+        }
+
+        UIComponent.resumeBackgroundProcessing();
+
+        if (showingDropdown)
+            dropdownSwatch.setFocus();
+        else
+            setFocus();
+
+        dropdownSwatch.enabled = true;
+        dispatchEvent(new DropdownEvent(showingDropdown ? DropdownEvent.OPEN : DropdownEvent.CLOSE, false, false, triggerEvent));
+    }
+}
+
+}


FLEX-34084 Stop RTE from happening

FLEX-34084 Stop RTE from happening

--- frameworks/projects/mx/src/mx/controls/Menu.as
+++ frameworks/projects/mx/src/mx/controls/Menu.as
@@ -1398,8 +1398,11 @@
     {
         super.updateDisplayList(unscaledWidth, unscaledHeight);

-        border.move(0, 0);
-        border.visible = (dataProvider != null && dataProvider.length > 0);
+		if (border)
+		{
+        	border.move(0, 0);
+        	border.visible = (dataProvider != null && dataProvider.length > 0);
+		}

         // there's sort of a bug in the player that if we don't give size to the
         // hiddenItem it gets set to width = 0 and then you can't measure text anymore.


Transferred from the Adobe Open Source Subversion Repository

Revision: 215
Author:   clucier@adobe.com
Date:     2008-01-16T13:25:37.225132Z

Log Message:
-----------
Adding several new events to WindowedApplication and Window (popular demand),
namely Event.CLOSE, windowActivate, and windowDeactivate.

Bugs: SDK-14293, SDK-14296
QA: Yes
Doc: Yes
Cyclone: Yes

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/core/WindowedApplication.as</path>

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

--- frameworks/projects/airframework/src/mx/core/Window.as
+++ frameworks/projects/airframework/src/mx/core/Window.as
@@ -61,6 +61,29 @@
  *  @eventType mx.events.AIREvent.APPLICATION_DEACTIVATE
  */
 [Event(name="applicationDeactivate", type="mx.events.AIREvent")]
+
+/**
+ *  Dispatched after the window has been activated.
+ *
+ *  @eventType mx.events.Event.ACTIVATE
+ */
+[Event(name="windowActivate", type="flash.events.Event")]
+
+/**
+ *  Dispatched after the window has been deactivated.
+ *
+ *  @eventType mx.events.Event.DEACTIVATE
+ */
+[Event(name="windowDeactivate", type="flash.events.Event")]
+
+/**
+ *  Dispatched after the window has been closed.
+ *
+ *  @eventType flash.events.Event.CLOSE
+ *
+ *  @see flash.display.NativeWindow
+ */
+[Event(name="close", type="flash.events.Event")]

 /**
  *  Dispatched before the window closes.
@@ -1889,6 +1912,9 @@
 	 		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);
  			//debug
  			var x:Object = StyleManager.stylesRoot;
@@ -2803,6 +2829,9 @@
         systemManager.stage.nativeWindow.addEventListener(
             "closing", window_closingHandler);

+        systemManager.stage.nativeWindow.addEventListener(
+            "close", window_closeHandler, false, 0, true);
+
         systemManager.stage.nativeWindow.addEventListener(
             NativeWindowBoundsEvent.MOVING, window_boundsHandler);

@@ -2939,6 +2968,14 @@
     /**
      *  @private
      */
+    private function window_closeHandler(event:Event):void
+    {
+        dispatchEvent(new Event("close"));
+    }
+
+    /**
+     *  @private
+     */
     private function window_resizeHandler(event:NativeWindowBoundsEvent):void
     {
         invalidateViewMetricsAndPadding();
@@ -2980,6 +3017,22 @@
  		dispatchEvent(new AIREvent(AIREvent.APPLICATION_DEACTIVATE));
  	}

+ 	/**
+ 	 *  @private
+ 	 */
+ 	private function nativeWindow_activateHandler(event:Event):void
+ 	{
+ 		dispatchEvent(new Event("windowActivate"));
+ 	}
+
+ 	/**
+ 	 *  @private
+ 	 */
+ 	private function nativeWindow_deactivateHandler(event:Event):void
+ 	{
+ 		dispatchEvent(new Event("windowDeactivate"));
+ 	}
+
  	/**
  	 *  @private
  	 */


Transferred from the Adobe Open Source Subversion Repository

Revision: 3411
Author:   egeorgie@adobe.com
Date:     2008-09-29T23:44:01.337941Z

Log Message:
-----------
* Change layout-related width/height, explicit width/height, measured width/height properties from post-scale to pre-transform. yay!
* Flex3 containers are updated to support the new behavior.
* Repeatedly scaling a component can differ from before, since we no longer accumulate rounding errors.
* The change is gated by a version flag, in compatibility mode these properties don't change.

Reviewed by Glenn, Ely

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/utilityClasses/BoxLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Box.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/utilityClasses/CanvasLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Tile.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/utilityClasses/PostScaleAdapter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Accordion.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/DividedBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/FormItem.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/LayoutItemUIC.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>

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

--- frameworks/projects/mx/src/mx/containers/DividedBox.as
+++ frameworks/projects/mx/src/mx/containers/DividedBox.as
@@ -549,7 +549,7 @@
 		var n:int = numChildren;
 		for (var i:int = 0; i < n; i++)
 		{
-			var child:IUIComponent = IUIComponent(getChildAt(i));
+			var child:IUIComponent = getLayoutChildAt(i);

 			if (!child.includeInLayout)
 				continue;
@@ -608,7 +608,7 @@
  			n = numChildren;
  			for (i = 0; i < n; i++)
  			{
- 				var child:IUIComponent = IUIComponent(getChildAt(i));
+ 				var child:IUIComponent = getLayoutChildAt(i);

 				if (!child.includeInLayout)
 					continue;
@@ -811,8 +811,8 @@

 		var divider:BoxDivider = BoxDivider(getDividerAt(i));

-		var prevChild:IUIComponent = IUIComponent(getChildAt(i));
-		var nextChild:IUIComponent = IUIComponent(getChildAt(i + 1));
+		var prevChild:IUIComponent = getLayoutChildAt(i);
+		var nextChild:IUIComponent = getLayoutChildAt(i + 1);

 		var vm:EdgeMetrics = viewMetrics;

@@ -987,7 +987,7 @@
 		var n:int = numChildren;
 		for (var i:int = 0; i < n; i++)
 		{
-			var child:IUIComponent = IUIComponent(getChildAt(i));
+			var child:IUIComponent = getLayoutChildAt(i);

 			var sz:Number = vertical ? child.height : child.width;

@@ -1249,7 +1249,7 @@
 			amt -= move;

 			// Adjust the child size.
-			child = IUIComponent(getChildAt(i));
+			child = getLayoutChildAt(i);
 			childSize = (newSize / smallest) * 100;

 			if (vertical)
@@ -1279,7 +1279,7 @@
 			newSize = size.size + move;
 			amt += move;

-			child = IUIComponent(getChildAt(i));
+			child = getLayoutChildAt(i);
 			childSize = (newSize / smallest) * 100;

 			if (vertical)
@@ -1337,7 +1337,7 @@

 		for (i = 0; i < n; i++)
 		{
-			child = IUIComponent(getChildAt(i));
+			child = getLayoutChildAt(i);

 			if (!child.includeInLayout)
 				continue;
@@ -1363,7 +1363,7 @@
 			// without concern.
 			if (n > 0)
 			{
-				child = IUIComponent(getChildAt(n - 1));
+				child = getLayoutChildAt(n - 1);

 				if (child.includeInLayout)
 				{
@@ -1385,7 +1385,7 @@
 			var delta:Number = Math.ceil((100 - totalPerc) / percCount);
 			for (i = 0; i < n; i++)
 			{
-				child = IUIComponent(getChildAt(i));
+				child = getLayoutChildAt(i);

 				if (!child.includeInLayout)
 					continue;
@@ -1459,14 +1459,14 @@
 			// First, check for any percentage values
 			for (var i:int = 0; i < numChildren - 2; i++)
 			{
-				comp = IUIComponent(getChildAt(i));
+				comp = getLayoutChildAt(i);
 				if (!isNaN(isVertical ? comp.percentHeight : comp.percentWidth))
 					foundPercentage = true;
 			}

 			// Next, see if the old last child has 100%, and reset if it
 			// does.
-			comp = IUIComponent(getChildAt(numChildren - 2));
+			comp = getLayoutChildAt(numChildren - 2);
 			if (!foundPercentage)
 			{
 				if (isVertical)