Transferred from the Adobe Open Source Subversion Repository

Revision: 21680
Author:   jszeto@adobe.com
Date:     2011-07-21T21:56:22.533455Z

Log Message:
-----------
Item Snapping, SpinnerList and DateSpinner Initial checkin

Merging in changes from sandbox development branch

SpinnerList and DateSpinner are in usable states, but there is still unimplemented functionality.

QE notes: none
Doc notes: none
Bugs: none
Reviewer: Tom Kraikit, Eric Day, Jason Szeto
Tests run: checkintests, full cyclone
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/SpinnerListSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/DateSpinnerSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/DateAndTimeRangeList.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/.settings/org.eclipse.core.resources.prefs</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/SpinnerListScrollerSkin.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/ScrollSnappingMode.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/manifest.xml</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/CalendarDate.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/DateSelectorDisplayMode.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/layouts/TileLayout.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/.settings</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/SpinnerListContainerBackground.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile240/assets/SpinnerListContainerBackground.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/src/DateSpinnerTest-app.xml</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/effects/ThrowEffect.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile160/assets/SpinnerListContainerBackground.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SpinnerListContainer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/src/views</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/layouts/VerticalSpinnerLayout.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/src</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/.flexProperties</path>
<path kind="dir" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/libs</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/SpinnerListContainerSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/.actionScriptProperties</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/bundles/en_US/components.properties</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/supportClasses/TouchScrollHelper.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/TabbedViewNavigatorButtonBarFirstButton_down.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SpinnerList.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/src/DateSpinnerTest.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/src/blackberry-tablet.xml</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/src/views/DateSpinnerTestHomeView.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as</path>
<path kind="dir" action="M">/private/flex/sdk/branches/4.y</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/SpinnerListContainerSelectionIndicator.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile240/assets/SpinnerListContainerSelectionIndicator.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SpinnerListItemRenderer.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/.settings</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile160/assets/SpinnerListContainerSelectionIndicator.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/.project</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/SpinnerListContainerShadow.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile240/assets/SpinnerListContainerShadow.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile160/assets/SpinnerListContainerShadow.fxg</path>

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

