Transferred from the Adobe Open Source Subversion Repository

Revision: 4357
Author:   egreenfi@adobe.com
Date:     2008-12-18T23:52:27.017290Z

Log Message:
-----------
UIComponent now implements ILayoutElement directly

ILayoutElement was moved to mx.core.ILayoutElement, as it is now a core interface required by UIComponent.

Further phases to follow:
1) IVlisualElement to extend ILayoutElement, pending resolution of a compiler bug.
2) remove LayoutElementUIC, pending UIMovieclip implementing ILayoutElement
3) remove LayoutElementFactory, once all IVisualElements implement ILayoutElement directly.
4) remove ITransformable, moving transform properties onto IVisualElement.

Reviewer: Evtim
QA: yes.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/layout/layout_tester.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LinearLayoutVector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/DataGroup.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/MatrixUtil.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/ILayoutElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxHSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxHScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimate3DInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LayoutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxScrollerSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxVSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LayoutElementFactory.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/BasicLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxVScrollBar.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/LayoutElementUIComponentUtils.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/utils/MatrixUtil.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/ILayoutElement.as" copyfrom-rev="4249" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ILayoutElement.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/mx/layout/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LayoutElementUIC.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>

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

--- frameworks/projects/framework/src/mx/core/LayoutElementUIComponentUtils.as
+++ frameworks/projects/framework/src/mx/core/LayoutElementUIComponentUtils.as
@@ -0,0 +1,433 @@
+package mx.core
+{
+import flash.geom.Matrix;
+import flash.geom.Matrix3D;
+import flash.geom.Point;
+
+import mx.utils.MatrixUtil;
+
+public class LayoutElementUIComponentUtils
+{
+
+    include "../core/Version.as";
+
+	public function LayoutElementUIComponentUtils()
+	{
+
+	}
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+
+    /**
+     *  @return Returns the preferred width (untransformed) of the IUIComponent.
+     *  Takes into account measured width, explicit width, explicit min width
+     *  and explicit max width.
+     */
+    private static function getPreferredUBoundsWidth(obj:IUIComponent):Number
+    {
+    	var result:Number;
+        // explicit trumps measured.
+        // measured is restricted by explicitMin and then by explicitMax.
+        if (!isNaN(obj.explicitWidth))
+        {
+			result = obj.explicitWidth;
+        }
+        else
+        {
+            result = obj.measuredWidth;
+
+            // We don't check against measuredMinHeight, since
+            // measuredMinWidth <= measuredWidth is expected always to be true.
+            if (!isNaN(obj.explicitMinWidth))
+               result = Math.max(result,
+                                                 obj.explicitMinWidth);
+            if (!isNaN(obj.explicitMaxWidth))
+               result = Math.min(result,
+                                                 obj.explicitMaxWidth);
+        }
+
+        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+        {
+            // We are already taking scale into account from the transform,
+            // so adjust here since IUIComponent mixes it with width/height
+            result /= obj.scaleX;
+        }
+        return result;
+    }
+
+    /**
+     *  @return Returns the preferred height (untransformed) of the IUIComponent.
+     *  Takes into account measured height, explicit height, explicit min height
+     *  and explicit max height.
+     */
+    private static function getPreferredUBoundsHeight(obj:IUIComponent):Number
+    {
+    	var result:Number;
+
+        // explicit trumps measured.
+        // measured is restricted by explicitMin and then by explicitMax.
+        if (!isNaN(obj.explicitHeight))
+        {
+            result = obj.explicitHeight;
+        }
+        else
+        {
+            result = obj.measuredHeight;
+
+            // We don't check against measuredMinHeight, since
+            // measuredMinHeight <= measuredHeight is expected always to be true.
+            if (!isNaN(obj.explicitMinHeight))
+                result = Math.max(result,
+                                                   obj.explicitMinHeight);
+            if (!isNaN(obj.explicitMaxHeight))
+                result = Math.min(result,
+                                                   obj.explicitMaxHeight);
+        }
+
+        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+        {
+            // We are already taking scale into account from the transform,
+            // so adjust here since IUIComponent mixes it with width/height
+            result /= obj.scaleY;
+        }
+        return result;
+    }
+
+    private static function getMinUBoundsWidth(obj:IUIComponent):Number
+    {
+        // explicit trumps explicitMin trumps measuredMin.
+        // measuredMin is restricted by explicitMax.
+        var minWidth:Number;
+        if (!isNaN(obj.explicitMinWidth))
+        {
+            minWidth = obj.explicitMinWidth;
+        }
+        else
+        {
+            minWidth = isNaN(obj.measuredMinWidth) ? 0 : obj.measuredMinWidth;
+            if (!isNaN(obj.explicitMaxWidth))
+                minWidth = Math.min(minWidth, obj.explicitMaxWidth);
+        }
+
+        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+        {
+            // We are already taking scale into account from the transform,
+            // so adjust here since IUIComponent mixes it with width/height
+            minWidth /= obj.scaleX;
+        }
+        return minWidth;
+    }
+
+    private static function getMinUBoundsHeight(obj:IUIComponent):Number
+    {
+        // explicit trumps explicitMin trumps measuredMin.
+        // measuredMin is restricted by explicitMax.
+        var minHeight:Number;
+        if (!isNaN(obj.explicitMinHeight))
+        {
+            minHeight = obj.explicitMinHeight;
+        }
+        else
+        {
+            minHeight = isNaN(obj.measuredMinHeight) ? 0 : obj.measuredMinHeight;
+            if (!isNaN(obj.explicitMaxHeight))
+                minHeight = Math.min(minHeight, obj.explicitMaxHeight);
+        }
+
+        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+        {
+            // We are already taking scale into account from the transform,
+            // so adjust here since IUIComponent mixes it with width/height
+            minHeight /= obj.scaleY;
+        }
+        return minHeight;
+    }
+
+    private static function getMaxUBoundsWidth(obj:IUIComponent):Number
+    {
+        // explicit trumps explicitMax trumps Number.MAX_VALUE.
+        var maxWidth:Number;
+        if (!isNaN(obj.explicitMaxWidth))
+            maxWidth = obj.explicitMaxWidth;
+        else
+            maxWidth = Number.MAX_VALUE;
+
+        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+        {
+            // We are already taking scale into account from the transform,
+            // so adjust here since IUIComponent mixes it with width/height
+            maxWidth /= obj.scaleX;
+        }
+        return maxWidth;
+    }
+
+    private static function getMaxUBoundsHeight(obj:IUIComponent):Number
+    {
+        // explicit trumps explicitMax trumps Number.MAX_VALUE.
+        var maxHeight:Number;
+        if(!isNaN(obj.explicitMaxHeight))
+            maxHeight = obj.explicitMaxHeight;
+        else
+            maxHeight = Number.MAX_VALUE;
+
+        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+        {
+            // We are already taking scale into account from the transform,
+            // so adjust here since IUIComponent mixes it with width/height
+            maxHeight /= obj.scaleY;
+        }
+        return maxHeight;
+    }
+
+
+
+    /**
+     *  @inheritDoc
+     */
+    public static function getPreferredBoundsWidth(obj:IUIComponent,transformMatrix:Matrix):Number
+    {
+        var width:Number = getPreferredUBoundsWidth(obj);
+
+        if (transformMatrix)
+        {
+			width = MatrixUtil.transformSize(new Point(width, getPreferredUBoundsHeight(obj)), transformMatrix).x;
+        }
+        return width;
+    }
+
+    public static function getPreferredBoundsHeight(obj:IUIComponent,transformMatrix:Matrix):Number
+    {
+        var height:Number = getPreferredUBoundsHeight(obj);
+
+        if (transformMatrix)
+        {
+                height = MatrixUtil.transformSize(new Point(getPreferredUBoundsWidth(obj), height), transformMatrix).y;
+        }
+        return height;
+    }
+
+    /**
+     *  @inheritDoc
+     */
+    public static function getMinBoundsWidth(obj:IUIComponent, transformMatrix:Matrix):Number
+    {
+        var width:Number = getMinUBoundsWidth(obj);
+
+        if (transformMatrix)
+        {
+			width = MatrixUtil.transformSize(new Point(width, getMinUBoundsHeight(obj)), transformMatrix).x;
+        }
+
+        return width;
+    }
+
+    public static function getMinBoundsHeight(obj:IUIComponent,transformMatrix:Matrix):Number
+    {
+        var height:Number = getMinUBoundsHeight(obj);
+
+        if (transformMatrix)
+        {
+			height = MatrixUtil.transformSize(new Point(getMinUBoundsWidth(obj), height), transformMatrix).y;
+        }
+
+        return height;
+    }
+
+    /**
+     *  @inheritDoc
+     */
+    public static function getMaxBoundsWidth(obj:IUIComponent, transformMatrix:Matrix):Number
+    {
+        var width:Number = getMaxUBoundsWidth(obj);
+        if (transformMatrix)
+        {
+			width = MatrixUtil.transformSize(new Point(width, getMaxUBoundsHeight(obj)), transformMatrix).x;
+        }
+
+        return width;
+    }
+
+    public static function getMaxBoundsHeight(obj:IUIComponent,transformMatrix:Matrix):Number
+    {
+        var height:Number = getMaxUBoundsHeight(obj);
+        if (transformMatrix)
+        {
+			height = MatrixUtil.transformSize(new Point(getMaxUBoundsWidth(obj), height), transformMatrix).y;
+        }
+
+        return height;
+    }
+
+    /**
+     *  @inheritDoc
+     */
+    public static function getLayoutBoundsWidth(obj:IUIComponent,transformMatrix:Matrix):Number
+    {
+        var width:Number = obj.width;
+        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+        {
+            // We are already taking scale into account from the transform,
+            // so adjust here since IUIComponent mixes it with width/height
+            width /= obj.scaleX;
+        }
+
+        if (transformMatrix)
+        {
+            var height:Number = obj.height;
+            if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+            {
+                // We are already taking scale into account from the transform,
+                // so adjust here since IUIComponent mixes it with width/height
+                height /= obj.scaleY;
+            }
+
+            // By default the IUIComponent's registration point is the same
+            // as its untransformed border top-left corner, which is (0,0).
+            width = MatrixUtil.transformBounds(new Point(width, height),
+                                               transformMatrix,
+                                               new Point()).x;
+        }
+        return width;
+    }
+
+    public static function getLayoutBoundsHeight(obj:IUIComponent,transformMatrix:Matrix):Number
+    {
+        var height:Number = obj.height;
+        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+        {
+            // We are already taking scale into account from the transform,
+            // so adjust here since IUIComponent mixes it with width/height
+            height /= obj.scaleY;
+        }
+
+        if (transformMatrix)
+        {
+            var width:Number = obj.width;
+            if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+            {
+                // We are already taking scale into account from the transform,
+                // so adjust here since IUIComponent mixes it with width/height
+                width /= obj.scaleX;
+            }
+
+            // By default the IUIComponent's registration point is the same
+            // as its untransformed border top-left corner, which is (0,0).
+            height = MatrixUtil.transformBounds(new Point(width, height),
+                                                transformMatrix,
+                                                new Point()).y;
+        }
+        return height;
+    }
+
+    /**
+     *  @inheritDoc
+     */
+    public static function getLayoutBoundsX(obj:IUIComponent,transformMatrix:Matrix):Number
+    {
+        if (transformMatrix == null)
+            return obj.x;
+
+
+        var width:Number = obj.width;
+        var height:Number = obj.height;
+
+        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+        {
+            width /= obj.scaleX;
+            height /= obj.scaleY;
+        }
+
+		// We are already taking scale into account from the transform,
+		// so adjust here since IUIComponent mixes it with width/height
+		var pos:Point = new Point();
+		MatrixUtil.transformBounds(new Point(width, height),
+                            	   transformMatrix,
+                            	   pos);
+        return pos.x;
+    }
+
+    public static function getLayoutBoundsY(obj:IUIComponent,transformMatrix:Matrix):Number
+    {
+        if (transformMatrix == null)
+            return obj.y;
+
+
+        var width:Number = obj.width;
+        var height:Number = obj.height;
+
+        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+        {
+            width /= obj.scaleX;
+            height /= obj.scaleY;
+        }
+
+        // We are already taking scale into account from the transform,
+        // so adjust here since IUIComponent mixes it with width/height
+        var pos:Point = new Point();
+        MatrixUtil.transformBounds(new Point(width, height),
+                                   transformMatrix,
+                                   pos);
+        return pos.y;
+    }
+
+    /**
+     *  @inheritDoc
+     */
+    public static function setLayoutBoundsPosition(obj:IUIComponent,x:Number, y:Number, transformMatrix:Matrix):void
+    {
+        if (transformMatrix)
+        {
+        	//race("Setting actual position to " + x + "," + y);
+        	//race("\tcurrent x/y is " + obj.x + "," + obj.y);
+        	//race("\tcurrent actual position is " + actualPosition.x + "," + actualPosition.y);
+            x = x - getLayoutBoundsX(obj,transformMatrix) + obj.x;
+            y = y - getLayoutBoundsY(obj,transformMatrix) + obj.y;
+        }
+        obj.move(x, y);
+    }
+
+    /**
+     *  @inheritDoc
+     */
+    public static function setLayoutBoundsSize(obj:IUIComponent,width:Number,
+                                  height:Number,
+                                  transformMatrix:Matrix):void
+    {
+        if (!transformMatrix)
+        {
+            if (isNaN(width))
+                width = getPreferredUBoundsWidth(obj);
+            if (isNaN(height))
+                height = getPreferredUBoundsHeight(obj);
+
+            obj.setActualSize(width, height);
+            return;
+        }
+
+        var fitSize:Point = MatrixUtil.fitBounds( width, height, transformMatrix,
+                                               getPreferredUBoundsWidth(obj),
+                                               getPreferredUBoundsHeight(obj),
+                                               getMinUBoundsWidth(obj),
+                                               getMinUBoundsHeight(obj),
+                                               getMaxUBoundsWidth(obj),
+                                               getMaxUBoundsHeight(obj));
+
+        // If we couldn't fit at all, default to the minimum size
+        if (!fitSize)
+            fitSize = new Point(getMinUBoundsWidth(obj), getMinUBoundsHeight(obj));
+
+        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+        {
+            // We are already taking scale into account from the transform,
+            // so adjust here since IUIComponent mixes it with width/height
+            obj.setActualSize(fitSize.x * obj.scaleX, fitSize.y * obj.scaleY);
+        }
+        else
+            obj.setActualSize(fitSize.x, fitSize.y);
+    }
+}
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 11247
Author:   klin@adobe.com
Date:     2009-10-28T21:59:11.963883Z

Log Message:
-----------
Fix for https://bugs.adobe.com/jira/browse/SDK-23184.

Updated a bunch of Style metadata ASDocs to describe different defaults between the Halo and Spark themes. Also, fixed a few typos along the way.

defaults.css - rearranged a few styles to be in alphabetical order
Button.as - removed extra emphasizedSkin style metadata
Panel.as - added spark theme to borderAlpha metadata

QE notes: None
Doc notes: None
Bugs: SDK-23184
Reviewer: Glenn
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/TileListItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ProgressBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ButtonBarButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateChooser.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Menu.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/halo/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/fl/video/NCManagerNative.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/SkinStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ColorPicker.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/BorderStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/FlexModuleFactory.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/treeClasses/TreeItemRenderer.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/framework/src/mx/styles/metadata/TextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Application.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/LinkButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/menuClasses/MenuItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Tree.as</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/containers/Panel.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/controls/colorPickerClasses/SwatchPanel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Application.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/TileLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/PopUpMenuIcon.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/PaddingStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManagerProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/GapStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Label.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/fl/video/NCManagerDynamicStream.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/LinkBar.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/framework/src/mx/styles/metadata/FocusStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/supportClasses/AnimateTransformInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/BitmapImage.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/StrokedElement.as</path>

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


Remove invalid import.

Remove invalid import.

--- src/aerys/minko/type/interpolation/BezierCubicSegment.as
+++ src/aerys/minko/type/interpolation/BezierCubicSegment.as
@@ -1,8 +1,6 @@
 package aerys.minko.type.interpolation
 {
 	import aerys.minko.type.math.Vector4;
-
-	import mx.validators.ValidationResult;

 	public class BezierCubicSegment extends AbstractBezierSegment
 	{


Added debugging to JplayerMp4.as.

Added debugging to JplayerMp4.as.

--- actionscript/happyworm/jPlayer/JplayerMp4.as
+++ actionscript/happyworm/jPlayer/JplayerMp4.as
@@ -257,6 +257,7 @@
 		}
 		public function setFile(src:String):void {
             this.dispatchEvent(new JplayerEvent(JplayerEvent.DEBUG_MSG, myStatus, "setFile: Start - src = " + src));
+            this.dispatchEvent(new JplayerEvent(JplayerEvent.DEBUG_MSG, myStatus, "setFile: myStream = " + myStream));
 			if(myStream != null) {
 				myStream.close();
 			}


Small update to comment.

Small update to comment.

--- src/org/jivesoftware/xiff/conference/Room.as
+++ src/org/jivesoftware/xiff/conference/Room.as
@@ -856,7 +856,7 @@
 	     *
 	     * You must be joined and have owner affiliation to configure the room
 	     *
-	     * @param fieldmap A hash that is an object with keys being the room configuration
+	     * @param fieldmap FormExtension, or a hash that is an object with keys being the room configuration
 	     * form variables and the values being arrays. For single value fields, use a single
 	     * element array.
 	     * @see #configureForm


WebSocketDataSource: Reconnect on abnormal connection abort.

--- WeaveASJS/src/weavejs/data/source/WebSocketDataSource.as
+++ WeaveASJS/src/weavejs/data/source/WebSocketDataSource.as
@@ -84,6 +84,7 @@

 		public function reconnect():void /* To be called from UI reconnect button. */
 		{
+			JS.global.clearTimeout(timeoutId);
 			if (_socket && _socket.readyState < 2)
 			{
 				_socket.close(1000, "No longer needed.");
@@ -97,9 +98,14 @@
 			_socket.onerror = onError;
 		}

+		private var timeoutId:int = 0;
 		private function onClose(event:Object):void
 		{
 			_socket = null;
+			if (url.value && event.code == 1006 /* CLOSE_ABNORMAL */)
+			{
+				timeoutId = JS.global.setTimeout(reconnect, 1500)
+			}
 		}

 		private function onError(event:Object):void


color column now outputs "#RRGGBB" by default

--- WeaveData/src/weave/data/AttributeColumns/ColorColumn.as
+++ WeaveData/src/weave/data/AttributeColumns/ColorColumn.as
@@ -96,9 +96,6 @@
 				var dataMin:Number = _internalColumnStats.getMin();
 				var dataMax:Number = _internalColumnStats.getMax();
 				var value:Number = internalDynamicColumn.getValueFromKey(key, Number);
-				if (isNaN(value) || value < dataMin || value > dataMax)
-					return NaN;
-
 				var norm:Number;
 				if (dataMin == dataMax)
 					norm = 0;
@@ -106,18 +103,22 @@
 					norm = (value - dataMin) / (dataMax - dataMin);
 				color = ramp.getColorFromNorm(norm);
 			}
-
-			// return a 6-digit hex value for a String version of the color
-			if (dataType == String && isFinite(color))
-				return '0x' + StandardLib.numberToBase(color, 16, 6);
-			return color;
+
+			if (dataType == Number)
+				return color;
+
+			// return a 6-digit hex value for a String version of the color
+			if (isFinite(color))
+				return '#' + StandardLib.numberToBase(color, 16, 6);
+
+			return '';
 		}

 //		public function deriveStringFromNumber(value:Number):String
 //		{
 //			if (isNaN(value))
 //				return "NaN";
-//			return '0x' + StringLib.toBase(value, 16, 6);
+//			return '#' + StringLib.toBase(value, 16, 6);
 //		}
 	}
 }


Put tiny gaps around textures to prevent atlas artifacts.

--- exporter/src/main/as/flump/export/Atlas.as
+++ exporter/src/main/as/flump/export/Atlas.as
@@ -25,7 +25,8 @@

     // Try to place a texture in this atlas, return true if it fit
     public function place (texture :SwfTexture) :Boolean {
-        var node :Node = _root.search(new Rectangle(0, 0, texture.w, texture.h));
+        var node :Node = _root.search(
+            new Rectangle(0, 0, texture.w + 2*PADDING, texture.h + 2*PADDING));
         if (node == null) {
             return false;
         }
@@ -49,9 +50,12 @@
         var xml :String = '<atlas name="' + name + '" filename="' + name + '.png">\n';
         _root.forEach(function (node :Node) :void {
             var tex :SwfTexture = node.texture;
-            xml += '  <texture name="' + tex.libraryItem + '" xOffset="' + tex.offset.x +
-                '" yOffset="' + tex.offset.y + '" md5="' + tex.md5 +
-                '" xAtlas="' + node.bounds.x + '" yAtlas="' + node.bounds.y +
+            xml += '  <texture name="' + tex.libraryItem +
+                '" xOffset="' + tex.offset.x +
+                '" yOffset="' + tex.offset.y +
+                '" md5="' + tex.md5 +
+                '" xAtlas="' + (node.bounds.x + PADDING)
+                '" yAtlas="' + (node.bounds.y + PADDING)
                 '" wAtlas="' + tex.w + '" hAtlas="' + tex.h + '"/>\n';
         });
         return xml + '</atlas>\n';
@@ -67,11 +71,14 @@
             json.textures.push({
                 name: tex.symbol,
                 offset: [ tex.offset.x, tex.offset.y ],
-                rect: [ node.bounds.x, node.bounds.y, tex.w, tex.h ]
+                rect: [ node.bounds.x + PADDING, node.bounds.y + PADDING, tex.w, tex.h ]
             });
         });
         return json;
     }