--- frameworks/projects/mobilecomponents/src/spark/layouts/VerticalSpinnerLayout.as
+++ frameworks/projects/mobilecomponents/src/spark/layouts/VerticalSpinnerLayout.as
@@ -0,0 +1,503 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2011 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+package spark.layouts
+{
+import flash.events.Event;
+import flash.geom.Point;
+import flash.geom.Rectangle;
+
+import mx.core.ILayoutElement;
+import mx.core.mx_internal;
+
+import spark.components.supportClasses.GroupBase;
+import spark.core.NavigationUnit;
+
+use namespace mx_internal;
+
+[ExcludeClass]
+
+/**
+ *  Custom wrapping layout for the SpinnerList
+ */
+public class VerticalSpinnerLayout extends VerticalLayout
+{
+	public function VerticalSpinnerLayout()
+	{
+		super();
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Variables
+	//
+	//--------------------------------------------------------------------------
+
+	private function get totalHeight():Number
+	{
+		return Math.ceil(target.numElements * rowHeight);
+	}
+
+	// If true, then when the layout encounters a disabled element, it will scroll past it
+	// in ascending index order. If false, then it will scroll in the descending index order
+	mx_internal var autoScrollAscending:Boolean = true;
+
+	mx_internal static const FORCE_NO_WRAP_ELEMENTS_CHANGE:String = "forceNoWrapElementsChange";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties
+	//
+	//--------------------------------------------------------------------------
+
+	//----------------------------------
+	//  requestedWrapElements
+	//----------------------------------
+
+	private var _requestedWrapElements:Boolean = true;
+
+	/**
+	 *  This is the suggested value for wrapElements. However, the layout might not honor this value
+	 *  if there are too few elements to display in the viewable area.
+	 *
+	 *  @default true
+	 */
+	public function get requestedWrapElements():Boolean
+	{
+		return _requestedWrapElements;
+	}
+
+	public function set requestedWrapElements(value:Boolean):void
+	{
+		if (value == _requestedWrapElements)
+			return;
+
+		_requestedWrapElements = value;
+		target.invalidateSize();
+		target.invalidateDisplayList();
+	}
+
+	/**
+	 *  If true, the layout has forced wrapElements to be false
+	 */
+	public var forceNoWrapElements:Boolean = false;
+
+	//----------------------------------
+	//  wrapElements
+	//----------------------------------
+
+	/**
+	 *  When true, scrolling past the last element will scroll to the first element.
+	 *
+	 *  @default true
+	 */
+	public function get wrapElements():Boolean
+	{
+		if (forceNoWrapElements)
+			return false;
+		else
+			return requestedWrapElements;
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Overridden methods
+	//
+	//--------------------------------------------------------------------------
+
+	override public function measure():void
+	{
+		var preferredWidth:Number = 0;  // max of the elt preferred widths
+
+		var element:ILayoutElement;
+
+		var iter:LayoutIterator = new LayoutIterator(target);
+
+		if (useVirtualLayout)
+		{
+			if (typicalLayoutElement)
+				preferredWidth = typicalLayoutElement.getPreferredBoundsWidth();
+		}
+		else
+		{
+			while (iter.visitedElementCount < target.numElements)
+			{
+				element = iter.nextWrappedElement();
+
+				if (element)
+				{
+					// Get the largest width
+					preferredWidth = Math.max(Math.ceil(element.getPreferredBoundsWidth()), preferredWidth);
+				}
+			}
+		}
+
+		var rowsToMeasure:int = getRowsToMeasure(target.numElements);
+
+		// Calculate the height by multiplying the number of elements time the row height
+		target.measuredHeight = Math.ceil(rowsToMeasure * rowHeight);
+		target.measuredWidth = preferredWidth;
+	}
+
+    override public function updateDisplayList(width:Number, height:Number):void
+    {
+        var element:ILayoutElement;
+        var numElements:int = target.numElements;
+
+        var oldForceNoWrapElements:Boolean = forceNoWrapElements;
+
+        // If there are fewer elements than will fit, we need to set wrapElements = false
+        if (requestedWrapElements && (height > numElements * rowHeight))
+            forceNoWrapElements = true;
+        else
+            forceNoWrapElements = false;
+
+        if (forceNoWrapElements != oldForceNoWrapElements)
+            dispatchEvent(new Event(FORCE_NO_WRAP_ELEMENTS_CHANGE));
+
+        var scrollPosition:Number = wrapElements ?
+            normalizeScrollPosition(verticalScrollPosition) :
+            verticalScrollPosition;
+
+		// TODO (jszeto) Modify LayoutIterator to not require seeding w/ index - 1
+        var itemIndex:int = -1;
+        var yPos:Number = 0;
+        var numVisibleElements:int = 0;
+
+        // Translate the vsp to the item index
+        if (wrapElements)
+        {
+            itemIndex = Math.floor(scrollPosition / rowHeight) - 1;
+            // The top item might only be partially visible.
+            yPos = -(scrollPosition % rowHeight);
+        }
+        else
+        {
+            // If wrapElements == false, then start at the first index
+            yPos = -scrollPosition;
+        }
+
+        // Start at the top index
+        var iter:LayoutIterator = new LayoutIterator(target, itemIndex);
+
+        while (iter.visitedElementCount < numElements)
+        {
+            element = iter.nextWrappedElement();
+
+            element.setLayoutBoundsSize(width, rowHeight);
+            element.setLayoutBoundsPosition(0, yPos);
+
+            yPos += rowHeight;
+
+            // If we are using virtual layout, only size and position
+            // the visible elements
+            if (yPos > height && numVisibleElements != 0)
+            {
+				// Keep track of the number of elements visible in the viewing area
+                numVisibleElements = iter.visitedElementCount;
+                if (useVirtualLayout)
+                    break;
+            }
+        }
+
+        setRowCount(numVisibleElements);
+
+        // Set the contentWidth and contentHeight
+        target.setContentSize(target.width, Math.ceil(numElements * rowHeight));
+    }
+
+	override public function getElementBounds(index:int):Rectangle
+	{
+		return new Rectangle(0, index * rowHeight, target.measuredWidth, rowHeight);
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Overridden scroll methods
+	//
+	//--------------------------------------------------------------------------
+
+	override public function updateScrollRect(w:Number, h:Number):void
+	{
+		var g:GroupBase = target;
+		if (!g)
+			return;
+
+		// Instead of moving the scrollRect position, we reposition the elements
+		if (clipAndEnableScrolling)
+			g.scrollRect = new Rectangle(0, 0, w, h);
+		else
+			g.scrollRect = null;
+	}
+
+	override protected function scrollPositionChanged():void
+	{
+		if (target)
+		{
+			target.invalidateDisplayList();
+			setIndexInView(0, target.numElements - 1);
+		}
+	}
+
+	override public function getHorizontalScrollPositionDelta(navigationUnit:uint):Number
+	{
+		return 0;
+	}
+
+	override public function getVerticalScrollPositionDelta(navigationUnit:uint):Number
+	{
+		return 0;
+	}
+
+	override mx_internal function getElementNearestScrollPosition(
+		position:Point,elementComparePoint:String = "center"):int
+	{
+
+		var index:int = Math.floor(position.y / rowHeight); // may be larger than numElements to indicate wrapping
+
+		var element:ILayoutElement;
+		var currentIndex:int = index % target.numElements;
+
+		if (currentIndex < 0)
+			currentIndex += target.numElements;
+
+		// If the element at index % numElements) is not selectable, find the nearest one that is
+		var iter:LayoutIterator = new LayoutIterator(target, currentIndex - (autoScrollAscending ? 1 : -1));
+		while (iter.visitedElementCount < target.numElements)
+		{
+			if (autoScrollAscending)
+				element = iter.nextWrappedElement();
+			else
+				element = iter.prevWrappedElement();
+
+			try
+			{
+				if (!element || element["enabled"] == undefined || element["enabled"] == true)
+					break;
+			}
+			catch (e:Error)
+			{
+
+			}
+
+			if (autoScrollAscending)
+				index++;
+			else
+				index--;
+		}
+
+
+		// If we don't allow wrapping, then cap the max index
+		if(!wrapElements)
+			index = Math.max(0, Math.min(index, target.numElements - 1));
+
+		return index;
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Methods
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Returns the index of the element intersected by the vertical center of the viewable area
+	 */
+	public function getIndexAtVerticalCenter():int
+	{
+        var midY:Number = target.getLayoutBoundsHeight() / 2;
+		var vsp:Number = wrapElements ? normalizeScrollPosition(verticalScrollPosition + midY) : verticalScrollPosition + midY;
+
+		return getElementNearestScrollPosition(new Point(0, vsp), "center");
+	}
+
+	/**
+	 *  Takes an index between 0 and numElements and returns the index taking wrapping into account
+	 */
+	public function getUnwrappedElementIndex(index:int):int
+	{
+		// find the non-wrapped (i.e. non-modulo) index of the element on screen
+		if (wrapElements)
+		{
+			var wrapCount:int = Math.floor(verticalScrollPosition / totalHeight);
+			index += wrapCount * target.numElements;
+
+			var firstVisibleItem:int = (verticalScrollPosition ) / rowHeight;
+			if (index < firstVisibleItem)
+				index += target.numElements;
+		}
+
+		return index;
+	}
+
+	// Helper function to calculate the non-wrapped, non-negative scroll position
+	private function normalizeScrollPosition(vsp:int):int
+	{
+		// Normalize the scrollPosition
+ 		if (!isNaN(totalHeight))
+		{
+			vsp %= totalHeight;
+
+			if (vsp < 0)
+				vsp += totalHeight;
+		}
+
+		return vsp;
+	}
+}
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Helper class: LayoutIterator
+//
+////////////////////////////////////////////////////////////////////////////////
+
+import mx.core.ILayoutElement;
+
+import spark.components.supportClasses.GroupBase;
+
+/**
+ *  Layout helper class. Iterates over a set of items. The iterator can optionally wrap around the
+ *  end of the set back to the beginning of the set.
+ */
+class LayoutIterator
+{
+	/**
+	 *  Constructor. Takes a layout target and the starting index for the iterator
+	 *
+	 *  @param target The GroupBase target that contains the elements
+	 *  @param index The starting index for the iterator
+	 */
+	public function LayoutIterator(target:GroupBase, index:int = -1):void
+	{
+		totalElements = target.numElements;
+		_target = target;
+		_curIndex = index;
+		_useVirtual = _target.layout.useVirtualLayout;
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Variables
+	//
+	//--------------------------------------------------------------------------
+
+	private var _curIndex:int;
+	private var _loopIndex:int = -1;
+	private var _visitedElementCount:int = 0;
+	private var _target:GroupBase;
+	private var _useVirtual:Boolean;
+	private var totalElements:int;
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Returns the index that the iterator is currently pointing
+	 */
+	public function get currentIndex():int
+	{
+		return _curIndex;
+	}
+
+	/**
+	 *  The number of elements the iterator has visited
+	 */
+	public function get visitedElementCount():int
+	{
+		return _visitedElementCount;
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Methods
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Returns the element after the currentIndex. Returns null if the current index
+	 *  is the last element.
+	 */
+	public function nextElement():ILayoutElement
+	{
+		while (_curIndex < totalElements - 1)
+		{
+			var el:ILayoutElement = _useVirtual ? _target.getVirtualElementAt(++_curIndex) :
+				_target.getElementAt(++_curIndex);
+			if (el && el.includeInLayout)
+			{
+				++_visitedElementCount;
+				return el;
+			}
+		}
+		return null;
+	}
+
+	/**
+	 *  Returns the element before the currentIndex. Returns null if the current index
+	 *  is the first element.
+	 */
+	public function prevElement():ILayoutElement
+	{
+		while (_curIndex > 0)
+		{
+			var el:ILayoutElement = _useVirtual ? _target.getVirtualElementAt(--_curIndex) :
+				_target.getElementAt(--_curIndex);
+			if (el && el.includeInLayout)
+			{
+				++_visitedElementCount;
+				return el;
+			}
+		}
+		return null;
+	}
+
+	/**
+	 *  Returns the element after the currentIndex. Returns the first element if the current index
+	 *  is the last element.
+	 */
+	public function nextWrappedElement():ILayoutElement
+	{
+		if (_loopIndex == -1)
+			_loopIndex = _curIndex;
+		else if (_loopIndex == _curIndex)
+			return null;
+
+		var el:ILayoutElement = nextElement();
+		if (el)
+			return el;
+		else if (_curIndex == totalElements - 1)
+			_curIndex = -1;
+		return nextElement();
+	}
+
+	/**
+	 *  Returns the element before the currentIndex. Returns the last element if the current index
+	 *  is the first element.
+	 */
+	public function prevWrappedElement():ILayoutElement
+	{
+		if (_loopIndex == -1)
+			_loopIndex = _curIndex;
+		else if (_loopIndex == _curIndex)
+			return null;
+
+		var el:ILayoutElement = prevElement();
+		if (el)
+			return el;
+		else if (_curIndex == 0)
+			_curIndex = totalElements;
+		return prevElement();
+	}
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 3220
Author:   smgilson@adobe.com
Date:     2008-09-16T13:04:06.258509Z

Log Message:
-----------
Clean up some ASDoc comments to remove the '&' character

Checkin Test Passed: Yes
QA: No
Bug:
Doc: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/Path.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/LayoutItemFDO.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/graphicsClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/intf/ILayoutItem.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/TransformUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/LayoutItemUIC.as</path>

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

--- frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
@@ -1299,23 +1299,23 @@
             // the matrix itself.
             if (TransformUtil.isDeltaIdentity(_matrix))
             {
-            	if (_matrix.tx != _x)
-            	{
-	            	_x = _matrix.tx;
-	            	xChanged = true;
-            	}
-
-            	if (_matrix.ty != _y)
-            	{
-            		_y = _matrix.ty;
-            		yChanged = true;
-            	}
-
-            	_matrix = null;
+                if (_matrix.tx != _x)
+                {
+                    _x = _matrix.tx;
+                    xChanged = true;
+                }
+
+                if (_matrix.ty != _y)
+                {
+                    _y = _matrix.ty;
+                    yChanged = true;
+                }
+
+                _matrix = null;
             }
             else
             {
-            	matrixChanged = true;
+                matrixChanged = true;
             }

             clearTransformProperties();
@@ -1741,8 +1741,8 @@
      */
     protected function get drawX():Number
     {
-    	// Draw position depends upon which coordinate space we are located in.
-    	// TODO!!! We need to apply all of the transforms of our ancestors
+        // Draw position depends upon which coordinate space we are located in.
+        // TODO!!! We need to apply all of the transforms of our ancestors
         return displayObject ? 0 : sharedDisplayObject && sharedDisplayObject != elementHost ? x - sharedDisplayObject.x : x;
     }

@@ -1755,8 +1755,8 @@
      */
     protected function get drawY():Number
     {
-    	// Draw position depends upon which coordinate space we are located in.
-    	// TODO!!! We need to apply all of the transforms of our ancestors
+        // Draw position depends upon which coordinate space we are located in.
+        // TODO!!! We need to apply all of the transforms of our ancestors
         return displayObject ? 0 : sharedDisplayObject && sharedDisplayObject != elementHost ? y - sharedDisplayObject.y : y;
     }

@@ -1874,13 +1874,13 @@

     public function destroyDisplayObject():void
     {
-    	// TODO!! Figure out what cleanup to do
-    	if (displayObject)
-    	{
-	    	if (displayObject.parent)
-				displayObject.parent.removeChild(displayObject);
-			displayObject = null;
-    	}
+        // TODO!! Figure out what cleanup to do
+        if (displayObject)
+        {
+            if (displayObject.parent)
+                displayObject.parent.removeChild(displayObject);
+            displayObject = null;
+        }
     }

     /**
@@ -1888,40 +1888,40 @@
      */
     public function get needsDisplayObject():Boolean
     {
-    	if ((_filters && _filters.length > 0) ||
-    		_blendMode != BlendMode.NORMAL || _mask ||
-    		_scaleX != 1 || _scaleY != 1 ||
-    		_rotation != 0 || _alpha != 1 || _transform ||
-    		_transformX != 0 || _transformY != 0)
-    	{
-			return true;
-    	}
-    	else
-    		return false;
+        if ((_filters && _filters.length > 0) ||
+            _blendMode != BlendMode.NORMAL || _mask ||
+            _scaleX != 1 || _scaleY != 1 ||
+            _rotation != 0 || _alpha != 1 || _transform ||
+            _transformX != 0 || _transformY != 0)
+        {
+            return true;
+        }
+        else
+            return false;
     }

     public function get nextSiblingNeedsDisplayObject():Boolean
     {
-    	// TODO: The displayObject && visible test is a quick fix for MXMLG-228.
-    	// Should investigate a better solution.
-    	return needsDisplayObject || (displayObject && visible == false);
+        // TODO: The displayObject && visible test is a quick fix for MXMLG-228.
+        // Should investigate a better solution.
+        return needsDisplayObject || (displayObject && visible == false);
     }

     private var _sharedDisplayObject:DisplayObject;

     public function set sharedDisplayObject(value:DisplayObject):void
     {
-    	_sharedDisplayObject = value;
+        _sharedDisplayObject = value;
     }

     public function get sharedDisplayObject():DisplayObject
     {
-    	return _sharedDisplayObject;
+        return _sharedDisplayObject;
     }

     protected function get drawnDisplayObject():DisplayObject
     {
-    	return displayObject ? displayObject : sharedDisplayObject;
+        return displayObject ? displayObject : sharedDisplayObject;
     }

     /**
@@ -1938,20 +1938,20 @@

         setActualPosition(0, 0);
         if (displayObject && nextSiblingNeedsDisplayObject)
-        	bitmapData.draw(displayObject, displayObject.transform.matrix);
-		else
-		{
-			var oldDisplayObject:DisplayObject = displayObject;
-			displayObject = new Sprite();
-			invalidateDisplayList();
-			validateDisplayList();
-
-			bitmapData.draw(displayObject);
-
-			displayObject = oldDisplayObject;
-
-		}
-
+            bitmapData.draw(displayObject, displayObject.transform.matrix);
+        else
+        {
+            var oldDisplayObject:DisplayObject = displayObject;
+            displayObject = new Sprite();
+            invalidateDisplayList();
+            validateDisplayList();
+
+            bitmapData.draw(displayObject);
+
+            displayObject = oldDisplayObject;
+
+        }
+
         setActualPosition(oldPos.x, oldPos.y);

         return bitmapData;
@@ -2172,7 +2172,7 @@
      */
     protected function commitProperties():void
     {
-    	//trace("GraphicElement.commitProperties displayObject",displayObject,"this",this);
+        //trace("GraphicElement.commitProperties displayObject",displayObject,"this",this);
         if (displayObject)
         {
             if (alphaChanged)
@@ -2235,14 +2235,14 @@
         }
         else
         {
-        	if (visibleChanged)
-        	{
-        		visibleChanged = false;
-
-        		// If we're sharing a display list, we need to force a redraw
-        		// to change visibility.
-        		invalidateDisplayList();
-        	}
+            if (visibleChanged)
+            {
+                visibleChanged = false;
+
+                // If we're sharing a display list, we need to force a redraw
+                // to change visibility.
+                invalidateDisplayList();
+            }
         }
     }

@@ -2362,15 +2362,15 @@
      */
     public function validateDisplayList():void
     {
-    	// TODO!!! Turn this off for now because we need to clear all of the DisplayObject
-    	// graphics and thus need to redraw each graphic element
-    	// Put this back in once we implement drawingAPI2
+        // TODO!!! Turn this off for now because we need to clear all of the DisplayObject
+        // graphics and thus need to redraw each graphic element
+        // Put this back in once we implement drawingAPI2
         /* if (!invalidateDisplayListFlag)
             return; */
         invalidateDisplayListFlag = false;

-		if (visible)
-        	updateDisplayList(_width, _height);
+        if (visible)
+            updateDisplayList(_width, _height);

         // If we aren't doing any more invalidation, send out an UpdateComplete event
         if (!invalidatePropertiesFlag && !invalidateSizeFlag && !invalidateDisplayListFlag)
@@ -2483,7 +2483,7 @@
      */
     public function setActualPosition(x:Number, y:Number):void
     {
-    	//trace("GraphicElement.setActualPosition x",x,"y",y,"this",this);
+        //trace("GraphicElement.setActualPosition x",x,"y",y,"this",this);
         x -= measuredX;
         y -= measuredY;

@@ -2512,20 +2512,20 @@
         var changed:Boolean = false;
         if (_x != x)
         {
-        	_x = x;
-        	changed = true;
+            _x = x;
+            changed = true;
         }

         if (_y != y)
         {
-        	_y = y;
-        	changed = true;
+            _y = y;
+            changed = true;
         }

         if (displayObject)
-        	commitXY();
+            commitXY();
         else if (changed)
-        	invalidateDisplayList();
+            invalidateDisplayList();
     }

     /**
@@ -2536,7 +2536,7 @@
      *  If one of the desired TBounds dimensions is left unspecified, it's size
      *  will be picked such that item can be optimally sized to fit the other
      *  TBounds dimension. This is useful when the layout doesn't want to
-     *  overconstrain the item in cases where the item TBounds width & height
+     *  overconstrain the item in cases where the item TBounds width and height
      *  are dependent (text, components with complex transforms, etc.)
      *
      *  If both TBounds dimensions are left unspecified, the item will have its
@@ -2654,7 +2654,7 @@

         beginCommitTransformProps();

-		/*
+        /*
         TransformUtil.applyTransforms(displayObject, null, _x, _y);
         _x = displayObject.x;
         _y = displayObject.y;
@@ -2691,14 +2691,14 @@
         _scaleY = displayObject.scaleY;
         _rotation = displayObject.rotation;

-		// Pull the x and y backing vars only if we have a matrix.
+        // Pull the x and y backing vars only if we have a matrix.
         if (_matrix)
         {
             _x = displayObject.x;
             _y = displayObject.y;
         }
-
-		matrixChanged = false;
+
+        matrixChanged = false;
         scaleXChanged = false;
         scaleYChanged = false;
         rotationChanged = false;


Transferred from the Adobe Open Source Subversion Repository

Revision: 12859
Author:   jszeto@adobe.com
Date:     2009-12-11T19:57:39.056525Z

Log Message:
-----------
Masking bugs

SDK-24646 - Masking element on RIchText should inherit the target group's coordinate space
SDK-24559 - Using a mask with RichText doesn't work if you are using an MX Application

Fixed masking in RichText. The mask was not properly parented. Since we don't need to fake the parenting chain, we pass a null parent to MaskUtil.applyMask

Removed mask.parent check from MaskUtil.applyMask. It doesn't need this check.

Restored the mask initialization order in GraphicElement. Moved the addChild call back before the MaskUtil.applyMatirx call.

Updated GroupBase to call MaskUtil.applyMask.

QE notes: None
Doc notes: None
Bugs: SDK-24646, SDK-24559
Reviewer: Ryan
Tests run: checkintests, group, primitives
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/utils/MaskUtil.as</path>

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

--- frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
@@ -3551,11 +3551,9 @@
                     // and maskee to displayObject.
                     if (!_mask.parent)
                     {
+                        Sprite(displayObject).addChild(_mask);
+
                         MaskUtil.applyMask(_mask, parent);
-
-                        // Parent after applying the mask since it won't do
-                        // anything if there is a parent.
-                        Sprite(displayObject).addChild(_mask);

                         if (!_drawnDisplayObject)
                         {


Transferred from the Adobe Open Source Subversion Repository

Revision: 19635
Author:   aharui@adobe.com
Date:     2011-01-07T00:25:18.039632Z

Log Message:
-----------
revert the layout changes from svn 18635.  Management feels that there isn't enough time to thoroughly test the changes.

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/TileLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/layoutClasses/PriorityQueue.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ScrollerLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/core/Application.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorApplicationSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/SkinnableContainerSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichEditableText.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/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/primitives/BitmapImage.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/BasicLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/IconItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Group.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/PopUpAnchor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/supportClasses/LinearLayoutVector.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/FlexEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/airspark/src/spark/components/Window.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/core/SpriteVisualElement.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/IContainerInvalidating.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DefaultItemRenderer.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/ILayoutManagerContainerClient.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.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/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorApplicationSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/styles/IStyleManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/ILayoutElement.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TextAreaSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/airframework/src/mx/core/Window.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/TextFieldGridItemRendererInclude.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/core/Container.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/LayoutManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Application.as</path>

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

--- frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
@@ -578,68 +578,6 @@

         _bottom = value;
         invalidateParentSizeAndDisplayList();
-    }
-
-    //----------------------------------
-    //  estimatedHeight
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the estimatedHeight property.
-     */
-    private var _estimatedHeight:Number;
-
-    /**
-     *  The height a component is likely to be given at layout time.  It is
-     *  determined by examining the parent's estimatedHeight, and the
-     *  component's percentHeight, explicitHeight, top and bottom constraints.
-     *  It is NaN if there isn't enough information to compute the height.
-     *  The component can use this information in calculating its
-     *  measuredWidth if the measuredWidth is dependent on the layout
-     *  height.
-     *
-     *  @default NaN
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.0
-     *  @productversion Flex 4.5
-     */
-    public function get estimatedHeight():Number
-    {
-        return _estimatedHeight;
-    }
-
-    //----------------------------------
-    //  estimatedWidth
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the estimatedWidth property.
-     */
-    private var _estimatedWidth:Number;
-
-    /**
-     *  The width a component is likely to be given at layout time.  It is
-     *  determined by examining the parent's estimatedWidth, and the
-     *  component's percentWidth, explicitWidth, left and right constraints.
-     *  It is NaN if there isn't enough information to compute the width.
-     *  The component can use this information in calculating its
-     *  measuredHeight if the measuredHeight is dependent on the layout
-     *  width.
-     *
-     *  @default NaN
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.0
-     *  @productversion Flex 4.5
-     */
-    public function get estimatedWidth():Number
-    {
-        return _estimatedWidth;
     }

     //----------------------------------
@@ -4410,22 +4348,6 @@
      *  @inheritDoc
      *
      *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.0
-     *  @productversion Flex 4.5
-     */
-    public function setEstimatedSize(estimatedWidth:Number = NaN,
-                                     estimatedHeight:Number = NaN,
-                                     invalidateSize:Boolean = true):void
-    {
-        _estimatedWidth = estimatedWidth;
-        _estimatedHeight = estimatedHeight;
-    }
-
-    /**
-     *  @inheritDoc
-     *
-     *  @langversion 3.0
      *  @playerversion Flash 10
      *  @playerversion AIR 1.5
      *  @productversion Flex 4


added support for specifying interfaces as strings in Weave.registerClass()

--- WeaveJS/src/Weave.as
+++ WeaveJS/src/Weave.as
@@ -429,9 +429,17 @@
 		 */
 		public static function registerClass(qualifiedName:String, definition:Class, additionalInterfaces:Array = null):void
 		{
-			if (!additionalInterfaces)
-				additionalInterfaces = [];
-			WeaveAPI.ClassRegistry.registerClass(qualifiedName, definition, [ILinkableObject].concat(additionalInterfaces));
+			var interfaces:Array = [ILinkableObject];
+			for each (var item:* in additionalInterfaces)
+			{
+				var classDef:Class = item as Class;
+				if (item is String)
+					classDef = getDefinition(item);
+				if (!classDef)
+					throw new Error("Interface not found: " + item);
+				interfaces.push(classDef);
+			}
+			WeaveAPI.ClassRegistry.registerClass(qualifiedName, definition, interfaces);
 		}

 		/**


indentation

indentation

--- src/org/mangui/hls/HLSSettings.as
+++ src/org/mangui/hls/HLSSettings.as
@@ -277,14 +277,14 @@

 		/**
 		 * manifestRedundantLoadmaxRetry
-		 *
+		 *
 		 * max nb of looping over the redundant streams.
 		 *   >0  means looping over the stream array 2 or more times
 		 *    0  means looping exactly once (no retries) - default behaviour
 		 *   -1  means infinite retry
 		 */
 		public static var manifestRedundantLoadmaxRetry : int = 3;
-
+
         /**
          * startFromBitrate
          *


Signal now uses const instead of var, where possible.

--- src/org/osflash/signals/Signal.as
+++ src/org/osflash/signals/Signal.as
@@ -88,7 +88,7 @@
 		/** @inheritDoc */
 		public function remove(listener:Function):Function
 		{
-			var index:int = listeners.indexOf(listener);
+			const index:int = listeners.indexOf(listener);
 			if (index == -1) return listener;
 			if (listenersNeedCloning)
 			{
@@ -116,7 +116,7 @@
 			// Validate value objects against pre-defined value classes.
 			var valueObject:Object;
 			var valueClass:Class;
-			var numValueClasses:int = _valueClasses.length;
+			const numValueClasses:uint = _valueClasses.length;
 			if (valueObjects.length < numValueClasses)
 			{
 				throw new ArgumentError('Incorrect number of arguments. Expected at least ' + numValueClasses + ' but received ' + valueObjects.length + '.');
@@ -151,10 +151,11 @@
 					break;

 				case 1:
+					const singleValue:Object = valueObjects[0];
 					for each (listener in listeners)
 					{
 						if (onceListeners[listener]) remove(listener);
-						listener(valueObjects[0]);
+						listener(singleValue);
 					}
 					break;

@@ -173,7 +174,7 @@
 			// function.length is the number of arguments.
 			if (listener.length < _valueClasses.length)
 			{
-				var argumentString:String = (listener.length == 1) ? 'argument' : 'arguments';
+				const argumentString:String = (listener.length == 1) ? 'argument' : 'arguments';
 				throw new ArgumentError('Listener has '+listener.length+' '+argumentString+' but it needs at least '+_valueClasses.length+' to match the given value classes.');
 			}


UPDATED configuration API to comply with native SDK API

--- actionscript/src/com/marpies/ane/facebook/accountkit/AKConfiguration.as
+++ actionscript/src/com/marpies/ane/facebook/accountkit/AKConfiguration.as
@@ -9,6 +9,7 @@
         private var mInitialAuthState:String;
         private var mInitialEmail:String;
         private var mDefaultCountryCode:String;
+        private var mPhoneNumberCountryCode:String;
         private var mInitialPhoneNumber:String;
         private var mEnableFacebookNotification:Boolean;
         private var mTitleType:String;
@@ -101,10 +102,21 @@
         }

         /**
-         * @private
-         */
-        public function set initialPhoneNumber( value:String ):void {
-            mInitialPhoneNumber = value;
+         * Initial phone number's country code.
+         */
+        public function get initialPhoneNumberCountryCode():String {
+            return mPhoneNumberCountryCode;
+        }
+
+        /**
+         * Pre-fill the user's phone number in the SMS login flow.
+         */
+        public function setInitialPhoneNumber( countryCode:String, phoneNumber:String ):void {
+            if( countryCode === null ) throw new ArgumentError( "Parameter countryCode cannot be null." );
+            if( phoneNumber === null ) throw new ArgumentError( "Parameter phoneNumber cannot be null." );
+
+            mPhoneNumberCountryCode = countryCode;
+            mInitialPhoneNumber = phoneNumber;
         }

         /**


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

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

 package spark.components.supportClasses
 {


Formatting and preparation for XML.

Formatting and preparation for XML.

git-svn-id: c197267f952b24206666de142881703007ca05d5@11289 b35dd754-fafc-0310-a699-88a17e54d16e

--- src/org/igniterealtime/xiff/vcard/VCard.as
+++ src/org/igniterealtime/xiff/vcard/VCard.as
@@ -1,20 +1,20 @@
 /*
  * Copyright (C) 2003-2009 Igniterealtime Community Contributors
- *
+ *
  *     Daniel Henninger
  *     Derrick Grigg <dgrigg@rogers.com>
  *     Juga Paazmaya <olavic@gmail.com>
  *     Nick Velloff <nick.velloff@gmail.com>
  *     Sean Treadway <seant@oncotype.dk>
  *     Sean Voisen <sean@voisen.org>
- *
- *
+ *
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
+ *
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -29,6 +29,7 @@
 	import flash.utils.Timer;

 	import mx.utils.Base64Decoder;
+
 	//import com.hurlant.util.Base64;

 	import org.igniterealtime.xiff.core.UnescapedJID;
@@ -87,6 +88,12 @@
 		 *
 		 * @default
 		 */
+		public var birthDay:Date;
+
+		/**
+		 *
+		 * @default
+		 */
 		public var company:String;

 		/**
@@ -117,6 +124,12 @@
 		 *
 		 * @default
 		 */
+		public var gender:String;
+
+		/**
+		 *
+		 * @default
+		 */
 		public var homeAddress:String;

 		/**
@@ -189,18 +202,42 @@
 		 *
 		 * @default
 		 */
+		public var maritalStatus:String;
+
+		/**
+		 *
+		 * @default
+		 */
 		public var middleName:String;

 		/**
 		 *
 		 * @default
 		 */
+		public var namePrefix:String;
+
+		/**
+		 *
+		 * @default
+		 */
+		public var nameSuffix:String;
+
+		/**
+		 *
+		 * @default
+		 */
 		public var nickname:String;

 		/**
 		 *
 		 * @default
 		 */
+		public var otherName:String;
+
+		/**
+		 *
+		 * @default
+		 */
 		public var title:String;

 		/**
@@ -213,7 +250,7 @@
 		 * Version of the VCard. Usually 2.0 or 3.0.
 		 */
 		public var version:Number;
-
+
 		/**
 		 *
 		 * @default
@@ -267,17 +304,6 @@
 		 * @default
 		 */
 		public var workVoiceNumber:String;
-
-
-
-		public var otherName:String;
-		public var namePrefix:String;
-		public var nameSuffix:String;
-		public var birthDay:Date;
-		public var gender:String;
-		public var maritalStatus:String;
-
-

 		/**
 		 *
@@ -302,9 +328,9 @@
 		 */
 		public function VCard()
 		{
-
+
 		}
-
+
 		/**
 		 * Seems to be the way a vcard is requested and then later referred to:
 		 * var vCard:VCard = VCard.getVCard(_connection, item);

@@ -326,7 +352,7 @@
 						{
 							pushRequest( con, vcard );
 						}
-					});
+					} );
 			}

 			var jidString:String = user.jid.toString();
@@ -356,7 +382,7 @@
 				requestTimer = new Timer( 1, 1 );
 				requestTimer.addEventListener( TimerEvent.TIMER_COMPLETE, sendRequest );
 			}
-			requestQueue.push({ connection: con, card: vcard });
+			requestQueue.push( { connection: con, card: vcard } );
 			requestTimer.reset();
 			requestTimer.start();
 		}
@@ -379,7 +405,7 @@

 			iq.callbackName = "handleVCard";
 			iq.callbackScope = vcard;
-			iq.addExtension( new VCardExtension());
+			iq.addExtension( new VCardExtension() );

 			con.send( iq );
 			requestTimer.reset();
@@ -394,7 +420,7 @@
 		{
 			if ( resultIQ.type == IQ.TYPE_ERROR )
 			{
-				dispatchEvent( new VCardEvent( VCardEvent.ERROR, cache[ resultIQ.to.unescaped.toString()],
+				dispatchEvent( new VCardEvent( VCardEvent.ERROR, cache[ resultIQ.to.unescaped.toString() ],
 											   true, true ) );
 			}
 			else
@@ -423,11 +449,13 @@

 			var node:XML = XML(iq.getNode());
 			var vCardNode:XML = node.children()[ 0 ];
+
+			//var vCardNode:XML = iq.node.children()[ 0 ];
 			if ( !vCardNode )
 				return;
-
-			version = Number(vCardNode.@version);
-
+
+			version = Number( vCardNode.@version );
+
 			var nodes:XMLList = vCardNode.children();

 			for each ( var child:XML in nodes )
@@ -438,13 +466,13 @@
 						for each ( var photo:XML in child.children() )
 						{
 							var value:String = photo.text();
-
+
 							if (photo.localName() == "BINVAL" && value.length > 0 )
 							{
 								var decoder:Base64Decoder = new Base64Decoder();
 								decoder.decode( value );
 								_imageBytes = decoder.flush();
-
+
 								//_imageBytes = Base64.decodeToByteArray( value );
 								dispatchEvent( new VCardEvent( VCardEvent.AVATAR_LOADED,
 															   this, true, false ) );
@@ -474,24 +502,24 @@
 						{
 							if ( emailChild.localName() == "USERID" )
 							{
-								email = emailChild.children()[0];
+								email = emailChild.children()[ 0 ];
 							}
 						}
 						break;
-
+
 					case "ORG":
 						company = child.ORGNAME;
 						department = child.ORGUNIT;
 						break;
-
+
 					case "TITLE":
 						title = child.text();
 						break;
-
+
 					case "URL":
 						url = child.text();
 						break;
-
+
 					case "ADR":
 						if ( child.WORK.length() == 1 )
 						{
@@ -510,7 +538,7 @@
 							homeCity = child.LOCALITY;
 						}
 						break;
-
+
 					case "TEL":
 						if ( child.WORK.length() == 1 )
 						{
@@ -523,7 +551,7 @@
 							else if ( child.CELL.length() == 1 )
 								workCellNumber = child.NUMBER;
 						}
-						else if ( child.HOME.length() == 1  )
+						else if ( child.HOME.length() == 1 )
 						{
 							if ( child.VOICE.length() == 1 )
 								homeVoiceNumber = child.NUMBER;
@@ -531,56 +559,57 @@
 								homeFaxNumber = child.NUMBER;
 							else if ( child.PAGER.length() == 1 )
 								homePagerNumber = child.NUMBER;
-							else if ( child.CELL.length() == 1  )
+							else if ( child.CELL.length() == 1 )
 								homeCellNumber = child.NUMBER;
 						}
 						break;
-
+
 					case "DESC":
 						break;
-
+
 					case "GENDER":
 						gender = child.text();
 						break;
-
+
 					case "BDAY":
 						var bday:String = child.children()[ 0 ];
-						if (bday != null && bday.length > 8)
+						if ( bday != null && bday.length > 8 )
 						{
-							var dateParts:Array = bday.split("-");
-							birthDay = new Date(dateParts[0], int(dateParts[1]) - 1, dateParts[2]);
+							var dateParts:Array = bday.split( "-" );
+							birthDay = new Date( dateParts[ 0 ], int( dateParts[ 1 ] ) -
+												 1, dateParts[ 2 ] );
 						}
 						break;
-
+
 					case "JABBERID":
 						var jabberid:String = child.text();
-						if (jabberid != null && jabberid.length > 0)
+						if ( jabberid != null && jabberid.length > 0 )
 						{
 							jid = new UnescapedJID( jabberid );
 						}
 						break;
-
+
 					case "ROLE":
 						break;
-
+
 					case "HOMECELL":
 						break;
-
+
 					case "WORKCELL":
 						break;
-
+
 					case "LOCATION":
 						break;
-
+
 					case "MARITALSTATUS":
 						maritalStatus = child.text();
 						break;
-
+
 					case "AGE":
 						break;
-
+
 					default:
-						trace("handleVCard. unhandled case child.name(): " + child.name());
+						trace( "handleVCard. unhandled case child.name(): " + child.name() );
 						break;
 				}
 			}
@@ -600,6 +629,7 @@
 								null, this, _vCardSent );
 			var vcardExt:VCardExtension = new VCardExtension();
 			var vcardExtNode:XML = vcardExt.getNode() as XML;
+			//var vcardExtNode:XML = vcardExt.node;

 			if ( firstName || middleName || lastName )
 			{
@@ -685,15 +715,17 @@

 			if ( birthDay )
 			{
-				var month:Number = (birthDay.getMonth() + 1);
-				vcardExtNode.BDAY = birthDay.getFullYear() + "-" + (month < 10 ? "0" + month : month) + "-" + birthDay.getDate();
-			}
-
+				var month:uint = ( birthDay.getMonth() + 1 );
+				vcardExtNode.BDAY = birthDay.getFullYear() + "-"
+					+ ( month < 10 ? "0" + month : month ) + "-"
+					+ birthDay.getDate();
+			}
+
 			if ( gender )
 			{
 				vcardExtNode.GENDER = gender;
 			}
-
+
 			if ( maritalStatus )
 			{
 				vcardExtNode.MARITALSTATUS = maritalStatus;


- bugfix: Tab focus changing events are fired twice for one press in some playerversions under IE (at least 9.0.115 and 9.0.124), causing focus to move two input elements further. This has been fixed by muting one of the events

git-svn-id: e38e7cdd6ace00d8230583a2d3b43e9a55f5c011@572 bc4816be-ef27-423a-9c4d-fc420be121a2

--- src/reprise/ui/DocumentView.as
+++ src/reprise/ui/DocumentView.as
@@ -75,6 +75,7 @@
 		protected var m_stageInvalidationTimeout : int;

 		protected var m_focus:UIObject;
+		protected var m_lastTabPress : int;

 		protected var m_debuggingMode : Boolean;
 		protected var m_currentDebugElement : UIComponent;
@@ -470,8 +471,14 @@

 		protected function stage_keyFocusChange(e:FocusEvent):void
 		{
-	        if (e.keyCode == Keyboard.TAB && !e.isDefaultPrevented())
-	        {
+			if (e.keyCode == Keyboard.TAB && !e.isDefaultPrevented())
+			{
+				if (getTimer() - m_lastTabPress < 15)
+				{
+					e.preventDefault();
+					return;
+				}
+				m_lastTabPress = getTimer();
 				var focusView:UIObject;
 				if (e.shiftKey)
 				{


remove idle timer instanciation

remove idle timer instanciation

--- src/com/google/analytics/GATracker.as
+++ src/com/google/analytics/GATracker.as
@@ -24,7 +24,6 @@
     import com.google.analytics.core.Ecommerce;
     import com.google.analytics.core.EventTracker;
     import com.google.analytics.core.GIFRequest;
-    import com.google.analytics.core.IdleTimer;
     import com.google.analytics.core.ServerOperationMode;
     import com.google.analytics.core.TrackerCache;
     import com.google.analytics.core.TrackerMode;
@@ -76,7 +75,6 @@
         private var _jsproxy:JavascriptProxy;
         private var _dom:HTMLDOM;
         private var _adSense:AdSenseGlobals;
-        private var _idleTimer:IdleTimer;
         private var _ecom:Ecommerce;

         //object properties
@@ -203,7 +201,6 @@

             _buffer     = new Buffer( config, debug, false );
             _gifRequest = new GIFRequest( config, debug, _buffer, _env );
-            _idleTimer  = new IdleTimer( config, debug, _display, _buffer );
             _ecom       = new Ecommerce ( _debug );

             /* note:


add DataProvider.unwatchProperty() protected method to unwatch a property and refactor other methods to use it

--- src/aerys/minko/type/binding/DataProvider.as
+++ src/aerys/minko/type/binding/DataProvider.as
@@ -115,24 +115,19 @@
 		public function setProperty(name : String, newValue : Object) : DataProvider
 		{
 			var oldValue 			: Object			= _nameToProperty[name];
-			var oldMonitoredValue	: IWatchable		= oldValue as IWatchable;
-			var newMonitoredValue	: IWatchable		= newValue as IWatchable;
-			var oldPropertyNames	: Vector.<String>	= _propertyToNames[oldMonitoredValue];
-			var newPropertyNames	: Vector.<String>	= _propertyToNames[newMonitoredValue];
-
-			if (oldMonitoredValue != null)
-			{
-				if (oldPropertyNames.length == 1)
-				{
-					oldMonitoredValue.changed.remove(propertyChangedHandler);
-					delete _propertyToNames[oldMonitoredValue];
-				}
-				else
-					oldPropertyNames.splice(oldPropertyNames.indexOf(name), 1);
-			}
-
-			if (newMonitoredValue != null)
-				watchProperty(name, newMonitoredValue);
+			var oldWatchedValue	    : IWatchable		= oldValue as IWatchable;
+			var newWatchedValue	    : IWatchable		= newValue as IWatchable;
+			var oldPropertyNames	: Vector.<String>	= _propertyToNames[oldWatchedValue];
+			var newPropertyNames	: Vector.<String>	= _propertyToNames[newWatchedValue];
+
+            if (newWatchedValue != oldWatchedValue)
+            {
+    			if (oldWatchedValue != null)
+    			    unwatchProperty(name, oldWatchedValue);
+
+    			if (newWatchedValue != null)
+    				watchProperty(name, newWatchedValue);
+            }

 			var propertyAdded : Boolean = !_descriptor.hasOwnProperty(name);

@@ -170,6 +165,24 @@
 					newPropertyNames.push(name);
 			}
 		}
+
+        protected function unwatchProperty(name : String, property : IWatchable) : void
+        {
+            var oldPropertyNames	: Vector.<String>	= _propertyToNames[property];
+
+            if (oldPropertyNames.length == 1)
+            {
+                property.changed.remove(propertyChangedHandler);
+                delete _propertyToNames[property];
+            }
+            else
+            {
+                var numPropertyNames : uint = oldPropertyNames.length - 1;
+
+                oldPropertyNames[oldPropertyNames.indexOf(name)] = oldPropertyNames[numPropertyNames];
+                oldPropertyNames.length = numPropertyNames;
+            }
+        }

 		public function removeProperty(name : String) : DataProvider
 		{
@@ -183,15 +196,7 @@
 				delete _nameToProperty[name];

 				if (oldMonitoredValue != null)
-				{
-					if (oldPropertyNames.length == 1)
-					{
-						oldMonitoredValue.changed.remove(propertyChangedHandler);
-						delete _propertyToNames[oldMonitoredValue];
-					}
-					else
-						oldPropertyNames.splice(oldPropertyNames.indexOf(name), 1);
-				}
+					unwatchProperty(name, oldMonitoredValue);

 	//			_changed.execute(this, 'dataDescriptor');
 				_propertyRemoved.execute(this, name, bindingName, oldMonitoredValue);


Simplifying code

Simplifying code

--- WeaveJS/src/weavejs/core/ClassRegistryImpl.as
+++ WeaveJS/src/weavejs/core/ClassRegistryImpl.as
@@ -25,31 +25,27 @@
 	{
 		public function ClassRegistryImpl()
 		{
-			this.singletonInstances = new JS.Map();
-			this.singletonImplementations = new JS.Map();
-			this.implementations = new JS.Map();
-			this.displayNames = new JS.Map();
 		}

 		/**
 		 * interface Class -> singleton implementation instance.
 		 */
-		public var singletonInstances:Object;
+		public var singletonInstances:Object = new JS.Map();

 		/**
 		 * interface Class -> implementation Class
 		 */
-		public var singletonImplementations:Object;
+		public var singletonImplementations:Object = new JS.Map();

 		/**
 		 * interface Class -> Array<implementation Class>
 		 */
-		public var implementations:Object;
+		public var implementations:Object = new JS.Map();

 		/**
 		 * implementation Class -> String
 		 */
-		public var displayNames:Object;
+		public var displayNames:Object = new JS.Map();

 		/**
 		 * This registers an implementation for a singleton interface.


Add missing getRawMedia overriding super method.

--- src/org/mangui/jwplayer/media/HLSProvider.as
+++ src/org/mangui/jwplayer/media/HLSProvider.as
@@ -261,9 +261,9 @@
         override public function load(itm : PlaylistItem) : void {
             // Check flash player version
             var ver : Number = _checkVersion();
-            var minVersion : Number = 10.1;
+            var minVersion : Number = 11.6;
             if ( ver < minVersion ) {
-                sendMediaEvent(MediaEvent.JWPLAYER_MEDIA_ERROR, {message:"HLS streaming requires Flash Player 10.1 at mimimum"});
+                sendMediaEvent(MediaEvent.JWPLAYER_MEDIA_ERROR, {message:"This application requires Flash Player 11.6 at mimimum"});
             } else {
                 super.load(itm);
                 play();
@@ -274,6 +274,12 @@
         override public function get display() : DisplayObject {
             return _video;
         };
+
+		public override function getRawMedia():DisplayObject
+		{
+			return display;
+
+		}

         /** Resume playback of a paused item. **/
         override public function play() : void {


Added automatic creation of mediator for contextView
when mapped.

ContextView is already on the stage so it cannot take
advantage of automatic mediation. This eliminates that.

--- src/org/robotlegs/base/MediatorMap.as
+++ src/org/robotlegs/base/MediatorMap.as
@@ -25,7 +25,6 @@
 	import flash.display.DisplayObject;
 	import flash.display.Sprite;
 	import flash.events.Event;
-	import flash.events.IEventDispatcher;
 	import flash.utils.Dictionary;

 	import org.robotlegs.core.IInjector;
@@ -82,6 +81,7 @@
 		{
 			var message:String;
 			var viewClassName:String = reflector.getFQCN(viewClassOrName);
+			var contextViewClassName:String = reflector.getFQCN(contextView)
 			if (mappingConfigByViewClassName[viewClassName] != null)
 			{
 				message = ContextError.E_MAP_EXISTS + ' - ' + mediatorClass;
@@ -101,6 +101,10 @@
 				config.typedViewClass = viewClassOrName;
 			}
 			mappingConfigByViewClassName[viewClassName] = config;
+			if(contextViewClassName == viewClassName && autoCreate)
+			{
+				createMediator(contextView);
+			}
 		}

 		/**


Transferred from the Adobe Open Source Subversion Repository

Revision: 21629
Author:   jasonsj@adobe.com
Date:     2011-07-19T23:02:20.729244Z

Log Message:
-----------
Callout
* CalloutPosition.AUTO support with automatic re-positioning/nudging (similar to PopUpAnchor)
* Fixed arrow positioning when scaling
* Fixed centering arrow on owner when owner is off screen
* Updated skins to XD design

CalloutButton
* Proxy properties before Callout is created
* Create Callout as a dynamic skin part

Skins
* CalloutViewNavigatorSkin and CalloutActionBarSkin to support ViewNavigators in Callouts
* Allow ActionBar borderClass to be optional

QE notes: Ready for visual review
Doc notes:
Bugs:
Reviewer: chiedozi
Tests run: checkintests, mustella-mobile
Is noteworthy for integration: yes

Modified Paths:
--------------
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutViewNavigatorSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/CalloutContentBackground.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/ActionBarSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile240/assets/CalloutContentBackground.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile160/assets/CalloutContentBackground.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/CalloutButton.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutActionBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/Callout.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/ActionBarSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/ActionBarSkin.as
@@ -241,8 +241,11 @@
      */
     override protected function createChildren():void
     {
-        border = new borderClass();
-        addChild(border);
+        if (borderClass)
+        {
+            border = new borderClass();
+            addChild(border);
+        }

         navigationGroup = new Group();
         var hLayout:HorizontalLayout = new HorizontalLayout();
@@ -396,8 +399,11 @@
         // remove top and bottom padding from content group height
         var contentGroupsHeight:Number = Math.max(0, unscaledHeight - paddingTop - paddingBottom);

-        // FXG uses scale-9, drop shadow is drawn outside the bounds
-        setElementSize(border, unscaledWidth, unscaledHeight + layoutShadowHeight);
+        if (border)
+        {
+            // FXG uses scale-9, drop shadow is drawn outside the bounds
+            setElementSize(border, unscaledWidth, unscaledHeight + layoutShadowHeight);
+        }

         // position groups, overlap of navigation and action groups is allowed
         // when overlap occurs, titleDisplay/titleGroup is not visible


Patch to support multiple subscription requests by "krotscheck"

--- src/org/igniterealtime/xiff/im/Roster.as
+++ src/org/igniterealtime/xiff/im/Roster.as
@@ -23,6 +23,8 @@
  */
 package org.igniterealtime.xiff.im
 {
+	import flash.utils.Dictionary;
+
 	import org.igniterealtime.xiff.collections.ArrayCollection;
 	import org.igniterealtime.xiff.core.*;
 	import org.igniterealtime.xiff.data.*;
@@ -120,14 +122,11 @@
 		 * Store presences of the people in users roster.
 		 */
 		private var _presenceMap:Object = {};
-
-		//FIXME: does not support multiple pending requests
-		private var pendingSubscriptionRequestJID:UnescapedJID;

 		/**
-		 * TODO: List of UnescapedJID which are pending for subscription.
-		 */
-		private var pendingSubscriptionRequests:Array = [];
+		 * List of UnescapedJID which are pending for subscription.
+		 */
+		private var pendingSubscriptionRequests : Dictionary = new Dictionary();

 		/**
 		 *
@@ -178,19 +177,18 @@
 			var callbackMethod:String = null;
 			var subscription:String = RosterExtension.SUBSCRIBE_TYPE_NONE;
 			var askType:String = RosterExtension.ASK_TYPE_NONE;
+			var iqID : String = XMPPStanza.generateID( "add_user_" );

 			if ( requestSubscription == true )
 			{
 				callbackObj = this;
 				callbackMethod = "addContact_result";
-				pendingSubscriptionRequestJID = id;
-				pendingSubscriptionRequests.push(id);
+				pendingSubscriptionRequests[ iqID.toString() ] = id;
 				subscription = RosterExtension.SUBSCRIBE_TYPE_TO;
 				askType = RosterExtension.ASK_TYPE_SUBSCRIBE
 			}

-			var tempIQ:IQ = new IQ( null, IQ.TYPE_SET, XMPPStanza.generateID( "add_user_" ),
-									callbackMethod, callbackObj );
+			var tempIQ:IQ = new IQ( null, IQ.TYPE_SET, iqID, callbackMethod, callbackObj );
 			var ext:RosterExtension = new RosterExtension( tempIQ.getNode() );
 			ext.addItem( id.escaped, null, displayName, groupName ? [ groupName ] :
 						 null );
@@ -209,9 +207,15 @@
 		public function addContact_result( resultIQ:IQ ):void
 		{
 			// Contact was added, request subscription
-			// TODO: Should check the JID of the result
-			requestSubscription( pendingSubscriptionRequestJID );
-			pendingSubscriptionRequestJID = null;
+
+			var iqID : String = resultIQ.id.toString();
+
+			if ( pendingSubscriptionRequests.hasOwnProperty( iqID ) )
+			{
+				var subscriptionId : UnescapedJID = pendingSubscriptionRequests[ iqID ] as UnescapedJID;
+				requestSubscription( subscriptionId );
+				delete( pendingSubscriptionRequests[ iqID ] );
+			}
 		}

 		/**


renamed Matrix4x4.projectVectors to Matrix4x4.projectRawVectors

--- src/aerys/minko/type/math/Matrix4x4.as
+++ src/aerys/minko/type/math/Matrix4x4.as
@@ -390,6 +390,14 @@

 			return output;
 		}
+
+		public function projectRawVectors(input 	: Vector.<Number>,
+										  output	: Vector.<Number>,
+										  uvt		: Vector.<Number>) : void
+		{
+			Utils3D.projectVectors(_matrix, input, output, uvt);
+		}
+

 		public function getRawData(out 			: Vector.<Number> = null,
 								   offset		: int			  = 0,
@@ -448,13 +456,6 @@
 				_changed.execute(this, null);

 			return this;
-		}
-
-		public function projectVectors(input 	: Vector.<Number>,
-									   output	: Vector.<Number>,
-									   uvt		: Vector.<Number>) : void
-		{
-			Utils3D.projectVectors(_matrix, input, output, uvt);
 		}

 		public function getTranslation(output : Vector4 = null) : Vector4


Do what we say we're going to do.

Do what we say we're going to do.

git-svn-id: a1a4b28b82a3276cc491891159dd9963a0a72fae@4565 542714f4-19e9-0310-aa3c-eee0fc999fb1

--- src/as/com/threerings/io/TypedArray.as
+++ src/as/com/threerings/io/TypedArray.as
@@ -58,7 +58,7 @@
     public function addAll (other :Array) :void
     {
         for (var ii :int = 0; ii < other.length; ii++) {
-            this[ii] = other[ii];
+            push(other[ii]);
         }
     }


fixes double play event on initial load in flash mode

--- src/flash/htmlelements/VideoElement.as
+++ src/flash/htmlelements/VideoElement.as
@@ -269,9 +269,11 @@
 				}
 				_timer.start();
 				_isPaused = false;
-				sendEvent(HtmlMediaEvent.PLAY);
-				sendEvent(HtmlMediaEvent.PLAYING);
 				_hasStartedPlaying = true;
+
+				// don't toss play/playing events here, because we haven't sent a
+				// canplay / loadeddata event yet. that'll be handled in the net
+				// event listener
 			}

 		}


Transferred from the Adobe Open Source Subversion Repository

Revision: 3035
Author:   jvroom@adobe.com
Date:     2008-08-29T06:18:11.275196Z

Log Message:
-----------
* Added HTTPMultiService component - refactored the guts of HTTPService into a new
class AbstractOperation which HTTPService now wraps.

* Moved concurrency and showBusyCursor classes up to the mx.rpc level from mx.rpc.mxml.
Partly this improves consistency and partly because it is awkward to implement them
with the wrapping design in the subclass.  This does introduce a new dependency on
CursorManager in mx.rpc.HTTPService, though I think that should turn into a "runtime binding"
so we remove the compile time binding altogether.

* Added managers, operationManager, resultType, resultElementType, properties to the
AbstractService and AbstractInvoker classes.  These are used to improve the metadata information
on these operations for better tooling in the future, and to allow management services to
tie into the service infrastructure.

* AsyncToken gets a default parameter for its constructor so it can be used in MXML.

* Moved endpoint property up from the MXML to the regular mx.rpc version to improve consistency

The blazeds RPC tests passed unfortunately I had problems getting the RPC tests in the sdk branch
to build and run so let me know if you see any problems on those.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/remoting/mxml/RemoteObject.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractOperation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/remoting/Operation.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/HTTPMultiService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/mxml/HTTPService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractInvoker.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/SerializationFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/Operation.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/AbstractOperation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/remoting/RemoteObject.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/mxml/WebService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AsyncToken.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/HTTPService.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/Operation.as</path>

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

--- frameworks/projects/rpc/src/mx/rpc/soap/Operation.as
+++ frameworks/projects/rpc/src/mx/rpc/soap/Operation.as
@@ -649,6 +649,12 @@
      */
     override public function send(...args:Array):AsyncToken
     {
+        if (service != null)
+            service.initialize();
+
+        if (operationManager != null)
+            return operationManager(args);
+
         var argsToPass:Object = null;
         if (args && args.length > 0)
         {


fixed null pointer errors and other bugs with headerDepth feature.

--- WeaveData/src/weave/data/CSVParser.as
+++ WeaveData/src/weave/data/CSVParser.as
@@ -21,6 +21,7 @@
 {
 	import flash.utils.getTimer;

+	import mx.utils.ObjectUtil;
 	import mx.utils.StringUtil;

 	import weave.api.WeaveAPI;
@@ -316,6 +317,8 @@
 		 */
 		public function convertRowsToRecords(rows:Array, headerDepth:int = 1):Array
 		{
+			if (rows.length < headerDepth)
+				throw new Error("headerDepth is greater than the number of rows");
 			assertHeaderDepth(headerDepth);

 			var records:Array = new Array(rows.length - headerDepth);
@@ -331,7 +334,11 @@
 					{
 						var colName:String = rows[h][c];
 						if (h < headerDepth - 1)
-							output = output[colName] || (output[colName] = {});
+						{
+							if (!output[colName])
+								output[colName] = {};
+							output = output[colName];
+						}
 						else
 							output[colName] = cell;
 					}
@@ -367,9 +374,15 @@
 				if (includeNullFields || record[field] != null)
 				{
 					if (depth == 1)
+					{
 						output[field] = false;
+					}
 					else
-						_outputNestedFieldNames(record[field], includeNullFields, output[field] = {}, depth - 1);
+					{
+						if (!output[field])
+							output[field] = {};
+						_outputNestedFieldNames(record[field], includeNullFields, output[field], depth - 1);
+					}
 				}
 			}
 		}
@@ -449,7 +462,8 @@
 						var fieldChain:Array = fields[c];
 						var cell:Object = record;
 						for each (var field:String in fieldChain)
-							cell = cell[field];
+							if (cell)
+								cell = cell[field];
 						row[c] = cell;
 					}
 				}
@@ -464,27 +478,30 @@
 				throw new Error("headerDepth must be > 0");
 		}

-		/*
-
-		Console test code:
-
-		clear();
-		_.parser = WeaveAPI.CSVParser;
-		_.csv=[
-			"internal,internal,public,public,public,private,private,test",
-			"id,type,title,keyType,dataType,connection,sqlQuery,empty",
-			"1,0,state data table,,,,,",
-			"2,1,state name,fips,string,resd,""select fips,name from myschema.state_data"",",
-			"3,1,population,fips,number,resd,""select fips,pop from myschema.state_data"","
-		].join('\n');
-		_.table = _.parser.parseCSV(_.csv);
-		_.records = _.parser.convertRowsToRecords(_.table, 2);
-		_.rows = _.parser.convertRecordsToRows(_.records, null, false, 2);
-		_.fields = _.parser.getRecordFieldNames(_.records, false, 2);
-		_.fieldOrder = _.parser.parseCSV('internal,id\ninternal,type\npublic,title\npublic,keyType\npublic,dataType\nprivate,connection\nprivate,sqlQuery');
-		_.rows2 = _.parser.convertRecordsToRows(_.records, _.fieldOrder, false, 2);
-		toString(_)
-
-		*/
+		//test();
+		private static var _tested:Boolean = false;
+		private static function test():void
+		{
+			if (_tested)
+				return;
+			_tested = true;
+
+			var _:Object = {};
+			_.parser = WeaveAPI.CSVParser;
+			_.csv=[
+				"internal,internal,public,public,public,private,private,test",
+				"id,type,title,keyType,dataType,connection,sqlQuery,empty",
+				"2,1,state name,fips,string,resd,\"select fips,name from myschema.state_data\",",
+				"3,1,population,fips,number,resd,\"select fips,pop from myschema.state_data\",",
+				"1,0,state data table"
+			].join('\n');
+			_.table = _.parser.parseCSV(_.csv);
+			_.records = _.parser.convertRowsToRecords(_.table, 2);
+			_.rows = _.parser.convertRecordsToRows(_.records, null, false, 2);
+			_.fields = _.parser.getRecordFieldNames(_.records, false, 2);
+			_.fieldOrder = _.parser.parseCSV('internal,id\ninternal,type\npublic,title\npublic,keyType\npublic,dataType\nprivate,connection\nprivate,sqlQuery');
+			_.rows2 = _.parser.convertRecordsToRows(_.records, _.fieldOrder, false, 2);
+			weaveTrace(ObjectUtil.toString(_));
+		}
 	}
 }


cleaned up frame handling code

cleaned up frame handling code

--- WeaveJS/src/weavejs/core/Scheduler.as
+++ WeaveJS/src/weavejs/core/Scheduler.as
@@ -17,6 +17,7 @@
 {
 	import weavejs.WeaveAPI;
 	import weavejs.api.core.ICallbackCollection;
+	import weavejs.api.core.IDisposableObject;
 	import weavejs.api.core.ILinkableObject;
 	import weavejs.api.core.IScheduler;
 	import weavejs.util.DebugTimer;
@@ -32,26 +33,36 @@
 	 *
 	 * @author adufilie
 	 */
-	public class Scheduler implements IScheduler
+	public class Scheduler implements IScheduler, IDisposableObject
 	{
-		public function Scheduler()
-		{
-			_nextAnimationFrame = JS.requestAnimationFrame(handleCallLater);
-			initVisibilityHandler();
-		}
-
-		public function dispose():void
-		{
-			JS.cancelAnimationFrame(_nextAnimationFrame);
-		}
-
 		public static var debug_fps:Boolean = false;
 		public static var debug_async_time:Boolean = false;
 		public static var debug_async_stack:Boolean = false;
 		public static var debug_async_stack_elapsed:Boolean = false;
 		public static var debug_delayTasks:Boolean = false; // set this to true to delay async tasks
 		public static var debug_callLater:Boolean = false; // set this to true to delay async tasks
-		public static var debug_visibility:Boolean = false; // set this to true to delay async tasks
+		public static var debug_visibility:Boolean = false; // set this to true to delay async tasks
+
+		public function Scheduler()
+		{
+			frameCallbacks.addImmediateCallback(this, _handleCallLater);
+			frameCallbacks.addImmediateCallback(this, _requestNextFrame, true, true);
+			initVisibilityHandler();
+		}
+
+		public var frameCallbacks:ICallbackCollection = Weave.disposableChild(this, CallbackCollection);
+		private var _nextAnimationFrame:int;
+
+		private function _requestNextFrame():void
+		{
+			_nextAnimationFrame = JS.requestAnimationFrame(frameCallbacks.triggerCallbacks);
+		}
+
+		public function dispose():void
+		{
+			JS.cancelAnimationFrame(_nextAnimationFrame);
+		}
+
 		public var averageFrameTime:int = 0;
 		private var _currentFrameStartTime:int = JS.now(); // this is the result of JS.now() on the last ENTER_FRAME event.
 		private var _previousFrameElapsedTime:int = 0; // this is the amount of time it took to process the previous frame.
@@ -73,10 +84,7 @@
 		private var _priorityAllocatedTimes:Array = [Number.MAX_VALUE, 300, 200, 100]; // An Array of allocated times corresponding to callLater queues.
 		private var _deactivatedMaxComputationTimePerFrame:uint = 1000;
 		private var _nextCallLaterPriority:uint = WeaveAPI.TASK_PRIORITY_IMMEDIATE; // private variable to control the priority of the next callLater() internally
-		private var _nextAnimationFrame:int;

-		public var frameCallbacks:ICallbackCollection = Weave.disposableChild(this, CallbackCollection);
-
 		/**
 		 * This gets the maximum milliseconds spent per frame performing asynchronous tasks.
 		 */
@@ -211,10 +219,8 @@
 		/**
 		 * This function gets called during ENTER_FRAME and RENDER events.
 		 */
-		private function handleCallLater():void
+		private function _handleCallLater():void
 		{
-			_nextAnimationFrame = JS.requestAnimationFrame(handleCallLater);
-
 			// detect deactivated framerate (when app is hidden)
 			if (deactivated)
 			{
@@ -402,8 +408,6 @@
 				if (debug_callLater)
 					DebugTimer.end(stackTrace);
 			}
-
-			frameCallbacks.triggerCallbacks();
 		}

 		/**


added isVector()

added isVector()

--- WeaveData/src/weave/utils/VectorUtils.as
+++ WeaveData/src/weave/utils/VectorUtils.as
@@ -37,6 +37,16 @@
 		private static var _lookup:Dictionary = new Dictionary(true);
 		private static var _lookupId:int = 0;

+		private static const VectorClass:Class = Object(new Vector.<Object>()).constructor;
+
+		/**
+		 * Tests if an object is a Vector.
+		 */
+		public static function isVector(object:*):Boolean
+		{
+			return object is VectorClass || object is Vector.<int> || object is Vector.<uint> || object is Vector.<Number>;
+		}
+
 		/**
 		 * Computes the union of the items in a list of Arrays. Can also be used to get a list of unique items in an Array.
 		 * @param arrays A list of Arrays.


removed WeaveArchive.as

removed WeaveArchive.as

--- WeaveJS/src/weavejs/core/WeaveArchive.as
+++ WeaveJS/src/weavejs/core/WeaveArchive.as
@@ -1,199 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- *
- * This file is part of Weave.
- *
- * The Initial Developer of Weave is the Institute for Visualization
- * and Perception Research at the University of Massachusetts Lowell.
- * Portions created by the Initial Developer are Copyright (C) 2008-2015
- * the Initial Developer. All Rights Reserved.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * ***** END LICENSE BLOCK ***** */
-
-package weavejs.core
-{
-	import weavejs.WeaveAPI;
-	import weavejs.data.AttributeColumnCache;
-	import weavejs.net.URLRequest;
-	import weavejs.util.BackwardsCompatibility;
-	import weavejs.util.JSByteArray;
-	import weavejs.util.WeavePromise;
-
-	/**
-	 * This is an interface for reading and writing data in the Weave file format.
-	 *
-	 * @author adufilie
-	 */
-	public class WeaveArchive
-	{
-		/**
-		 * This must be set externally.
-		 */
-		public static var JSZip:Class;
-
-		/**
-		 * @param input A Weave file to decode.
-		 */
-		public function WeaveArchive(byteArray:/*/Uint8Array/*/Array = null)
-		{
-			if (byteArray)
-				_readArchive(byteArray);
-		}
-
-		/**
-		 * This is a dynamic object containing all the files (ByteArray objects) in the archive.
-		 * The property names used in this object must be valid filenames or serialize() will fail.
-		 */
-		public const files:Object = {};
-
-		/**
-		 * This is a dynamic object containing all the amf objects stored in the archive.
-		 * The property names used in this object must be valid filenames or serialize() will fail.
-		 */
-		public const objects:Object = {};
-
-		private static const FOLDER_AMF:String = "weave-amf"; // folder used for AMF3-encoded objects
-		private static const FOLDER_JSON:String = "weave-json"; // folder used for JSON-encoded objects
-		private static const FOLDER_FILES:String = "weave-files"; // folder used for raw files
-
-		/**
-		 * @private
-		 */
-		private function _readArchive(byteArray:/*/Uint8Array/*/Array):void
-		{
-			var zip:Object = new JSZip(byteArray);
-			for (var filePath:String in zip.files)
-			{
-				var fileName:String = filePath.substr(filePath.indexOf('/') + 1);
-				var file:Object = zip.files[filePath];
-				if (file.dir)
-					continue;
-				if (filePath.indexOf(FOLDER_JSON + '/') == 0)
-				{
-					objects[fileName] = JSON.parse(file.asText());
-				}
-				else if (filePath.indexOf(FOLDER_AMF + '/') == 0)
-				{
-					var amf:Object = new JSByteArray(file.asUint8Array());
-					objects[fileName] = amf.readObject();
-				}
-				else
-				{
-					files[fileName] = file.asUint8Array();
-				}
-			}
-		}
-
-		/**
-		 * This function will create a ByteArray containing the objects that have been specified with setObject().
-		 * @param contentType A String describing the type of content contained in the objects.
-		 * @return A Uint8Array in the Weave file format.
-		 */
-		public function serialize(readableJSON:Boolean = true):/*/Uint8Array/*/Array
-		{
-			var zip:Object = new JSZip();
-			var name:String;
-			var folder:Object;
-
-			folder = zip.folder(FOLDER_FILES);
-			for (name in files)
-				folder.file(name, files[name]);
-
-			folder = zip.folder(FOLDER_JSON);
-			for (name in objects)
-				folder.file(name, JSON.stringify(objects[name], null, readableJSON && '\t'));
-
-			return zip.generate({compression: "DEFLATE", type: 'uint8array'});
-		}
-
-//		public static const HISTORY_SYNC_DELAY:int = 100;
-//		public static const THUMBNAIL_SIZE:int = 200;
-//		public static const ARCHIVE_THUMBNAIL_PNG:String = "thumbnail.png";
-//		public static const ARCHIVE_SCREENSHOT_PNG:String = "screenshot.png";
-//		public static const ARCHIVE_URL_CACHE_AMF:String = "url-cache.amf";
-//		public static const ARCHIVE_URL_CACHE_JSON:String = "url-cache.json";
-		public static const ARCHIVE_HISTORY_AMF:String = "history.amf";
-		public static const ARCHIVE_HISTORY_JSON:String = "history.json";
-		public static const ARCHIVE_COLUMN_CACHE_AMF:String = "column-cache.amf";
-		public static const ARCHIVE_COLUMN_CACHE_JSON:String = "column-cache.json";
-
-		/**
-		 * Loads a WeaveArchive from file content.
-		 */
-		public static function loadUrl(weave:Weave, fileUrl:String):WeavePromise/*/<void>/*/
-		{
-			return new WeavePromise(weave.root).setResult(
-				WeaveAPI.URLRequestUtils.request(weave.root, new URLRequest(fileUrl))
-					.then(loadFileContent.bind(WeaveArchive, weave))
-			);
-		}
-
-		/**
-		 * Loads a WeaveArchive from file content.
-		 */
-		public static function loadFileContent(weave:Weave, fileContent:/*/Uint8Array/*/Array):void
-		{
-			var archive:WeaveArchive = new WeaveArchive(fileContent);
-
-			var historyJSON:Object = archive.objects[ARCHIVE_HISTORY_JSON];
-			var historyAMF:Object = archive.objects[ARCHIVE_HISTORY_AMF];
-			if (historyJSON)
-			{
-				weave.history.setSessionState(historyJSON);
-			}
-			else if (historyAMF)
-			{
-				weave.history.setSessionState(BackwardsCompatibility.updateSessionState(historyAMF));
-			}
-			else
-			{
-				throw new Error("No session history found");
-			}
-
-			var columnCache:Object = archive.objects[ARCHIVE_COLUMN_CACHE_AMF] || archive.objects[ARCHIVE_COLUMN_CACHE_JSON];
-			(WeaveAPI.AttributeColumnCache as AttributeColumnCache).restoreCache(weave.root, columnCache);
-
-			var fileName:String;
-			for (fileName in archive.files)
-				WeaveAPI.URLRequestUtils.saveLocalFile(weave.root, fileName, archive.files[fileName]);
-
-			// remove files not appearing in archive
-			for each (fileName in WeaveAPI.URLRequestUtils.getLocalFileNames(weave.root))
-				if (!archive.files[fileName])
-					WeaveAPI.URLRequestUtils.removeLocalFile(weave.root, fileName);
-		}
-
-		/**
-		 * This function will create an object that can be saved to a file and recalled later with loadWeaveFileContent().
-		 */
-		public static function createArchive(weave:Weave/*, saveScreenshot:Boolean=false*/):WeaveArchive
-		{
-			var archive:WeaveArchive = new WeaveArchive();
-
-			// thumbnail should go first in the stream because we will often just want to extract the thumbnail and nothing else.
-//			updateLocalThumbnailAndScreenshot(saveScreenshot);
-
-			// embedded files
-			for each (var fileName:String in WeaveAPI.URLRequestUtils.getLocalFileNames(weave.root))
-				archive.files[fileName] = WeaveAPI.URLRequestUtils.getLocalFile(weave.root, fileName);
-
-			// session history
-			var _history:Object = weave.history.getSessionState();
-			archive.objects[ARCHIVE_HISTORY_JSON] = _history;
-
-			// TEMPORARY SOLUTION - url cache
-//			if (WeaveAPI.URLRequestUtils['saveCache'])
-//				archive.objects[ARCHIVE_URL_CACHE_JSON] = WeaveAPI.URLRequestUtils.getCache();
-
-			// TEMPORARY SOLUTION - column cache
-			var columnCache:Object = WeaveAPI.AttributeColumnCache['map_root_saveCache'].get(weave.root);
-			if (columnCache)
-				archive.objects[ARCHIVE_COLUMN_CACHE_JSON] = columnCache;
-
-			return archive;
-		}
-	}
-}


Jamie has discovered that the MultiLoader can sometimes be gc'd before
calling the callback. Loaders are not supposed to do this, but that may
only be when loading over the network and not from a ByteArray.

We know that retaining a reference to the MultiLoader fixes it, but
that increases the burden on the users of this class. Let's try this
instead, I think it will work: just retain references to active MultiLoaders
in the class.

Jamie's going to test this, as well.

(Also: in foreach mode, free references to results after reporting them.)

git-svn-id: a1a4b28b82a3276cc491891159dd9963a0a72fae@4999 542714f4-19e9-0310-aa3c-eee0fc999fb1

--- src/as/com/threerings/util/MultiLoader.as
+++ src/as/com/threerings/util/MultiLoader.as
@@ -219,6 +219,11 @@
         if (!_forEach) {
             checkReport(endCheckKey);
         }
+
+        // if we're not done at this point, keep a reference to this loader
+        if (_remaining > 0) {
+            _activeMultiLoaders[this] = true;
+        }
     }

     protected function handleError (event :ErrorEvent) :void
@@ -245,6 +250,19 @@
         } catch (err :Error) {
             trace("MultiLoader: Error calling completeCallback [result=" + thisResult + "].");
             trace("Cause: " + err.getStackTrace());
+        }
+
+        if (_forEach) {
+            delete _result[key]; // free the loaded object to assist gc
+        }
+
+        // If we're all done, remove the static reference to this loader.
+        // Note that this could be called in for-each mode if we haven't yet started to load
+        // something asynchronously but have come across an Error or an already-completed load.
+        // That's ok, as this will just end up deleting a reference that doesn't exist, and if
+        // necessary the reference will still be added at the end of the constructor.
+        if (_remaining == 0) {
+            delete _activeMultiLoaders[this];
         }
     }

@@ -277,5 +295,6 @@

     protected var _remaining :int = 0;

+    protected static const _activeMultiLoaders :Dictionary = new Dictionary();
 }
 }