+
+    // Empty pixels to border around each texture to prevent bleeding
+    protected static const PADDING :int = 1;

     protected var _root :Node;
 }


删除尾部的分号

删除尾部的分号

--- as3/com/netease/protobuf/SimpleWebRPC.as
+++ as3/com/netease/protobuf/SimpleWebRPC.as
@@ -14,10 +14,10 @@
 	public final class SimpleWebRPC {
 		private var urlPrefix:String
 		public function SimpleWebRPC(urlPrefix:String) {
-			this.urlPrefix = urlPrefix;
+			this.urlPrefix = urlPrefix
 		}

-		private static const REF:Dictionary = new Dictionary();
+		private static const REF:Dictionary = new Dictionary

 		public function send(qualifiedMethodName:String,
 							 input:IExternalizable,


M Register on meshes visibility change signal

--- src/aerys/minko/scene/controller/scene/RenderingController.as
+++ src/aerys/minko/scene/controller/scene/RenderingController.as
@@ -258,7 +258,7 @@
 			{
 				// fork pass if needed
 				var asShader		: ActionScriptShader	= meshEffect.getPass(i);
-				var passInstance	: ShaderInstance			= asShader.fork(meshBindings, sceneBindings);
+				var passInstance	: ShaderInstance		= asShader.fork(meshBindings, sceneBindings);

 				// create drawcall
 				var drawCall		: DrawCall		= new DrawCall();
@@ -280,6 +280,9 @@
 			}

 			_effectToMeshes[meshEffect].push(mesh);
+
+			//register to visibility change signal
+			mesh.visibilityChanged.add(meshVisibilityChangedHandler);
 		}

 		private function removeMesh(mesh : Mesh) : void
@@ -296,7 +299,7 @@
 			for (var drawCallId : uint = 0; drawCallId < numPasses; ++drawCallId)
 			{
 				// retrieve drawcall, and shaderInstance
-				var drawCall		: DrawCall		= drawCalls[drawCallId];
+				var drawCall		: DrawCall			= drawCalls[drawCallId];
 				var passInstance	: ShaderInstance	= _drawCallToPassInstance[drawCall];

 				unbind(passInstance, drawCall, meshBindings);
@@ -314,6 +317,9 @@
 				delete _effectToMeshes[meshEffect];
 				meshEffect.passesChanged.remove(effectPassesChangedHandler);
 			}
+
+			//remove to visibility change signal
+			mesh.visibilityChanged.remove(meshVisibilityChangedHandler);
 		}

 		private function meshVisibilityChangedHandler(mesh		 : Mesh,


test office commit

test office commit

--- as3porject/src/Main.as
+++ as3porject/src/Main.as
@@ -8,6 +8,7 @@
 	{
 		public function Main()
 		{
+			//test
 			super(320, 240, PlayState, 1, 20, 20);
 		}
 	}


Transferred from the Adobe Open Source Subversion Repository

Revision: 2462
Author:   jimurphy@adobe.com
Date:     2008-07-14T19:13:06.620116Z

Log Message:
-----------
gumbo push to trunk

Modified Paths:
--------------
214 paths were modified

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

--- frameworks/projects/framework/src/mx/graphics/IStroke.as
+++ frameworks/projects/framework/src/mx/graphics/IStroke.as
@@ -13,6 +13,7 @@
 {

 import flash.display.Graphics;
+import flash.geom.Rectangle;

 /**
  *  Defines the interface that classes that define a line must implement.
@@ -40,6 +41,36 @@
 	 */
 	function set weight(value:Number):void;

+    /**
+     *  A value from the LineScaleMode class
+     *  that  specifies which scale mode to use.
+     *  Value valids are:
+     *
+     *

+     *

+     *  LineScaleMode.NORMAL—
+     *  Always scale the line thickness when the object is scaled  (the default).
+     *

+     *

+     *  LineScaleMode.NONE—
+     *  Never scale the line thickness.
+     *

+     *

+     *  LineScaleMode.VERTICAL—
+     *  Do not scale the line thickness if the object is scaled vertically
+     *  only.
+     *

+     *

+     *  LineScaleMode.HORIZONTAL—
+     *  Do not scale the line thickness if the object is scaled horizontally
+     *  only.
+     *

+     *

+     *
+     *  @default LineScaleMode.NORMAL
+     */
+    function get scaleMode():String;
+
 	//--------------------------------------------------------------------------
 	//
 	//  Methods
@@ -52,6 +83,8 @@
 	 *  @param g The Graphics object to apply the properties to.
 	 */
 	function apply(g:Graphics):void;
+
+	function draw(g:Graphics, rc:Rectangle):void;
 }

 }


Update version string to 1.4.3

Update version string to 1.4.3

git-svn-id: adbdea8fc1759bd16b0eaf24a244a7e5f870a654@267 fe3f0490-d73e-11de-a956-c71e7d3a9d2f


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@1290699 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/advancedgrids/src/mx/styles/metadata/IconColorStyles.as
+++ frameworks/projects/advancedgrids/src/mx/styles/metadata/IconColorStyles.as
@@ -1,30 +1,4 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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.
-//
-////////////////////////////////////////////////////////////////////////////////

-/**
- *  The color for the icon in a skin.
- *  For example, this style is used by the CheckBoxIcon skin class
- *  to draw the check mark for a CheckBox control,
- *  by the ComboBoxSkin class to draw the down arrow of the ComboBox control,
- *  and by the DateChooserMonthArrowSkin skin class to draw the month arrow
- *  for the DateChooser control.
- *
- *  The default value depends on the component class;
- *  if it is not overridden by the class, the default value is 0x111111.
- *
- *  @langversion 3.0
- *  @playerversion Flash 9
- *  @playerversion AIR 1.1
- *  @productversion Flex 3
- */
 [Style(name="iconColor", type="uint", format="Color", inherit="yes")]

 /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 17294
Author:   jszeto@adobe.com
Date:     2010-08-11T23:53:05.044882Z

Log Message:
-----------
SDK bug fix

http://bugs.adobe.com/jira/browse/SDK-27302 - Compilation error when compiling an app that uses a custom RSL containing DMV Components

I added a new style to ButtonBase called labelPlacement. But the inherit parameter differed from the same named style in Legend.as.

The fix is to change labelPlacement to an inheriting style. Since ButtonBase isn't a container, this shouldn't pose any different in behavior.

QE notes: none
Doc notes: none
Bugs: SDK-27302
Reviewer: Jason San Jose
Tests run: checkintests
Is noteworthy for integration: yes, this will fix a blocking issue for integration

Modified Paths:
--------------
/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as

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

--- frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as
@@ -108,7 +108,7 @@
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-[Style(name="labelPlacement", type="String", enumeration="left,right,top,bottom", inherit="no", theme="spark")]
+[Style(name="labelPlacement", type="String", enumeration="top,bottom,right,left", inherit="yes", theme="spark")]

 /**
  *  Number of milliseconds to wait after the first buttonDown


Quick fix bug in ShaderPart.pack and unpack. The value "1" was not correctly encoded.

--- src/aerys/minko/render/shader/part/ShaderPart.as
+++ src/aerys/minko/render/shader/part/ShaderPart.as
@@ -379,6 +379,8 @@
 			if (getNode(scalar).size != 1)
 				throw new ArgumentError('Argument of size 1 expected. ' + scalar + ' received');

+			scalar = subtract(saturate(scalar), 0.0001);
+
 			var bitSh	: SFloat = float4(256. * 256. * 256., 256. * 256, 256., 1.);
 			var bitMsk	: SFloat = float4(0., 1. / 256., 1. / 256., 1. / 256.);
 			var comp	: SFloat = fractional(multiply(scalar, bitSh));
@@ -397,7 +399,7 @@
 		{
 			var bitSh : SFloat = float4(1. / (256. * 256. * 256.), 1. / (256. * 256.), 1. / 256., 1.);

-			return dotProduct4(packedScalar, bitSh);
+			return saturate(add(0.0001, dotProduct4(packedScalar, bitSh)));
 		}

 		protected final function rgba(color : uint) : SFloat


Fix minor bug in CameraData (reset method is not called on the reference to localData anymore)

--- src/aerys/minko/scene/visitor/data/CameraData.as
+++ src/aerys/minko/scene/visitor/data/CameraData.as
@@ -3,8 +3,6 @@
 	import aerys.minko.type.math.Frustum;
 	import aerys.minko.type.math.Matrix4x4;
 	import aerys.minko.type.math.Vector4;
-
-	import flash.geom.Matrix;

 	public class CameraData implements IWorldData
 	{
@@ -257,8 +255,6 @@

 			_zFarParts_invalidated	= true;
 			_projection_invalidated = true;
-
-			_localData && _localData.reset();
 		}
 	}
 }


Added ROOT_URL constant, and STAGING_SERVER_URL constant (for use in login screen form)

--- flexEditor/src/org/arisgames/editor/util/AppConstants.as
+++ flexEditor/src/org/arisgames/editor/util/AppConstants.as
@@ -2,8 +2,12 @@
 {
 public class AppConstants
 {
+	public static const APPLICATION_ENVIRONMENT_ROOT_URL:String = "http://arisgames.org/"; //For other URL's to append to
+	public static const APPLICATION_ENVIRONMENT_STAGING_URL:String = APPLICATION_ENVIRONMENT_ROOT_URL+"stagingserver1"; //server to be set on iOS device
+
 	public static const APPLICATION_ENVIRONMENT_SERVICES_URL:String = "http://davembp.local/server/services/aris/"; //staging
 	//public static const APPLICATION_ENVIRONMENT_SERVICES_URL:String = "http://www.arisgames.org/stagingserver1/services/aris/"; //staging
+

 	public static const APPLICATION_ENVIRONMENT_UPLOAD_SERVER_URL:String = "http://davembp.local/server/services/aris/uploadhandler.php"; //davembp
 	//public static const APPLICATION_ENVIRONMENT_UPLOAD_SERVER_URL:String = "http://atsosxdev.doit.wisc.edu/aris/server/services/aris/uploadhandler.php";	//dev


Transferred from the Adobe Open Source Subversion Repository

Revision: 586
Author:   gosmith@adobe.com
Date:     2008-02-21T02:36:48.924706Z

Log Message:
-----------
The trunk now thinks it is Flex 4 rather than Flex 3.

The command-line tools report their version as "4.0.0 build NNNNN" because I updated FLEX_MAJOR_VERSION in VersionInfo.jara.

There is a new constant, VERSION_4_0, in the runtime FlexVersion class with the value 0x04000000, and CURRENT_VERSION is now this version.

The defaults.css for Flex 3's framework.swc has been renamed to defaults-3.0.0.css. The 'version' style in defaults.css now has the value "4.0.0".

The VERSION constant included into component classes is now "4.0.0.0".

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/FlexVersion.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/defaults-3.0.0.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Version.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/core/Version.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/tools/VersionInfo.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/Version.as</path>

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

--- frameworks/projects/framework/src/mx/core/FlexVersion.as
+++ frameworks/projects/framework/src/mx/core/FlexVersion.as
@@ -38,7 +38,16 @@
     /**
      *  The current released version of the Flex SDK, encoded as a uint.
      */
-    public static const CURRENT_VERSION:uint = 0x03000000;
+    public static const CURRENT_VERSION:uint = 0x04000000;
+
+    /**
+     *  The compatibilityVersion value of Flex 4.0,
+     *  encoded numerically as a uint.
+     *  Code can compare this constant against
+     *  the compatibilityVersion
+     *  to implement version-specific behavior.
+     */
+    public static const VERSION_4_0:uint = 0x04000000;

     /**
      *  The compatibilityVersion value of Flex 3.0,


Transferred from the Adobe Open Source Subversion Repository

Revision: 17274
Author:   rfrishbe@adobe.com
Date:     2010-08-11T18:08:34.293087Z

Log Message:
-----------
A lot of changes, most involving touch scrolling.

UIComponent: remove keepControlOfMouseDown, which was checked in accidentally

FocusManager: move a check for event.isPreventDefauled() from the mouseDown handler to the mouseFocusHandler.  It was probably accidentally added in the mouseDown handler in the first place since mousedown events were not prevent defaultable (they are now, though)

SystemManager: Make MouseDown events prevent defaultable.  We do this for mouseWheel handlers already.  This allows our components to communicate a little with regards to who's handling this event.  Currently only ButtonBase and ItemRenderer check for this.

Split up IconItemRenderer in to MobileItemRenderer and MobileIconItemRenderer.  MobileItemRenderer is still based on UIComponent and is in charge of drawing the background and has a single text component.  MobileIconItemRenderer will be a more complex item renderer that developers can use. I'm also moving both of these classes in to the mobilecomponents project and mapping them in the spark manifest so that developers can now use them.

ButtonBase and List: Clean up code around how we deal with touch scrolling and adding a delay to button.  We also make sure that if the Button was clicked quickly before the delay fires that we show the button in the down state for some minimum amount of time.

Scroller: clean up a lot of the touch scrolling code

QE notes: None
Doc notes: None
Bugs: SDK-27263, SDK-27173, SDK-27157, SDK-27016
Reviewer: Jason SJ for MobileItemRenderer/MobileIconItemRenderer, Hans for the rest (he's still working through it though)
Tests run: checkintests, all mustella (some mustella failed for me locally but also in a clean sandbox)
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/manifest.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/styles/metadata</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/spark-manifest.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/TouchScrollingEasing.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/IconItemRenderer.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/IconItemRenderer.as" copyfrom-rev="17121" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileIconItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/styles/metadata/PaddingStyles.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/styles/metadata/GapStyles.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/styles</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>

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

--- frameworks/projects/framework/src/mx/core/UIComponent.as
+++ frameworks/projects/framework/src/mx/core/UIComponent.as
@@ -13673,21 +13673,6 @@
             return super.transform.matrix;
         }
     }
-
-    private var _keepControlOfMouseDown:Boolean = false;
-
-    public function get keepControlOfMouseDown():Boolean
-    {
-        return _keepControlOfMouseDown;
-    }
-
-    public function set keepControlOfMouseDown(value:Boolean):void
-    {
-        if (_keepControlOfMouseDown == value)
-            return;
-
-        _keepControlOfMouseDown = value;
-    }
 }

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 17366
Author:   rfrishbe@adobe.com
Date:     2010-08-18T20:55:44.548390Z

Log Message:
-----------
Adding touchDelay and minimumDownState styles to Button.

In addition, there are some other PARB changes (touchScroll is renamed to more generic gestureCapture).  This means TouchScrollEvent has been renamed to GestureCaptureEvent as well.

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

Modified Paths:
--------------
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/TouchScrollEvent.as" copyfrom-rev="17335" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/GestureCaptureEvent.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/styles/metadata/MobileTextFieldTextStyles.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/tools/dependencychecker/flex/tools/dependencychecker/FrameworkSwcDependencyRules.java</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/FrameworkClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileIconItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/TouchScrollEvent.as</path>

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

--- frameworks/projects/framework/src/mx/core/UIComponent.as
+++ frameworks/projects/framework/src/mx/core/UIComponent.as
@@ -696,42 +696,91 @@
 [Event(name="exitState", type="mx.events.FlexEvent")]

 //--------------------------------------
-//  TouchScroll events
+//  GestureCapture events
 //--------------------------------------

 /**
- *  A cancellable event, dispatched just before a touch scroll
- *  user gesture is about to take place.
+ *  A cancellable event, dispatched by a component in an attempt to
+ *  respond to a user gesture.
  *
- *
The event is a bubbling event dispatched by the
- *  Scroller on the DisplayObject that the user gesture
- *  started on (where the mouseDown/touchBegin occurred).

+ *
The event is a bubbling event dispatched on the
+ *  DisplayObject that the user gesture
+ *  started (where the mouseDown/touchBegin occurred).

+ *
+ *
Components responding to user gestures should listen for
+ *  gesture capture events to coordinate with other components around
+ *  what type of gesture the user intended to make and which component
+ *  is responding to that gesture.

+ *
+ *
A Scroller component will dispatch a gestureCaptureStarting event
+ *  to alert other components that may be responding to the same user
+ *  gesture that it would like to take control of this user gesture.
+ *  This is an opportunity for other components to cancel the Scroller's
+ *  action and to maintain control over this user gesture.

  *
- *  @eventType mx.events.TouchScrollEvent.TOUCH_SCROLL_STARTING
+ *  @eventType mx.events.GestureCaptureEvent.GESTURE_CAPTURE_STARTING
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
  *  @playerversion AIR 2.5
  *  @productversion Flex 4.5
  */
-[Event(name="touchScrollStarting", type="mx.events.TouchScrollEvent")]
+[Event(name="gestureCaptureStarting", type="mx.events.GestureCaptureEvent")]

 /**
- *  A non-cancellable event, dispatched when touch scroll
- *  user gesture is about to take place.
+ *  A non-cancellable event, dispatched by a component when it starts
+ *  responding to a user gesture.
  *
- *
The event is a bubbling event dispatched by the
- *  Scroller on the DisplayObject that the user gesture
- *  started on (where the mouseDown/touchBegin occurred).

+ *
The event is a bubbling event dispatched on the
+ *  DisplayObject that the user gesture
+ *  started (where the mouseDown/touchBegin occurred).

+ *
+ *
Components responding to user gestures should listen for
+ *  gesture capture events to coordinate with other components around
+ *  what type of gesture the user intended to make and which component
+ *  is responding to that gesture.

+ *
+ *
A Scroller component will dispatch a gestureCaptureStart event
+ *  to alert other components that may be responding to the same user
+ *  gesture that it is taking control of this user gesture.
+ *  When they see this event, other components should stop responding
+ *  to the user gesture, remove any visual indications that it is
+ *  responding to the user gesture, and perform other clean up.

  *
- *  @eventType mx.events.TouchScrollEvent.TOUCH_SCROLL_START
+ *  @eventType mx.events.GestureCaptureEvent.GESTURE_CAPTURE_START
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
  *  @playerversion AIR 2.5
  *  @productversion Flex 4.5
  */
-[Event(name="touchScrollStart", type="mx.events.TouchScrollEvent")]
+[Event(name="gestureCaptureStart", type="mx.events.GestureCaptureEvent")]
+
+/**
+ *  A non-cancellable event, dispatched by a component when it starts
+ *  responding to a user gesture.
+ *
+ *
The event is a bubbling event dispatched on the
+ *  DisplayObject that the user gesture
+ *  started (where the mouseDown/touchBegin occurred).

+ *
+ *
Components responding to user gestures should listen for
+ *  gesture capture events to coordinate with other components around
+ *  what type of gesture the user intended to make and which component
+ *  is responding to that gesture.

+ *
+ *
A Scroller component will dispatch a gestureCaptureEnd event
+ *  to alert other components that it is done responding to the user
+ *  gesture.

+ *
+ *  @eventType mx.events.GestureCaptureEvent.GESTURE_CAPTURE_END
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+[Event(name="gestureCaptureEnd", type="mx.events.GestureCaptureEvent")]

 //--------------------------------------
 //  Tooltip events


Transferred from the Adobe Open Source Subversion Repository

Revision: 21549
Author:   aharui@adobe.com
Date:     2011-07-12T17:28:34.366187Z

Log Message:
-----------
Make EmbeddedFontRegistry optional so the text controls can use it as a way of knowing if embedded fonts are being used.  Provides measureable performance improvements.  Simple shell apps will have to force-link EmbeddedFontRegistry like they do for other managers.

QE notes: Two mustella test apps require updating
Doc notes: Has been notified
Bugs: SDK-29451
Reviewer: Glenn
Tests run: Mustella Cyclone
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/framework/src/FrameworkClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/framework/src/mx/core/EmbeddedFont.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/framework/src/mx/core/UITextField.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/mx/core/UIFTETextField.as</path>

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

--- frameworks/projects/framework/src/mx/core/UITextField.as
+++ frameworks/projects/framework/src/mx/core/UITextField.as
@@ -1454,6 +1454,7 @@
     public function set moduleFactory(factory:IFlexModuleFactory):void
     {
         _moduleFactory = factory;
+        _styleManager = null;
     }

     //----------------------------------
@@ -1620,6 +1621,11 @@

     /**
      *  @private
+     */
+    private var _styleManager:IStyleManager2;
+
+    /**
+     *  @private
      *
      *  Returns the style manager used by this component.
      *
@@ -1630,7 +1636,11 @@
      */
     public function get styleManager():IStyleManager2
     {
-        return StyleManager.getStyleManager(moduleFactory);
+        if (!_styleManager)
+        {
+            _styleManager = StyleManager.getStyleManager(moduleFactory);
+        }
+        return _styleManager;
     }

     //----------------------------------
@@ -2193,7 +2203,7 @@
                 embedFonts = getStyle("embedFonts");
             }

-            if (getStyle("fontAntiAliasType") != undefined)
+            if (embedFonts && getStyle("fontAntiAliasType") != undefined)
             {
                 antiAliasType = getStyle("fontAntiAliasType");
                 gridFitType = getStyle("fontGridFitType");


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@1262205 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/resources/Locale.as
+++ frameworks/projects/framework/src/mx/resources/Locale.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.resources
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 10603
Author:   stshongr@adobe.com
Date:     2009-09-25T21:27:29.073340Z

Log Message:
-----------
Add checkin test for TileGroup
Add ASDoc examples for TileGroup/VGroup/HGroup

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

Modified Paths:
--------------
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/components/examples/TileGroupExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TileGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/basicTests/BasicTests.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/components/examples/VGroupExample.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/tests/basicTests/spark/scripts/TileGroupTestScript.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VGroup.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/components/examples/HGroupExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HGroup.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/spark/views/TileGroupTests.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/VGroup.as
+++ frameworks/projects/spark/src/spark/components/VGroup.as
@@ -45,7 +45,8 @@
  *  </pre>
  *
  *  @see spark.layouts.VerticalLayout
- *
+ *  @includeExample examples/VGroupExample.mxml
+ *
  *  @langversion 3.0
  *  @playerversion Flash 10
  *  @playerversion AIR 1.5


Transferred from the Adobe Open Source Subversion Repository

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

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

Checkintests: passed

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

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

--- frameworks/projects/spark/src/spark/effects/CrossFade.as
+++ frameworks/projects/spark/src/spark/effects/CrossFade.as
@@ -23,7 +23,7 @@
  * values in the first and second bitmaps are v1 and v2,
  * the resulting pixel value v for any pixel in the image is:

  *
- *
v = v1 * (1 - f) + v2 * f

+ *
v = v1 * (1 - f) + v2 * f

  *
  *
The bitmap effect is run by a pixel-shader program
  * that is loaded by the effect.
@@ -46,6 +46,16 @@
     private static var CrossFadeShaderClass:Class;
     private static var crossFadeShaderCode:ByteArray = new CrossFadeShaderClass();

+    /**
+     *  Constructor.
+     *
+     *  @param target The Object to animate with this effect.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
     public function CrossFade(target:Object=null)
     {
         super(target);


fixed grammar

fixed grammar

--- WeaveData/src/weave/utils/ObjectPool.as
+++ WeaveData/src/weave/utils/ObjectPool.as
@@ -76,7 +76,7 @@
 			{
 				// It's important to know when this occurs because if it does, most likely some code is incorrect.
 				// If this is ignored, the code will seem to behave randomly if the same object is being used for multiple purposes.
-				// Make sure that when returnObject() is called that any code that uses it clears all references to it.
+				// Make sure when returnObject() is called that any code using the object clears all references to it.
 				throw new Error("object was passed to returnObject() more times than necessary");
 			}


Implemented StandardLib.sortOn. #WEAVE-380 Fixed Spent time 2h30m

--- WeaveJS/src/weavejs/util/StandardLib.as
+++ WeaveJS/src/weavejs/util/StandardLib.as
@@ -616,7 +616,76 @@
 				sum += value;
 			return sum;
 		}
-
+
+		private static const AS3_CASEINSENSITIVE:int = 1;
+		private static const AS3_DESCENDING:int = 2;
+		private static const AS3_UNIQUESORT:int = 4;
+		private static const AS3_RETURNINDEXEDARRAY:int = 8;
+		private static const AS3_NUMERIC:int = 16;
+
+		private static const LODASH_ASCENDING:String = "asc";
+		private static const LODASH_DESCENDING:String = "desc";
+
+		private static var _indexMap:Object;
+
+		private static function as3SortOn(array:Array, fieldNames:*, options:*):Array
+		{
+			/* Normalize to arrays */
+			if (!(fieldNames is Array)) fieldNames = [fieldNames];
+			if (!(options is Array)) options = [options];
+
+			/* Get global options */
+			var returnIndexedArray:Boolean = options.some(function(option:int):int {return option & AS3_RETURNINDEXEDARRAY;});
+			var uniqueSort:Boolean = options.some(function(option:int):int {return option & AS3_UNIQUESORT;});
+
+			var orders:Array = options.map(function (option:int):String {
+				return (option & AS3_DESCENDING) ? LODASH_DESCENDING : LODASH_ASCENDING;
+			});
+
+			var iteratees:Array = options.map(function (option:int, index:int):* {
+				var customConvert:Function;
+				var fieldName:String = fieldNames[index];
+				/* lodash's default behavior is numeric sort, so
+				 * we have to explicitly convert to strings if we
+				 * don't want that. */
+				if (!(option & AS3_NUMERIC))
+				{
+					customConvert = function(item:*):String
+					{
+						return item[fieldName].toString();
+					}
+				}
+				else if (option & AS3_CASEINSENSITIVE)
+				{
+					customConvert = function(item:*):String
+					{
+						return item[fieldName].toString().toLocaleLowerCase();
+					}
+				}
+
+				return customConvert || fieldNames[index];
+			});
+
+			if (!_indexMap) _indexMap = new JS.Map();
+			_indexMap.clear();
+			if (returnIndexedArray)
+			{
+				/* Assert that this is an object array, this won't necessarily work with primitive types. */
+				if (!arrayIsType(array, Object)) JS.error("Warning: Can't do an indexed array sort of non-objects reliably.");
+				array.forEach(function(item:*, index:int):void {_indexMap.set(item, index);})
+			}
+
+			var result:Array = lodash.sortByOrder(array, iteratees, orders);
+
+			if (returnIndexedArray)
+			{
+				result = result.map(function (item:*):* {return _indexMap.get(item);});
+			}
+
+			return result;
+		}
+
+		private static const _sortBuffer:Array = []; /* Scratchspace to reduce GC pressure */
 		/**
 		 * Sorts an Array of items in place using properties, lookup tables, or replacer functions.
 		 * @param array An Array to sort.
@@ -634,10 +703,89 @@
 		 */
 		public static function sortOn(array:*, params:*, sortDirections:* = undefined, inPlace:Boolean = true, returnSortedIndexArray:Boolean = false):*
 		{
-			//TODO
+			if (array.length == 0)
+				return inPlace ? array : [];
+
+			var values:Array;
+			var param:*;
+			var sortDirection:int;
+			var i:int;
+
+			// expand _sortBuffer as necessary
+			for (i = _sortBuffer.length; i < array.length; i++)
+				_sortBuffer[i] = [];
+
+			// If there is only one param, wrap it in an array.
+			// Array.sortOn() is preferred over Array.sort() in this case
+			// since an undefined value will crash Array.sort(Array.NUMERIC).
+			if (params === array || !(params is Array))
+			{
+				params = [params];
+				if (sortDirections)
+					sortDirections = [sortDirections];
+			}
+
+			var fields:Array = new Array(params.length);
+			var fieldOptions:Array = new Array(params.length);
+			for (var p:int = 0; p < params.length; p++)
+			{
+				param = params[p];
+				sortDirection = sortDirections && sortDirections[p] < 0 ? AS3_DESCENDING : 0;
+
+				i = array.length;
+				if (param is Array)
+					while (i--)
+						_sortBuffer[i][p] = param[i];
+				else if (param is Function)
+					while (i--)
+						_sortBuffer[i][p] = param(array[i]);
+				else if (param is JS.Map || param is JS.WeakMap)
+					while (i--)
+						_sortBuffer[i][p] = param.get(array[i]);
+				else if (typeof param === 'object')
+					while (i--)
+						_sortBuffer[i][p] = param[array[i]];
+				else
+					while (i--)
+						_sortBuffer[i][p] = array[i][param];
+
+				fields[p] = p;
+				fieldOptions[p] = AS3_RETURNINDEXEDARRAY | guessSortMode(_sortBuffer, p) | sortDirection;
+			}
+
+			values = _sortBuffer.slice(0, array.length);
+			values = as3SortOn(values, fields, fieldOptions);
+
 			if (returnSortedIndexArray)
-				return array.map(function(o:*, i:*, a:*):* { return i; });
-			return inPlace ? array : array.concat();
+				return values;
+
+			var array2:Array = new Array(array.length);
+			i = array.length;
+			while (i--)
+				array2[i] = array[values[i]];
+
+			if (!inPlace)
+				return array2;
+
+			i = array.length;
+			while (i--)
+				array[i] = array2[i];
+			return array;
+		}
+
+		/**
+		 * Guesses the appropriate Array.sort() mode based on the first non-undefined item property from an Array.
+		 * @return Either Array.NUMERIC or 0.
+		 */
+		private static function guessSortMode(array:Object, itemProp:*):int
+		{
+			for each (var item:* in array)
+			{
+				var value:* = item[itemProp];
+				if (value !== undefined)
+					return value is Number || value is Date ? Array.NUMERIC : 0;
+			}
+			return 0;
 		}

 		/**


Transferred from the Adobe Open Source Subversion Repository

Revision: 16064
Author:   chaase@adobe.com
Date:     2010-05-12T15:37:49.345162Z

Log Message:
-----------
Initial checkin of "true autoReverse" feature. This feature adds no new API, but does add new behavior to the existing autoReverse property on Transition. Now, if autoReverse="true", any transition declared from/to the opposite states of the currently-requested state change can be used as a transition for this state change, played in reverse. This essentially means that you can author a single reverse for a forward direction and have the system play that transition in reverse for the opposite direction. Previously, you needed to author both directions, and take care to make them symmetric, in order to get them to play correctly when reversing in the middle. Note that if you author a *-to-* Transition (any to any), the new reversing behavior does nothing for you, because there is no way for the system to detect the forward (and thus the reverse) direction, so that transition will always play in the declared direction.
The main functionality needed to get this working was bolstering the currentSupport for playReversedFromEnd that already existed in Effect (along with the playReversed functionality in effect instances). There was also some timing engine details in Animation to make it work correctly, especially with startDelay.
Some work was done to make Fade work correctly when playing in reverse, though there is still a problem with some of the auto-fade functionality (fading items because of visible/parent changes between states) when the Fade effect has a startDelay.

QE notes: Tested on existing effects tests to make sure new behavior didn't break anything. But need new tests specifically around this new behavior.
Doc notes: Added new docs to Transition.autoReverse to describe the new behavior
Bugs: None
Reviewer: Corey
Tests run: checkintests, Mustella spark/effects, mx/effects
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/supportClasses/AnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Animate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/animation/Animation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/supportClasses/FadeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/states/Transition.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/SequenceInstance.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/framework/src/mx/effects/effectClasses/ParallelInstance.as</path>

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

--- frameworks/projects/framework/src/mx/core/UIComponent.as
+++ frameworks/projects/framework/src/mx/core/UIComponent.as
@@ -10191,6 +10191,10 @@

         if (nextTransition)
         {
+            var reverseTransition:Boolean =
+                nextTransition && nextTransition.autoReverse &&
+                (nextTransition.toState == oldState ||
+                 nextTransition.fromState == _currentState);
             // Force a validation before playing the transition effect
             UIComponentGlobals.layoutManager.validateNow();
             _currentTransition = nextTransition;
@@ -10203,7 +10207,7 @@
                 (prevTransitionEffect != null);
             nextTransition.effect.addEventListener(EffectEvent.EFFECT_END,
                 transition_effectEndHandler);
-            nextTransition.effect.play();
+            nextTransition.effect.play(null, reverseTransition);
             if (!isNaN(prevTransitionFraction) &&
                 nextTransition.effect.duration != 0)
                 nextTransition.effect.playheadTime = (1 - prevTransitionFraction) *
@@ -10448,43 +10452,61 @@
         var result:Transition = null;   // Current candidate
         var priority:int = 0;           // Priority     fromState   toState
                                         //    1             *           *
-                                        //    2           match         *
-                                        //    3             *         match
-                                        //    4           match       match
-
+                                        //    2          reverse        *
+                                        //    3             *        reverse
+                                        //    4          reverse     reverse
+                                        //    5           match         *
+                                        //    6             *         match
+                                        //    7           match       match
+
         if (!transitions)
             return null;
-
+
         if (!oldState)
             oldState = "";
-
+
         if (!newState)
             newState = "";
-
+
         for (var i:int = 0; i < transitions.length; i++)
         {
             var t:Transition = transitions[i];
-
+
             if (t.fromState == "*" && t.toState == "*" && priority < 1)
             {
                 result = t;
                 priority = 1;
             }
-            else if (t.fromState == oldState && t.toState == "*" && priority < 2)
+            else if (t.toState == oldState && t.fromState == "*" && t.autoReverse && priority < 2)
             {
                 result = t;
                 priority = 2;
             }
-            else if (t.fromState == "*" && t.toState == newState && priority < 3)
+            else if (t.toState == "*" && t.fromState == newState && t.autoReverse && priority < 3)
             {
                 result = t;
                 priority = 3;
             }
-            else if (t.fromState == oldState && t.toState == newState && priority < 4)
+            else if (t.toState == oldState && t.fromState == newState && t.autoReverse && priority < 4)
             {
                 result = t;
                 priority = 4;
-
+            }
+            else if (t.fromState == oldState && t.toState == "*" && priority < 5)
+            {
+                result = t;
+                priority = 5;
+            }
+            else if (t.fromState == "*" && t.toState == newState && priority < 6)
+            {
+                result = t;
+                priority = 6;
+            }
+            else if (t.fromState == oldState && t.toState == newState && priority < 7)
+            {
+                result = t;
+                priority = 7;
+
                 // Can't get any higher than this, let's go.
                 break;
             }
@@ -10493,7 +10515,7 @@
         // because there is no transition effect to run
         if (result && !result.effect)
             result = null;
-
+
         return result;
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 4205
Author:   clucier@adobe.com
Date:     2008-12-01T19:48:53.571431Z

Log Message:
-----------
Initial baselinePosition support for our new skinnable components.
QE Notes: Please wait until Evtim completes his baseline support in our new layouts to test.
Doc Notes: None
Reviewer: Glenn, Evtim

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxDefaultItemRenderer.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/ItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/TextGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxHSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxPanel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextGraphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxNumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxTextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxList.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/mx/components/TextView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>

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

--- frameworks/projects/framework/src/mx/core/UIComponent.as
+++ frameworks/projects/framework/src/mx/core/UIComponent.as
@@ -6021,7 +6021,7 @@

         // If this component hasn't been sized yet, assign it
         // an actual size that's based on its explicit or measured size.
-        if (width == 0 && height == 0)
+        if (width == 0 || height == 0)
         {
             validateNow();


Stereo (dual mono) playback of recording

--- flash/MicrophoneRecorder.as
+++ flash/MicrophoneRecorder.as
@@ -206,7 +206,7 @@
       for (; i<8192 && data.bytesAvailable && this.playing; i++) {
         sample = data.readFloat();
         event.data.writeFloat(sample);
-        event.data.writeFloat(0.0);
+        event.data.writeFloat(sample);
       }
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 13207
Author:   cframpto@adobe.com
Date:     2009-12-23T21:11:43.737438Z

Log Message:
-----------
Accepted patch for UITextField textHeight property to work around an underlying bug in the player.

flash.text.TextField does not take into account the leading on the final line of text when measuring itself, yet will scroll if it is not given this extra height. The player has retired this bug.

Ported componentSmoke test to basicTests.  If this fail it means the player has fixed the bug and we need to remove the workaround.

QE notes: components/Text/Properties/Text_Properties_tester Checking_Property_textHeight needs to be updated
Doc notes:
Bugs: SDK-24461
Reviewer:
Tests run: checkintests, mx Label, Panel, TextInput, TextArea and Text
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/basicTests/halo/scripts/TextTestScript.mxml</path>

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

--- frameworks/projects/framework/src/mx/core/UITextField.as
+++ frameworks/projects/framework/src/mx/core/UITextField.as
@@ -1658,6 +1658,26 @@
         return textHeight;
     }

+    //----------------------------------
+    //  textHeight
+    //----------------------------------
+
+    /**
+     *  @private
+     *  TextField does not take into account the leading on the final
+     *  line of text when measuring itself, yet will scroll if it is
+     *  not given this extra height. This is a player bug bug that
+     *  has been retired.
+     */
+    override public function get textHeight():Number
+    {
+        var result:Number = super.textHeight;
+        if (numLines > 1)
+            result += getLineMetrics(1).leading;
+
+        return result;
+    }
+
     //----------------------------------
     //  toolTip
     //----------------------------------


Bug 537997: add updated shell.as file that was missing from initial checkin (r=me)

--- test/acceptance/shell.as
+++ test/acceptance/shell.as
@@ -954,6 +954,18 @@
 	}
 	return num;
 }
+
+function AddErrorTest(desc:String, expectedErr:String, testFunc:Function) {
+    actualErr = null;
+    try {
+        testFunc();
+    } catch (e) {
+        actualErr = e;
+    }
+    grabError(actualErr, expectedErr);
+    AddTestCase(desc, expectedErr, actualErr.toString().substr(0, expectedErr.length));
+}
+
 var cnNoObject = 'Unexpected Error!!! Parameter to this function must be an object';
 var cnNoClass = 'Unexpected Error!!! Cannot find Class property';
 var cnObjectToString = Object.prototype.toString;
@@ -1007,6 +1019,8 @@
 }
 function reportCompare (expected, actual, description)
 {
+    AddTestCase(description, expected, actual);
+    /*
     var expected_t = typeof expected;
     var actual_t = typeof actual;
     var output = "";
@@ -1034,6 +1048,7 @@
             	reportFailure (output);
         }
     stopTest();
+    */
 }
 // encapsulate output in shell
 function _print(s) {
@@ -1060,3 +1075,226 @@
    AddTestCase(desc, expected, result);
 }

+// Helper functions for tests from spidermonkey (JS1_5 and greater)
+/*
+  Calculate the "order" of a set of data points {X: [], Y: []}
+  by computing successive "derivatives" of the data until
+  the data is exhausted or the derivative is linear.
+*/
+function BigO(data) {
+    var order = 0;
+    var origLength = data.X.length;
+
+    while (data.X.length > 2) {
+        var lr = new LinearRegression(data);
+        if (lr.b > 1e-6) {
+            // only increase the order if the slope
+            // is "great" enough
+            order++;
+        }
+
+        if (lr.r > 0.98 || lr.Syx < 1 || lr.b < 1e-6) {
+            // terminate if close to a line lr.r
+            // small error lr.Syx
+            // small slope lr.b
+            break;
+        }
+        data = dataDeriv(data);
+    }
+
+    if (2 == origLength - order) {
+        order = Number.POSITIVE_INFINITY;
+    }
+    return order;
+
+    function LinearRegression(data) {
+        /*
+      y = a + bx
+      for data points (Xi, Yi); 0 <= i < n
+
+      b = (n*SUM(XiYi) - SUM(Xi)*SUM(Yi))/(n*SUM(Xi*Xi) - SUM(Xi)*SUM(Xi))
+      a = (SUM(Yi) - b*SUM(Xi))/n
+    */
+        var i;
+
+        if (data.X.length != data.Y.length) {
+            throw 'LinearRegression: data point length mismatch';
+        }
+        if (data.X.length < 3) {
+            throw 'LinearRegression: data point length < 2';
+        }
+        var n = data.X.length;
+        var X = data.X;
+        var Y = data.Y;
+
+        this.Xavg = 0;
+        this.Yavg = 0;
+
+        var SUM_X = 0;
+        var SUM_XY = 0;
+        var SUM_XX = 0;
+        var SUM_Y = 0;
+        var SUM_YY = 0;
+
+        for (i = 0; i < n; i++) {
+            SUM_X += X[i];
+            SUM_XY += X[i] * Y[i];
+            SUM_XX += X[i] * X[i];
+            SUM_Y += Y[i];
+            SUM_YY += Y[i] * Y[i];
+        }
+
+        this.b = (n * SUM_XY - SUM_X * SUM_Y) / (n * SUM_XX - SUM_X * SUM_X);
+        this.a = (SUM_Y - this.b * SUM_X) / n;
+
+        this.Xavg = SUM_X / n;
+        this.Yavg = SUM_Y / n;
+
+        var SUM_Ydiff2 = 0;
+        var SUM_Xdiff2 = 0;
+        var SUM_XdiffYdiff = 0;
+
+        for (i = 0; i < n; i++) {
+            var Ydiff = Y[i] - this.Yavg;
+            var Xdiff = X[i] - this.Xavg;
+
+            SUM_Ydiff2 += Ydiff * Ydiff;
+            SUM_Xdiff2 += Xdiff * Xdiff;
+            SUM_XdiffYdiff += Xdiff * Ydiff;
+        }
+
+        var Syx2 = (SUM_Ydiff2 - Math.pow(SUM_XdiffYdiff / SUM_Xdiff2, 2)) / (n - 2);
+        var r2 = Math.pow((n * SUM_XY - SUM_X * SUM_Y), 2) / ((n * SUM_XX - SUM_X * SUM_X) * (n * SUM_YY - SUM_Y * SUM_Y));
+
+        this.Syx = Math.sqrt(Syx2);
+        this.r = Math.sqrt(r2);
+
+    }
+
+    function dataDeriv(data) {
+        if (data.X.length != data.Y.length) {
+            throw 'length mismatch';
+        }
+        var length = data.X.length;
+
+        if (length < 2) {
+            throw 'length ' + length + ' must be >= 2';
+        }
+        var X = data.X;
+        var Y = data.Y;
+
+        var deriv = {
+            X: [],
+            Y: []
+        };
+
+        for (var i = 0; i < length - 1; i++) {
+            deriv.X[i] = (X[i] + X[i + 1]) / 2;
+            deriv.Y[i] = (Y[i + 1] - Y[i]) / (X[i + 1] - X[i]);
+        }
+        return deriv;
+    }
+
+    return 0;
+}
+
+/*
+ * Date: 07 February 2001
+ *
+ * Functionality common to Array testing -
+ */
+//-----------------------------------------------------------------------------
+
+var gTestsubsuite = 'Expressions';
+
+var CHAR_LBRACKET = '[';
+var CHAR_RBRACKET = ']';
+var CHAR_QT_DBL = '"';
+var CHAR_QT = "'";
+var CHAR_NL = '\n';
+var CHAR_COMMA = ',';
+var CHAR_SPACE = ' ';
+var TYPE_STRING = typeof 'abc';
+
+
+/*
+ * If available, arr.toSource() gives more detail than arr.toString()
+ *
+ * var arr = Array(1,2,'3');
+ *
+ * arr.toSource()
+ * [1, 2, "3"]
+ *
+ * arr.toString()
+ * 1,2,3
+ *
+ * But toSource() doesn't exist in Rhino, so use our own imitation, below -
+ *
+ */
+function formatArray(arr)
+{
+  try
+  {
+    return arr.toSource();
+  }
+  catch(e)
+  {
+    return toSource(arr);
+  }
+}
+
+
+
+/*
+ * Imitate SpiderMonkey's arr.toSource() method:
+ *
+ * a) Double-quote each array element that is of string type
+ * b) Represent |undefined| and |null| by empty strings
+ * c) Delimit elements by a comma + single space
+ * d) Do not add delimiter at the end UNLESS the last element is |undefined|
+ * e) Add square brackets to the beginning and end of the string
+ */
+function toSource(arr)
+{
+  var delim = CHAR_COMMA + CHAR_SPACE;
+  var elt = '';
+  var ret = '';
+  var len = arr.length;
+
+  for (i=0; i<len; i++)
+  {
+    elt = arr[i];
+
+    switch(true)
+    {
+    case (typeof elt === TYPE_STRING) :
+      ret += doubleQuote(elt);
+      break;
+
+    case (elt === undefined || elt === null) :
+      break; // add nothing but the delimiter, below -
+
+    default:
+      ret += elt.toString();
+    }
+
+    if ((i < len-1) || (elt === undefined))
+      ret += delim;
+  }
+
+  return  CHAR_LBRACKET + ret + CHAR_RBRACKET;
+}
+
+
+function doubleQuote(text)
+{
+  return CHAR_QT_DBL + text + CHAR_QT_DBL;
+}
+
+
+function singleQuote(text)
+{
+  return CHAR_QT + text + CHAR_QT;
+}
+
+


updated doc

updated doc

--- WeaveAPI/src/weave/utils/getExternalObjectID.as
+++ WeaveAPI/src/weave/utils/getExternalObjectID.as
@@ -18,7 +18,8 @@
 	import flash.external.ExternalInterface;

 	/**
-	 * A way to get a Flash application's external object ID when ExternalInterface.objectID is null.
+	 * A way to get a Flash application's external object ID when ExternalInterface.objectID is null,
+	 * which may occur when using jQuery.flash().
 	 * @param desiredId If the flash application really has no id, this will be used as a base for creating a new unique id.
 	 * @return The id of the flash application.
 	 * @author adufilie


added more error checking/reporting

added more error checking/reporting

--- WeaveData/src/weave/services/URLRequestUtils.as
+++ WeaveData/src/weave/services/URLRequestUtils.as
@@ -36,6 +36,7 @@
 	import mx.rpc.events.ResultEvent;
 	import mx.utils.URLUtil;

+	import weave.api.reportError;
 	import weave.api.services.IURLRequestToken;
 	import weave.api.services.IURLRequestUtils;
 	import weave.compiler.StandardLib;
@@ -182,7 +183,7 @@

 			if (useCache && request.method == URLRequestMethod.GET)
 			{
-				var content:Object = _contentCache[request.url];
+				var content:Object = _contentCache[request.url];
 				if (content)
 				{
 					// create a request token so its cancel function can be used and the result handler won't be called next frame
@@ -201,6 +202,8 @@
 				// make the request and add handler function that will load the content
 				var customAsyncToken:CustomAsyncToken = getURL(null, request, DATA_FORMAT_BINARY) as CustomAsyncToken;
 				loader = customAsyncToken.loader as CustomURLLoader;
+				if (!loader)
+					reportError('URLLoader missing from CustomAsyncToken', null, customAsyncToken);
 				addAsyncResponder(customAsyncToken, handleGetContentResult, handleGetContentFault, request.url);
 				_requestURLToLoader[request.url] = loader;
 			}
@@ -228,14 +231,19 @@
 		 */
 		private function handleGetContentResult(resultEvent:ResultEvent, url:String):void
 		{
-			var customURLLoader:CustomURLLoader = _requestURLToLoader[url] as CustomURLLoader;
+			var customURLLoader:CustomURLLoader = _requestURLToLoader[url] as CustomURLLoader;
+			if (!customURLLoader)
+				reportError('URLLoader missing in handleGetContentResult() for ' + url);

 			var bytes:ByteArray = resultEvent.result as ByteArray;
 			if (!bytes || bytes.length == 0)
 			{
 				var fault:Fault = new Fault("Error", "HTTP GET failed: Content is null from " + url);
-				delete _requestURLToLoader[url];
-				customURLLoader.applyFault(fault);
+				delete _requestURLToLoader[url];
+				if (customURLLoader)
+					customURLLoader.applyFault(fault);
+				else
+					reportError('Content is null and URLLoader is missing in handleGetContentResult() for ' + url);
 				return;
 			}

@@ -248,7 +256,7 @@
 				_contentCache[url] = result;
 				delete _requestURLToLoader[url];
 				// run the responders from ContentRequestTokens that were not called before
-				var responders:Array = customURLLoader.asyncToken.responders;
+				var responders:Array = customURLLoader ? customURLLoader.asyncToken.responders : [];
 				var contentResultEvent:ResultEvent = ResultEvent.createEvent(result);
 				for (var i:int = 0; i < responders.length; i++)
 				{
@@ -261,7 +269,10 @@
 			{
 				var fault:Fault = new Fault(errorEvent.type, errorEvent.text + " (" + url + ")");
 				delete _requestURLToLoader[url];
-				customURLLoader.applyFault(fault);
+				if (customURLLoader)
+					customURLLoader.applyFault(fault);
+				else
+					reportError('Received fault from content Loader; URLLoader is missing in handleGetContentResult() for ' + url);
 			};


Statistics.sum

Statistics.sum

--- raw/src/org/yellcorp/lib/core/Statistics.as
+++ raw/src/org/yellcorp/lib/core/Statistics.as
@@ -34,6 +34,26 @@
     public static function min(values:Array):Number
     {
         return Math.min.apply(Math, values);
+    }
+
+    /**
+     * Returns the sum of values in an Array.
+     *
+     * @param values An array or vector of Numbers, ints, or uints
+     * @return The sum.
+     */
+    public static function sum(values:*):Number
+    {
+        if (!values || values.length == 0)
+        {
+            return 0;
+        }
+        var acc:Number = values[0];
+        for (var i:int = 1; i < values.length; i++)
+        {
+            acc += values[i];
+        }
+        return acc;
     }

     /**


Add a sendKeepAlive method that just sends whitespace

--- src/org/jivesoftware/xiff/core/XMPPConnection.as
+++ src/org/jivesoftware/xiff/core/XMPPConnection.as
@@ -322,6 +322,13 @@
 			}
 		}

+		public function sendKeepAlive():void
+		{
+			if( isActive() ) {
+				sendXML(" ");
+			}
+		}
+
 		/**
 		 * Determines whether the connection with the server is currently active. (Not necessarily logged in.
 		 * For login status, use the isLoggedIn() method.)