Transferred from the Adobe Open Source Subversion Repository

Revision: 22826
Author:   aaltman@adobe.com
Date:     2011-09-30T17:36:16.410186Z

Log Message:
-----------
Modified bitmap swapping to only swap bitmaps for popups that overlap StageText.
Patched StageText focus out handler to prevent a focus out/in race condition.

QE notes: None
Doc notes: None
Bugs: SDK-31671 SDK-31637
Reviewer: jasonsj
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableStageText.as

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

--- frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableStageText.as
+++ frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableStageText.as
@@ -1312,6 +1312,12 @@
      */
     override public function setFocus():void
     {
+        // The proxy bitmap should not be showing and somebody is trying to set
+        // focus on us. Make sure the proxy bitmap really is gone and the
+        // StageText is visible.
+        if (!showTextImage && !alwaysShowProxyImage)
+            commitVisible(true);
+
         // Do not set focus if the StageText is invisible (it has been replaced
         // by a proxy image). This component may be in a form that is lower in
         // z-order than the topmost form and we cannot allow the StageText,
@@ -1725,7 +1731,18 @@
      */
     private function createProxyImage():void
     {
-        if (textImage == null)
+        if (!showTextImage && textImage != null)
+        {
+            // In this case, we have just received an event that causes us to
+            // dispose the proxy image, but havent disposed it yet
+            // (commitProperties hasn't been called yet). So, we don't need to
+            // create a new text image. Just update the one we have and update
+            // our state variables.
+            showTextImage = true;
+            updateProxyImage();
+            commitVisible(true);
+        }
+        else if (textImage == null)
         {
             var imageData:BitmapData = captureBitmapData();

@@ -1787,6 +1804,58 @@
             -1;
     }

+    private function getGlobalViewPort():Rectangle
+    {
+        // We calculate the parent's concatenated matrix to deal with
+        // issues in the runtime where the concatenated matrix of the
+        // parent is out of sync.  See SDK-31538.
+        var m:Matrix = MatrixUtil.getConcatenatedMatrix(parent, stage);
+        var globalTopLeft:Point = m.transformPoint(localViewPort.topLeft);
+
+        // Transform the bottom-right corner of the local rect
+        // instead of setting width/height to account for any
+        // transformations applied to ancestor objects.
+        var globalBottomRight:Point = m.transformPoint(localViewPort.bottomRight);
+        var globalRect:Rectangle = new Rectangle();
+
+        // StageText can't deal with upside-down or mirrored rectangles
+        // or non-integer values. Fix those here.
+        globalRect.x = Math.floor(Math.min(globalTopLeft.x, globalBottomRight.x));
+        globalRect.y = Math.floor(Math.min(globalTopLeft.y, globalBottomRight.y));
+        globalRect.width = Math.ceil(Math.abs(globalBottomRight.x - globalTopLeft.x));
+        globalRect.height = Math.ceil(Math.abs(globalBottomRight.y - globalTopLeft.y));
+
+        return globalRect;
+    }
+
+    private function hasOverlappingForm():Boolean
+    {
+        if (!localViewPort || !parent || !stageText || !awm)
+            return false;
+
+        var globalRect:Rectangle = getGlobalViewPort();
+        var result:Boolean = false;
+
+        for each (var otherForm:Object in awm.forms)
+        {
+            var otherFormDisplayObj:DisplayObject = otherForm as DisplayObject;
+
+            if (otherFormDisplayObj &&
+                (!otherForm.hasOwnProperty("focusManager") || otherForm.focusManager != focusManager))
+            {
+                var formGlobalRect:Rectangle = otherFormDisplayObj.getBounds(stage);
+
+                if (formGlobalRect.intersects(globalRect))
+                {
+                    result = true;
+                    break;
+                }
+            }
+        }
+
+        return result;
+    }
+
     /**
      *  Determine whether the given form is an application. This is the same
      *  check as is used by ActiveWindowManager.
@@ -1851,7 +1920,7 @@

         if (form && form.hasOwnProperty("focusManager"))
         {
-            if (form.focusManager != focusManager)
+            if (form.focusManager != focusManager && hasOverlappingForm())
                 createProxyImage();
             else
                 disposeProxyImage();
@@ -1890,24 +1959,7 @@
         {
             if (stageText.stage)
             {
-                // We calculate the parent's concatenated matrix to deal with
-                // issues in the runtime where the concatenated matrix of the
-                // parent is out of sync.  See SDK-31538.
-                var m:Matrix = MatrixUtil.getConcatenatedMatrix(parent, stage);
-                var globalTopLeft:Point = m.transformPoint(localViewPort.topLeft);
-
-                // Transform the bottom-right corner of the local rect
-                // instead of setting width/height to account for any
-                // transformations applied to ancestor objects.
-                var globalBottomRight:Point = m.transformPoint(localViewPort.bottomRight);
-                var globalRect:Rectangle = new Rectangle();
-
-                // StageText can't deal with upside-down or mirrored rectangles
-                // or non-integer values. Fix those here.
-                globalRect.x = Math.floor(Math.min(globalTopLeft.x, globalBottomRight.x));
-                globalRect.y = Math.floor(Math.min(globalTopLeft.y, globalBottomRight.y));
-                globalRect.width = Math.ceil(Math.abs(globalBottomRight.x - globalTopLeft.x));
-                globalRect.height = Math.ceil(Math.abs(globalBottomRight.y - globalTopLeft.y));
+                var globalRect:Rectangle = getGlobalViewPort();

                 if (stageText.viewPort != globalRect)
                 {
@@ -2047,6 +2099,38 @@
     }

     /**
+     *  For each form that the ActiveWindowManager knows about, add listeners
+     *  for changes to geometry. These listeners are necessary because changes
+     *  to the geometry of a form may cause popups to start or stop overlapping
+     *  StageTexts. When that happens, StageTexts need to be replaced with proxy
+     *  bitmaps or vice-versa.
+     */
+    private function updateWatchedForms(excludeForm:Object = null):void
+    {
+        if (awm)
+        {
+            for each (var form:Object in awm.forms)
+            {
+                if (form is EventDispatcher)
+                {
+                    var formDispatcher:EventDispatcher = form as EventDispatcher;
+
+                    // Remove event listeners in case we've already seen this form before.
+                    formDispatcher.removeEventListener(MoveEvent.MOVE, form_moveHandler);
+                    formDispatcher.removeEventListener(ResizeEvent.RESIZE, form_resizeHandler);
+
+                    if (form != excludeForm)
+                    {
+                        // Use weak references so we don't prevent the form from being garbage collected.
+                        formDispatcher.addEventListener(MoveEvent.MOVE, form_moveHandler, false, 0, true);
+                        formDispatcher.addEventListener(ResizeEvent.RESIZE, form_resizeHandler, false, 0, true);
+                    }
+                }
+            }
+        }
+    }
+
+    /**
      *  Stop watching for visibility and geometry events on all ancestors. Call
      *  this when disposing the StageText.
      */
@@ -2210,11 +2294,14 @@

     private function awm_activatedFormHandler(event:DynamicEvent):void
     {
+        updateWatchedForms();
         updateProxyImageForTopmostForm();
     }

     private function awm_deactivatedFormHandler(event:DynamicEvent):void
     {
+        updateWatchedForms();
+
         // When the ActiveWindowManager dispatches the deactivatedForm event,
         // its internal list of forms has not been updated yet. So, determining
         // the topmost form from that list will fail and find the old topmost
@@ -2233,7 +2320,18 @@
         // though, so the popup whose focus manager is getting removed needs to
         // be explicitly skipped when determining the new topmost form.
         var removedForm:Object = event.relatedObject;
+        updateWatchedForms(removedForm);
         updateProxyImageForTopmostForm(removedForm);
+    }
+
+    private function form_moveHandler(event:MoveEvent):void
+    {
+        updateProxyImageForTopmostForm();
+    }
+
+    private function form_resizeHandler(event:ResizeEvent):void
+    {
+        updateProxyImageForTopmostForm();
     }

     private function stageText_changeHandler(event:Event):void
@@ -2272,8 +2370,35 @@

     private function stageText_focusOutHandler(event:FocusEvent):void
     {
+        // This is to fix a race condition in PopUpManager and
+        // ActiveWindowManager. When a form (popup) is removed from
+        // ActiveWindowManager, it reactivates the FocusManager of the previous
+        // active form. That causes that FocusManager to set focus back to the
+        // last component to have focus. In the race condition case, that
+        // component has a focusIn handler that opens the popup that we were
+        // closing to start this whole chain of events. Because the popup is
+        // opening while it is in the middle of closing, it gets into an
+        // inconsistent state. This race condition doesn't happen with non-
+        // StageText-based text components because FocusManager normally
+        // prevents focus from going to nothing (thereby preventing focus from
+        // leaving the text component to begin with). StageText, however, does
+        // not dispatch the necessary cancellable focus change events to allow
+        // FocusManager to do this. So, to prevent these such race conditions
+        // that the rest of the framework isn't prepared for, we must prevent
+        // FocusManager from immediately setting focus back to this StageText.
         if (focusedStageText == stageText)
+        {
             focusedStageText = null;
+
+            if (focusManager is FocusManager)
+            {
+                var fm:FocusManager = focusManager as FocusManager;
+                var lastFocus:Object = fm.lastFocus as Object;
+
+                if (lastFocus && lastFocus.hasOwnProperty("textDisplay") && lastFocus.textDisplay == this)
+                    fm.lastFocus = null;
+            }
+        }

         // Focus events are documented as bubbling. However, all events coming
         // from StageText are set to not bubble. So we need to create an


add code to export

add code to export

--- DragonBonesDesignPanelLib/src/core/service/ImportDataToExportDataService.as
+++ DragonBonesDesignPanelLib/src/core/service/ImportDataToExportDataService.as
@@ -235,7 +235,7 @@
 					DataUtils.convertDragonBonesDataToRelativeObject(obj);
 					trace(com.adobe.serialization.json.JSON.encode(obj));
 					zip.add(
-						com.adobe.serialization.json.JSON.encode(DataUtils.xmlToObject(importModel.vo.skeleton, GlobalConstValues.XML_LIST_NAMES)),
+						com.adobe.serialization.json.JSON.encode(obj),
 						_exportVO.dragonBonesFileName + "." + GlobalConstValues.JSON_SUFFIX,
 						date
 					);


major refactor of Geometry.computeNormals() and Geometry.computeTangentSpace() methods so that then can be called multiple times in order to update normals/tangents data

--- src/aerys/minko/render/geometry/Geometry.as
+++ src/aerys/minko/render/geometry/Geometry.as
@@ -327,87 +327,45 @@
 		 * the "replace" argument to "true".
 		 *
 		 * @param streamUsage The StreamUsage for the new vertex stream that stores the normals data.
+		 * If no value is provided, the StreamUsage of the vertex stream holding the VertexComponent.XYZ
+		 * will be used.
+		 *
 		 * @param replace Whether the existing normals data should be replaced if it exists.
 		 *
 		 */
-		public function computeNormals(streamUsage : uint, replace : Boolean = false) : Geometry
-		{
-			var indices			: Vector.<uint>		= _indexStream._data;
-			var numTriangles	: int				= _indexStream.length / 3;
-			var numStreams		: int				= _vertexStreams.length;
-
-			for (var streamId : int = 0; streamId < numStreams; ++streamId)
-			{
-				var stream			: IVertexStream		= _vertexStreams[streamId];
-				var xyzStream		: VertexStream		= stream.getStreamByComponent(VertexComponent.XYZ);
-				var vertexOffset	: int 				= xyzStream.format.getOffsetForComponent(VertexComponent.XYZ);
-				var vertexLength	: int 				= xyzStream.format.size;
-				var vertices		: Vector.<Number>	= xyzStream._data;
-				var numVertices		: int				= vertices.length / vertexLength;
-				var normals			: Vector.<Number>	= new Vector.<Number>(3 * numVertices);
-				var i				: int				= 0;
-
-				for (i = 0; i < numTriangles; ++i)
-				{
-					var i0	: int 		= indices[int(3 * i)];
-					var i1	: int 		= indices[int(3 * i + 1)];
-					var i2	: int 		= indices[int(3 * i + 2)];
-
-					var ii0	: int 		= vertexOffset + vertexLength * i0;
-					var ii1	: int		= vertexOffset + vertexLength * i1;
-					var ii2	: int 		= vertexOffset + vertexLength * i2;
-
-					var x0	: Number 	= vertices[ii0];
-					var y0	: Number 	= vertices[int(ii0 + 1)];
-					var z0	: Number 	= vertices[int(ii0 + 2)];
-
-					var x1	: Number 	= vertices[ii1];
-					var y1	: Number 	= vertices[int(ii1 + 1)];
-					var z1	: Number 	= vertices[int(ii1 + 2)];
-
-					var x2	: Number 	= vertices[ii2];
-					var y2	: Number 	= vertices[int(ii2 + 1)];
-					var z2	: Number 	= vertices[int(ii2 + 2)];
-
-					var nx	: Number 	= (y0 - y2) * (z0 - z1) - (z0 - z2) * (y0 - y1);
-					var ny	: Number 	= (z0 - z2) * (x0 - x1) - (x0 - x2) * (z0 - z1);
-					var nz	: Number 	= (x0 - x2) * (y0 - y1) - (y0 - y2) * (x0 - x1);
-
-					normals[int(i0 * 3)] += nx;
-					normals[int(i0 * 3 + 1)] += ny;
-					normals[int(i0 * 3 + 2)] += nz;
-
-					normals[int(i1 * 3)] += nx;
-					normals[int(i1 * 3 + 1)] += ny;
-					normals[int(i1 * 3 + 2)] += nz;
-
-					normals[int(i2 * 3)] += nx;
-					normals[int(i2 * 3 + 1)] += ny;
-					normals[int(i2 * 3 + 2)] += nz;
-				}
-
-
-				for (i = 0; i < numVertices; ++i)
-				{
-					var x	: Number = normals[int(i * 3)];
-					var y	: Number = normals[int(i * 3 + 1)];
-					var z	: Number = normals[int(i * 3 + 2)];
-
-					var mag	: Number = Math.sqrt(x * x + y * y + z * z);
-
-					if (mag != 0.)
-					{
-						normals[uint(i * 3)] /= mag;
-						normals[uint(i * 3 + 1)] /= mag;
-						normals[uint(i * 3 + 2)] /= mag;
-					}
-				}
-
-				pushVertexStream(
-					streamId,
-					new VertexStream(streamUsage, FORMAT_NORMALS, normals),
-					replace
-				);
+		public function computeNormals(streamUsage : uint = 0) : Geometry
+		{
+			var numStreams		: uint			= this.numVertexStreams;
+			var indices			: Vector.<uint>	= indexStream.lock();
+			var numTriangles	: int			= indexStream.length / 3;
+			var stream			: IVertexStream	= null;
+
+			if (numStreams != 0)
+			{
+				stream = getVertexStream();
+
+				if (!stream.format.hasComponent(VertexComponent.XYZ))
+					throw new Error('Unable to compute normals without VertexComponent.XYZ');
+
+				streamUsage ||= stream.getStreamByComponent(VertexComponent.XYZ).usage;
+
+				for (var streamId : uint = 0; streamId < numStreams; ++streamId)
+				{
+					stream = getVertexStream(streamId);
+
+					var numVertices		: uint				= stream.length;
+					var xyzStream		: VertexStream		= stream.getStreamByComponent(VertexComponent.XYZ);
+					var normalsStream 	: VertexStream		= stream.getStreamByComponent(VertexComponent.NORMAL);
+					var hasNormals		: Boolean			= normalsStream != null;
+
+					if (!hasNormals)
+						normalsStream = new VertexStream(streamUsage, FORMAT_NORMALS, new Vector.<Number>(numVertices * 3));
+
+					fillNormalsData(indices, normalsStream, xyzStream, numVertices);
+
+					if (!hasNormals)
+						pushVertexStreamInList(streamId, normalsStream);
+				}
 			}

 			return this;
@@ -434,7 +392,286 @@
 		 * @param replace Whether to replace existing normals or tangents data.
 		 *
 		 */
-		public function computeTangentSpace(streamUsage : uint, replace : Boolean = false) : Geometry
+		public function computeTangentSpace(streamUsage : uint = 0) : Geometry
+		{
+			var numStreams		: uint			= this.numVertexStreams;
+			var indices			: Vector.<uint>	= indexStream.lock();
+			var numTriangles	: int			= indexStream.length / 3;
+			var stream			: IVertexStream	= null;
+
+			if (numStreams != 0)
+			{
+				stream = getVertexStream();
+
+				var format : VertexFormat = stream.format;
+
+				if (!format.hasComponent(VertexComponent.XYZ))
+					throw new Error('Unable to compute normals without VertexComponent.XYZ');
+				if (!stream.format.hasComponent(VertexComponent.UV))
+					throw new Error('Unable to compute tangents without VertexComponent.UV');
+
+				streamUsage ||= stream.getStreamByComponent(VertexComponent.XYZ).usage;
+
+				for (var streamId : uint = 0; streamId < numStreams; ++streamId)
+				{
+					stream = getVertexStream(streamId);
+
+					var numVertices		: uint				= stream.length;
+					var xyzStream		: VertexStream		= stream.getStreamByComponent(VertexComponent.XYZ);
+					var uvStream		: VertexStream		= stream.getStreamByComponent(VertexComponent.UV);
+					var normalsStream 	: VertexStream		= stream.getStreamByComponent(VertexComponent.NORMAL);
+					var tangentsStream	: VertexStream		= stream.getStreamByComponent(VertexComponent.TANGENT);
+					var hasNormals		: Boolean			= normalsStream != null;
+					var hasTangents		: Boolean			= tangentsStream != null;
+
+					if (!hasNormals && !hasTangents)
+					{
+						normalsStream = tangentsStream = new VertexStream(
+							streamUsage,
+							new VertexFormat(VertexComponent.NORMAL, VertexComponent.TANGENT),
+							new Vector.<Number>(numVertices * 6)
+						);
+					}
+					else if (!hasNormals)
+					{
+						normalsStream = new VertexStream(
+							streamUsage,
+							new VertexFormat(VertexComponent.NORMAL),
+							new Vector.<Number>(numVertices * 3)
+						);
+					}
+					else if (!hasTangents)
+					{
+						tangentsStream = new VertexStream(
+							streamUsage,
+							new VertexFormat(VertexComponent.TANGENT),
+							new Vector.<Number>(numVertices * 3)
+						);
+					}
+
+					fillNormalsData(indices, normalsStream, xyzStream, numVertices);
+					fillTangentsData(indices, tangentsStream, xyzStream, uvStream, numVertices);
+
+					if (!hasNormals)
+						pushVertexStreamInList(streamId, normalsStream);
+					if (!hasTangents && hasNormals)
+						pushVertexStreamInList(streamId, tangentsStream);
+				}
+			}
+
+			return this;
+		}
+
+		private function fillNormalsData(indices		: Vector.<uint>,
+										 normalsStream	: VertexStream,
+										 xyzStream		: VertexStream,
+										 numVertices	: uint) : void
+		{
+			var numTriangles		: uint				= indices.length / 3;
+			var nx					: Number 			= 0.;
+			var ny					: Number 			= 0.;
+			var nz					: Number 			= 0.;
+			var mag					: Number			= 0.;
+			var xyzOffset			: uint				= xyzStream.format.getOffsetForComponent(VertexComponent.XYZ);
+			var xyzVertexSize		: uint				= xyzStream.format.size;
+			var xyzData				: Vector.<Number>	= xyzStream.lock();
+			var normalsOffset		: uint				= normalsStream.format.getOffsetForComponent(VertexComponent.NORMAL);
+			var normalsVertexSize	: uint				= normalsStream.format.size;
+			var normalsData			: Vector.<Number>	= null;
+
+			normalsData = normalsStream == xyzStream ? xyzData : normalsStream.lock();
+
+			for (var i : uint = 0; i < numTriangles; ++i)
+			{
+				var i0	: uint 		= indices[uint(3 * i)];
+				var i1	: uint 		= indices[uint(3 * i + 1)];
+				var i2	: uint 		= indices[uint(3 * i + 2)];
+
+				var ii0	: uint 		= xyzOffset + xyzVertexSize * i0;
+				var ii1	: uint		= xyzOffset + xyzVertexSize * i1;
+				var ii2	: uint 		= xyzOffset + xyzVertexSize * i2;
+
+				var x0	: Number	= xyzData[ii0];
+				var y0	: Number 	= xyzData[uint(ii0 + 1)];
+				var z0	: Number 	= xyzData[uint(ii0 + 2)];
+				var x1	: Number 	= xyzData[ii1];
+				var y1	: Number 	= xyzData[uint(ii1 + 1)];
+				var z1	: Number 	= xyzData[uint(ii1 + 2)];
+				var x2	: Number 	= xyzData[ii2];
+				var y2	: Number 	= xyzData[uint(ii2 + 1)];
+				var z2	: Number 	= xyzData[uint(ii2 + 2)];
+
+				nx = (y0 - y2) * (z0 - z1) - (z0 - z2) * (y0 - y1);
+				ny = (z0 - z2) * (x0 - x1) - (x0 - x2) * (z0 - z1);
+				nz = (x0 - x2) * (y0 - y1) - (y0 - y2) * (x0 - x1);
+
+				mag = Math.sqrt(nx * nx + ny * ny + nz * nz);
+
+				if (mag != 0.)
+				{
+					nx /= mag;
+					ny /= mag;
+					nz /= mag;
+				}
+
+				ii0 = i0 * normalsVertexSize + normalsOffset;
+				ii1 = i1 * normalsVertexSize + normalsOffset;
+				ii2 = i2 * normalsVertexSize + normalsOffset;
+
+				normalsData[ii0] += nx;
+				normalsData[uint(ii0 + 1)] += ny;
+				normalsData[uint(ii0 + 2)] += nz;
+
+				normalsData[ii1] += nx;
+				normalsData[uint(ii1 + 1)] += ny;
+				normalsData[uint(ii1 + 2)] += nz;
+
+				normalsData[ii2] += nx;
+				normalsData[uint(ii2 + 1)] += ny;
+				normalsData[uint(ii2 + 2)] += nz;
+			}
+
+			for (i = 0; i < numVertices; ++i)
+			{
+				i0 = i * normalsVertexSize + normalsOffset;
+				i1 = i * normalsVertexSize + normalsOffset + 1;
+				i2 = i * normalsVertexSize + normalsOffset + 2;
+
+				nx = normalsData[i0];
+				ny = normalsData[i1];
+				nz = normalsData[i2];
+
+				mag = Math.sqrt(nx * nx + ny * ny + nz * nz);
+
+				if (mag != 0.)
+				{
+					normalsData[i0] = nx / mag;
+					normalsData[i1] = ny / mag;
+					normalsData[i2] = nz / mag;
+				}
+			}
+
+			normalsStream.unlock();
+			if (xyzStream.locked)
+				xyzStream.unlock(false);
+		}
+
+		private function fillTangentsData(indices			: Vector.<uint>,
+										  tangentsStream	: VertexStream,
+										  xyzStream			: VertexStream,
+										  uvStream			: VertexStream,
+										  numVertices		: uint) : void
+		{
+			var numTriangles		: uint				= indices.length / 3;
+			var xyzOffset			: uint				= xyzStream.format.getOffsetForComponent(VertexComponent.XYZ);
+			var xyzVertexSize		: uint				= xyzStream.format.size;
+			var xyzData				: Vector.<Number>	= xyzStream.lock();
+			var uvOffset			: uint				= uvStream.format.getOffsetForComponent(VertexComponent.UV);
+			var uvVertexSize		: uint				= uvStream.format.size;
+			var uvData				: Vector.<Number>	= null;
+			var tangentsOffset		: uint				= tangentsStream.format.getOffsetForComponent(VertexComponent.TANGENT);
+			var tangentsVertexSize	: uint				= tangentsStream.format.size;
+			var tangentsData		: Vector.<Number>	= null;
+
+			uvData = uvStream == xyzStream ? xyzData : uvStream.lock();
+			tangentsData = tangentsStream == xyzStream ? xyzData : tangentsStream.lock();
+
+			for (var i : uint = 0; i < numTriangles; ++i)
+			{
+				var ii 		: uint		= i * 3;
+
+				var i0		: uint 		= indices[ii];
+				var i1		: uint 		= indices[uint(ii + 1)];
+				var i2		: uint 		= indices[uint(ii + 2)];
+
+				var ii0		: uint 		= xyzOffset + xyzVertexSize * i0;
+				var ii1		: uint		= xyzOffset + xyzVertexSize * i1;
+				var ii2		: uint 		= xyzOffset + xyzVertexSize * i2;
+
+				var x0		: Number 	= xyzData[ii0];
+				var y0		: Number 	= xyzData[uint(ii0 + 1)];
+				var z0		: Number 	= xyzData[uint(ii0 + 2)];
+				var u0		: Number	= uvData[uint(uvOffset + uvVertexSize * i0)];
+				var v0		: Number	= uvData[uint(uvOffset + uvVertexSize * i0 + 1)];
+
+				var x1		: Number 	= xyzData[ii1];
+				var y1		: Number 	= xyzData[uint(ii1 + 1)];
+				var z1		: Number 	= xyzData[uint(ii1 + 2)];
+				var u1		: Number	= uvData[int(uvOffset + uvVertexSize * i1)];
+				var v1		: Number	= uvData[int(uvOffset + uvVertexSize * i1 + 1)];
+
+				var x2		: Number 	= xyzData[ii2];
+				var y2		: Number 	= xyzData[uint(ii2 + 1)];
+				var z2		: Number 	= xyzData[uint(ii2 + 2)];
+				var u2		: Number	= uvData[uint(uvOffset + uvVertexSize * i2)];
+				var v2		: Number	= uvData[uint(uvOffset + uvVertexSize * i2 + 1)];
+
+				var v0v2	: Number 	= v0 - v2;
+				var v1v2 	: Number 	= v1 - v2;
+				var coef 	: Number 	= (u0 - u2) * v1v2 - (u1 - u2) * v0v2;
+
+				if (coef == 0.)
+					coef = 1.;
+				else
+					coef = 1. / coef;
+
+				var tx 	: Number 	= coef * (v1v2 * (x0 - x2) - v0v2 * (x1 - x2));
+				var ty 	: Number 	= coef * (v1v2 * (y0 - y2) - v0v2 * (y1 - y2));
+				var tz 	: Number 	= coef * (v1v2 * (z0 - z2) - v0v2 * (z1 - z2));
+				var mag	: Number	= Math.sqrt(tx * tx + ty * ty + tz * tz);
+
+				if (mag != 0.)
+				{
+					tx /= mag;
+					ty /= mag;
+					tz /= mag;
+				}
+
+				ii0 = i0 * tangentsVertexSize + tangentsOffset;
+				ii1 = i1 * tangentsVertexSize + tangentsOffset;
+				ii2 = i2 * tangentsVertexSize + tangentsOffset;
+
+				tangentsData[ii0] += tx;
+				tangentsData[uint(ii0 + 1)] += ty;
+				tangentsData[uint(ii0 + 2)] += tz;
+
+				tangentsData[ii1] += tx;
+				tangentsData[uint(ii1 + 1)] += ty;
+				tangentsData[uint(ii1 + 2)] += tz;
+
+				tangentsData[ii2] += tx;
+				tangentsData[uint(ii2 + 1)] += ty;
+				tangentsData[uint(ii2 + 2)] += tz;
+			}
+
+			for (i = 0; i < numVertices; ++i)
+			{
+				ii = i * tangentsVertexSize + tangentsOffset;
+				tx = tangentsData[ii];
+				ty = tangentsData[uint(ii + 1)];
+				tz = tangentsData[uint(ii + 2)];
+				mag = Math.sqrt(tx * tx + ty * ty + tz * tz);
+
+				if (mag != 0.)
+				{
+					tx /= mag;
+					ty /= mag;
+					tz /= mag;
+				}
+
+				tangentsData[ii] = tx;
+				tangentsData[uint(ii + 1)] = ty;
+				tangentsData[uint(ii + 2)] = tz;
+			}
+
+			xyzStream.unlock(tangentsStream == xyzStream);
+			if (uvStream.locked)
+				uvStream.unlock(false);
+			if (tangentsStream.locked)
+				tangentsStream.unlock();
+		}
+
+		/*public function computeTangentSpace(streamUsage : uint, replace : Boolean = false) : Geometry
 		{
 			var indices			: Vector.<uint>	= _indexStream._data;
 			var numTriangles	: int			= _indexStream.length / 3;
@@ -457,7 +694,7 @@
 				var uvStream		: VertexStream		= stream.getStreamByComponent(VertexComponent.UV);

 				if (!uvStream)
-					throw new Error("Missing vertex components u, v.");
+					throw new Error('Missing vertex components u, v.');

 				var uvOffset		: int 				= uvStream.format.getOffsetForComponent(VertexComponent.UV);
 				var uvSize			: int 				= uvStream.format.size;
@@ -598,7 +835,7 @@
 					}
 				}

-				pushVertexStream(
+				pushVertexStreamInList(
 					streamId,
 					new VertexStream(streamUsage, withNormals ? FORMAT_TN : FORMAT_TANGENTS, data),
 					replace
@@ -606,11 +843,11 @@
 			}

 			return this;
-		}
-
-		private function pushVertexStream(index 		: int,
-										  vertexStream 	: VertexStream,
-										  force 		: Boolean	= false) : void
+		}*/
+
+		private function pushVertexStreamInList(index 			: uint,
+												vertexStream 	: VertexStream,
+												force 			: Boolean	= false) : void
 		{
 			var stream	: IVertexStream	= _vertexStreams[index];


_dynamicServiceLayerInfos is populated before setting visible layers

--- src/com/esri/viewer/components/toc/tocClasses/TocMapLayerItem.as
+++ src/com/esri/viewer/components/toc/tocClasses/TocMapLayerItem.as
@@ -423,15 +423,14 @@
         else if (layer is ArcGISDynamicMapServiceLayer)
         {
             var arcGISDynamicMapServiceLayer:ArcGISDynamicMapServiceLayer = ArcGISDynamicMapServiceLayer(layer);
+            _dynamicMapServiceLayerInfos = arcGISDynamicMapServiceLayer.dynamicLayerInfos ? arcGISDynamicMapServiceLayer.dynamicLayerInfos : arcGISDynamicMapServiceLayer.layerInfos;
             if (!arcGISDynamicMapServiceLayer.visibleLayers)
             {
                 var visLayers:Array = getActualVisibleLayers(MapServiceUtil.getVisibleSubLayers(_dynamicMapServiceLayerInfos), _dynamicMapServiceLayerInfos);
                 arcGISDynamicMapServiceLayer.visibleLayers = new ArrayCollection(visLayers);
             }
-            arcGISDynamicMapServiceLayer.visibleLayers.addEventListener(CollectionEvent.COLLECTION_CHANGE, visibleLayersChangeHandler);
-
-            _visibleLayersChangeWatcher = ChangeWatcher.watch(arcGISDynamicMapServiceLayer, "visibleLayers", visibleLayersChange);
-            _dynamicMapServiceLayerInfos = arcGISDynamicMapServiceLayer.dynamicLayerInfos ? arcGISDynamicMapServiceLayer.dynamicLayerInfos : arcGISDynamicMapServiceLayer.layerInfos;
+            arcGISDynamicMapServiceLayer.visibleLayers.addEventListener(CollectionEvent.COLLECTION_CHANGE, visibleLayersChangeHandler);
+            _visibleLayersChangeWatcher = ChangeWatcher.watch(arcGISDynamicMapServiceLayer, "visibleLayers", visibleLayersChange);
             if (_isVisibleLayersSet)
             {
                 layerInfos = [];


Transferred from the Adobe Open Source Subversion Repository

Revision: 23247
Author:   cframpto@adobe.com
Date:     2011-12-20T19:21:13.134833Z

Log Message:
-----------
Remove ADOBE SYSTEMS license and replace with Apache license in headers - frameworks.  A 2nd pass will be needed to get the files not handled up by the scripts.

Modified Paths:
--------------
4959 paths were modified

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

--- frameworks/projects/advancedgrids/src/mx/collections/GroupingCollection2.as
+++ frameworks/projects/advancedgrids/src/mx/collections/GroupingCollection2.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2009 Adobe Systems Incorporated
-//  All Rights Reserved.
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You 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
 //
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
+//      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.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////


Made findHeaderRenderer protected and removed @private

--- frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGridBaseEx.as
+++ frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGridBaseEx.as
@@ -6192,8 +6192,6 @@

     /**
      *  A helper method to determine which item renderer is under the mouse.
-     *
-     *  @private
      */
     protected function findRenderer(pt:Point,items:Array,info:Array,yy:Number = 0):IListItemRenderer
     {
@@ -6238,10 +6236,8 @@

     /**
      *  A helper method to determine which item renderer is under the mouse.
-     *
-     *  @private
      */
-    private function findHeaderRenderer(pt:Point):IListItemRenderer
+    protected function findHeaderRenderer(pt:Point):IListItemRenderer
     {
         var r:IListItemRenderer;
         var yy:Number = 0;


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package spark.automation.events
 {


added RingBuffer.every(), RingBuffer.forEach(), RingBuffer.indexOf()

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

--- src/as/com/threerings/util/RingBuffer.as
+++ src/as/com/threerings/util/RingBuffer.as
@@ -171,6 +171,51 @@
             return _array[index];
         }
     }
+
+    /**
+     * Executes a test function on each item in the ring buffer
+     * until an item is reached that returns false for the specified
+     * function.
+     *
+     * Returns a Boolean value of true if all items in the buffer return
+     * true for the specified function; otherwise, false.
+     */
+    public function every (callback :Function, thisObject :* = null) :Boolean
+    {
+        for (var i :int = 0; i < _length; ++i) {
+            if (!callback.apply(thisObject, this.at(i))) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    /**
+     * Executes a function on each item in the ring buffer.
+     */
+    public function forEach (callback :Function, thisObject :* = null) :void
+    {
+        for (var i :int = 0; i < _length; ++i) {
+            callback.apply(thisObject, this.at(i));
+        }
+    }
+
+    /**
+     * Searches for an item in the ring buffer by using strict equality
+     * (===) and returns the index position of the item, or -1
+     * if the item is not found.
+     */
+    public function indexOf (searchElement :*, fromIndex :int = 0) :int
+    {
+        for (var i :int = 0; i < _length; ++i) {
+            if (this.at(i) === searchElement) {
+                return i;
+            }
+        }
+
+        return -1;
+    }

     protected var _array :Array = new Array();
     protected var _capacity :uint;


rename external interface callbacks.

rename external interface callbacks.

It seems that some function names are reserved in IE.
(cf: http://zaalabs.com/2011/01/adobe-flash-externalinterface-issues-with-internet-explorer/)
Prefix function names with player. But it will break backward compatibility with older version of player.

--- src/org/mangui/chromeless/ChromelessPlayer.as
+++ src/org/mangui/chromeless/ChromelessPlayer.as
@@ -1,4 +1,4 @@
-package org.mangui.chromeless {
+package org.mangui.chromeless {

     import org.mangui.HLS.parsing.Level;
@@ -11,7 +11,7 @@
     import flash.media.SoundTransform;
     import flash.media.StageVideo;
     import flash.media.StageVideoAvailability;
-    import flash.utils.setTimeout;
+    import flash.utils.setTimeout;

     public class ChromelessPlayer extends Sprite {
@@ -50,15 +50,15 @@
             ExternalInterface.addCallback("getmaxBufferLength",_getmaxBufferLength);
             ExternalInterface.addCallback("getbufferLength",_getbufferLength);
             // Connect calls to JS.
-            ExternalInterface.addCallback("load",_load);
-            ExternalInterface.addCallback("play",_play);
-            ExternalInterface.addCallback("pause",_pause);
-            ExternalInterface.addCallback("resume",_resume);
-            ExternalInterface.addCallback("seek",_seek);
-            ExternalInterface.addCallback("stop",_stop);
-            ExternalInterface.addCallback("volume",_volume);
-            ExternalInterface.addCallback("setLevel",_setLevel);
-            ExternalInterface.addCallback("setmaxBufferLength",_setmaxBufferLength);
+            ExternalInterface.addCallback("playerLoad",_load);
+            ExternalInterface.addCallback("playerPlay",_play);
+            ExternalInterface.addCallback("playerPause",_pause);
+            ExternalInterface.addCallback("playerResume",_resume);
+            ExternalInterface.addCallback("playerSeek",_seek);
+            ExternalInterface.addCallback("playerStop",_stop);
+            ExternalInterface.addCallback("playerVolume",_volume);
+            ExternalInterface.addCallback("playerSetLevel",_setLevel);
+            ExternalInterface.addCallback("playerSetmaxBufferLength",_setmaxBufferLength);
             setTimeout(_pingJavascript,50);
         };

@@ -78,13 +78,13 @@
                 ExternalInterface.call("onError",event.message);
             }
         };
-
+
         private function _fragmentHandler(event:HLSEvent):void {
             if (ExternalInterface.available) {
                 ExternalInterface.call("onFragment",event.metrics.bandwidth,event.metrics.level,event.metrics.screenwidth);
             }
         };
-
+
         private function _manifestHandler(event:HLSEvent):void {
             if (ExternalInterface.available) {
                 ExternalInterface.call("onManifest",event.levels[0].duration);
@@ -169,4 +169,4 @@
     }

-}+}


Fixed an issue with console text not displaying when the console is first displayed

--- src/justpinegames/Logi/Console.as
+++ src/justpinegames/Logi/Console.as
@@ -303,7 +303,8 @@
 			};

 			// TODO use the correct API, currently there is a problem with List max vertical position. A bug in foxhole?
-			_list.verticalScrollPosition = _list.dataProvider.length * 20;
+			_list.verticalScrollPosition = Math.max(_list.dataProvider.length * 20 - _list.height, 0);
+
 		}

 		/**


typo fix

typo fix

--- actionscript/src/com/freshplanet/ane/AirAACPlayer/AirAACPlayer.as
+++ actionscript/src/com/freshplanet/ane/AirAACPlayer/AirAACPlayer.as
@@ -47,7 +47,7 @@

 			var file:File = File.applicationDirectory.resolvePath(path);
 			if(!file.exists) {
-				logSimpleSound("File with path " + path + " does not existing in File.applicationDirectory");
+				logSimpleSound("File with path " + path + " does not exist in File.applicationDirectory");
 				return;
 			}


Transferred from the Adobe Open Source Subversion Repository

Revision: 7334
Author:   aharui@adobe.com
Date:     2009-05-27T21:05:18.186042Z

Log Message:
-----------
NumericStepper feature complete bugs.

QE Notes: None
Doc Notes: None
Bugs: SDK-17720, SDK-18981, SDK-18917, SDK-16629
Reviewer: carol, glenn
tests: checkintests mustella/gumbo/components/FxNumericStepper

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/NumericStepperSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/default/NumericStepperSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/NumericStepperTextInputSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/default/NumericStepperTextInputSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/SpinnerSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/RichEditableTextContainerManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/default/SpinnerSkin.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/RichEditableTextContainerManager.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/RichEditableTextContainerManager.as
@@ -227,6 +227,22 @@
         super.focusInHandler(event);
     }

+    /**
+     *  @private
+     */
+    override public function setText(text:String):void
+    {
+        super.setText(text);
+        if (textView.systemManager.stage.focus == textView)
+        {
+            var im:ISelectionManager = beginInteraction();
+            im.setSelection(int.MAX_VALUE, int.MAX_VALUE);
+            im.refreshSelection();
+            im.setFocus();
+            endInteraction();
+       }
+    }
+
 }

 }


FileSharingService impliments DB service

Filesharing service uses db service vs a remote mysql connection

--- src/sfxworks/services/FileSharingService.as
+++ src/sfxworks/services/FileSharingService.as
@@ -1,10 +1,9 @@
-package sfxworks.services
+package sfxworks.services
 {
 	import by.blooddy.crypto.MD5; //Awesome guy
-	import com.maclema.mysql.Connection;
-	import com.maclema.mysql.MySqlToken;
-	import com.maclema.mysql.ResultSet;
-	import com.maclema.mysql.Statement;
+	import flash.data.SQLResult;
+	import flash.data.SQLStatement;
+	import flash.errors.SQLError;
 	import flash.events.Event;
 	import flash.events.EventDispatcher;
 	import flash.filesystem.File;
@@ -15,7 +14,7 @@
 	import sfxworks.Communications;
 	import sfxworks.NetworkGroupEvent;
 	import flash.errors.IOError;
-	import mx.rpc.AsyncResponder;
+	import sfxworks.services.events.DatabaseServiceEvent;
 	import sfxworks.services.events.FileSharingEvent;
 	/**
 	 * ...
@@ -25,7 +24,6 @@
 	{
 		//Fetch public file listing from mysqldb
 		private var c:Communications;
-		private var mysqlConnection:Connection;
 		private var fileSharingInfo:File;

 		private var _filePaths:Vector.<String>;
@@ -66,7 +64,7 @@

 		//Tmp for browse for save
-		private var resultSets:Vector.<ResultSet>;
+		private var resultSets:Vector.<SQLResult>;
 		private var saveLocations:Vector.<File>;

@@ -76,10 +74,8 @@
 		public function FileSharingService(communications:Communications)
 		{
 			c = communications;
-
-			mysqlConnection = new Connection("-.sfxworks.net", 9001, "-", "-", "-");
-			mysqlConnection.connect();
-			mysqlConnection.addEventListener(Event.CONNECT, handleMysqlConnection);
+			c.databaseService.connectToDatabase(SERVICE_NAME);
+			c.databaseService.addEventListener(DatabaseServiceEvent.CONNECTED, handleDatabaseConnection);

 			fileSharingInfo = File.applicationStorageDirectory.resolvePath("services" + File.separator + "filesharingservice" + File.separator + "infoE");

@@ -92,41 +88,56 @@
 			numberOfConnectedGroups = new Number(0);
 		}

-		private function handleMysqlConnection(e:Event):void
+		private function handleDatabaseConnection(e:DatabaseServiceEvent):void
 		{
 			//Mysql format: id(autogen) | FileName.ext | Start Index | EndIndex |  groupID | md5
 			//18446744073709551615 per table :D
-			mysqlConnection.removeEventListener(Event.CONNECT, handleMysqlConnection);
-			trace("File sharing service connected to central database..");
+			c.databaseService.removeEventListener(DatabaseServiceEvent.CONNECTED, handleDatabaseConnection);
+			trace("File sharing service connected to peer database.");
+			var check:SQLStatement = new SQLStatement();
+
+			var sql:String = "CREATE TABLE IF NOT EXISTS files (" +
+				"    id PRIMARY KEY, " +
+				"    filename TEXT, " +
+				"    startindex NUMBER," +
+				"    endindex NUMBER," +
+				"    groupID NUMBER," +
+				"    md5 TEXT" +
+				");";
+			check.text = sql;
+
+			var checkResult = c.databaseService.writeToDB(SERVICE_NAME, check);
+			if (checkResult is SQLError)
+			{
+				dispatchEvent(new FileSharingEvent(FileSharingEvent.ERROR, checkResult));
+				return;
+			}
+
 			//Get the last row in the table
-			var st:Statement = mysqlConnection.createStatement();
-			st.sql = "SELECT * FROM files "
+			var st:SQLStatement = new SQLStatement();
+			st.text = "SELECT * FROM files "
 				+ "ORDER BY `id` DESC "
 				+ "LIMIT 1;";
-			var t:MySqlToken = st.executeQuery();
-			t.addResponder(new AsyncResponder(getLastRowInitSuccess, getLastRowInitError, t));
-		}
-
-		private function getLastRowInitError(info:Object, token:MySqlToken):void
-		{
-			trace("Last row get error: " + info);
-			dispatchEvent(new FileSharingEvent(FileSharingEvent.ERROR));
-		}
-
-		private function getLastRowInitSuccess(data:Object, token:MySqlToken):void
-		{
-			var rs:ResultSet = new ResultSet(token);
-			if (rs.next())
-			{
-				numberOfGroups = parseFloat(rs.getString("groupID")); //The last row, in the groupID column will have the number of groups.
+
+			var fetchResult = c.databaseService.readFromDB(SERVICE_NAME, st);
+			if (fetchResult is SQLError)
+			{
+				dispatchEvent(new FileSharingEvent(FileSharingEvent.ERROR, checkResult));
+				return;
+			}
+			//t.addResponder(new AsyncResponder(getLastRowInitSuccess, getLastRowInitError, t));
+			if ((fetchResult as SQLResult).data == null)
+			{
+				numberOfGroups = 0;
 			}
 			else
 			{
-				numberOfGroups = 0;
+				numberOfGroups = (fetchResult as SQLResult).data[0].groupID;
 			}

 			trace("Response successful.");
 			trace("Number of groups = " + numberOfGroups);
+
 			for (var i:Number = 0; i < numberOfGroups+1; i++)
 			{
 				var gs:GroupSpecifier = new GroupSpecifier(SERVICE_NAME + i.toString());
@@ -139,6 +150,7 @@
 				c.addEventListener(NetworkGroupEvent.CONNECTION_SUCCESSFUL, handleGroupConnectionSuccessful);
 				c.addEventListener(NetworkGroupEvent.CONNECTION_FAILED, handleGroupConnectionFailed);
 			}
+
 		}

 		private function handleGroupConnectionFailed(e:NetworkGroupEvent):void
@@ -255,119 +267,107 @@
 			}

 			//Get the last row in the table
-			var st:Statement = mysqlConnection.createStatement();
-			st.sql = "SELECT * FROM files "
+
+			var st:SQLStatement = new SQLStatement();
+			st.text = "SELECT * FROM files "
 				+ "ORDER BY `id` DESC "
 				+ "LIMIT 1;";
-			var t:MySqlToken = st.executeQuery();
-			t.addResponder(new AsyncResponder(getLastRowAddFileSuccess, mysqlNearIDUpdateError, t));
-
-			//It's inside a function so I can handle a ton of addFile() methods at once since it's asyncronous
-			function getLastRowAddFileSuccess(data:Object, token:MySqlToken):void
-			{
-				var fs:FileStream = new FileStream();
-				var rs:ResultSet = new ResultSet(token);
-
-				var lastEndIndex:Number;
-				if (rs.next())
+			var result = c.databaseService.readFromDB(SERVICE_NAME, st);
+
+			if (result is SQLError)
+			{
+				trace("MYSQL ERROR: " + result);
+				dispatchEvent(new FileSharingEvent(FileSharingEvent.ERROR, result, file.name));
+				return;
+			}
+
+			if ((result as SQLResult).data[0] == null)
+			{
+				lastEndIndex = 0;
+			}
+			else
+			{
+				var lastEndIndex:Number = (result as SQLResult).data[0].groupID;
+			}
+
+
+			var numberOfSplits:Number = Math.ceil(file.size / SPLIT_SIZE);
+
+			if (lastEndIndex + numberOfSplits > 9007199254740992)
+			{
+				//A new group must be made. Tell all clients.
+				numberOfGroups ++;
+			}
+			var startIndex:Number = lastEndIndex + 1;
+			var endIndex:Number = startIndex + numberOfSplits;
+
+			//write to sql ---
+
+			//generate md5s
+			var md5s:String = new String()
+			var fileData:ByteArray = new ByteArray();
+			fs.open(file, FileMode.READ);
+				for (var i:Number = 0; i < numberOfSplits; i++)
 				{
-					lastEndIndex = parseFloat(rs.getString("groupID"));
-				}
-				else
-				{
-					lastEndIndex = 0;
-				}
-
-				var numberOfSplits:Number = Math.ceil(file.size / SPLIT_SIZE);
-
-				if (lastEndIndex + numberOfSplits > 9007199254740992)
-				{
-					//A new group must be made. Tell all clients.
-					numberOfGroups ++;
-				}
-				var startIndex:Number = lastEndIndex + 1;
-				var endIndex:Number = startIndex + numberOfSplits;
-
-				//write to sql ---
-
-				//generate md5s
-				var md5s:String = new String()
-				var fileData:ByteArray = new ByteArray();
-				fs.open(file, FileMode.READ);
-					for (var i:Number = 0; i < numberOfSplits; i++)
+					var tmp:ByteArray = new ByteArray();
+
+					var toRead:Number = SPLIT_SIZE;
+					if (fs.bytesAvailable < SPLIT_SIZE)
 					{
-						var tmp:ByteArray = new ByteArray();
-
-						var toRead:Number = SPLIT_SIZE;
-						if (fs.bytesAvailable < SPLIT_SIZE)
-						{
-							toRead = fs.bytesAvailable;
-						}
-
-						fs.readBytes(tmp, 0, toRead);
-						var newMd5:String = MD5.hashBytes(tmp);
-						md5s = md5s + newMd5;
-						trace("MD5 HASH:" + newMd5 + " for file sector " + i.toString());
-					}
-				fs.close();
-
-				//Mysql format: id(autogen) | FileName.ext | Start Index | EndIndex |  groupID | md5
-				var submitSt:Statement = mysqlConnection.createStatement();
-				submitSt.sql = "INSERT INTO files (`filename`, `startindex`, `endindex`, `groupid`, `md5`)"
-					+ " VALUES ('" + file.name + "'," + startIndex.toString() + "," + endIndex.toString() + "," + numberOfGroups.toString() + ",'" + md5s + "');";
-
-				trace("Submitting file to central database..");
-				var submitToken:MySqlToken = submitSt.executeQuery();
-				submitToken.addResponder(new AsyncResponder(submitSuccess, submitFailure, submitToken));
-
-				//Yo dawg I heard you like functions
-				function submitSuccess(data:Object, token:MySqlToken):void
-				{
-					trace("Writing to group..");
-					//write to group
-					c.addHaveObject(SERVICE_NAME + numberOfGroups.toString(), startIndex, endIndex);
-
-					//write to index
-					trace("Writing to index..");
-					for (var i:Number = startIndex; i < endIndex; i++)
-					{
-						_filePaths.push(file.nativePath);
-						_fileIDs.push(i);
-						_groupIDs.push(numberOfGroups);
-						_fileStartIndex.push(startIndex);
-						_fileEndIndex.push(endIndex);
+						toRead = fs.bytesAvailable;
 					}

-					trace("Writing to filesharing info..");
-					//write to filesharinginfo
-					var fs:FileStream = new FileStream();
-
-					fs.open(fileSharingInfo, FileMode.WRITE);
-						fs.writeFloat(new Number(_filePaths.length)) //Write number of files to first float
-						fs.close();
-					fs.open(fileSharingInfo, FileMode.APPEND);
-						fs.writeUTF(file.nativePath);
-						fs.writeFloat(numberOfGroups);
-						fs.writeFloat(lastEndIndex + 1);
-						fs.close();
-
-					dispatchEvent(new FileSharingEvent(FileSharingEvent.FILE_ADDED, "Successfully added file " + file.name, file.nativePath, startIndex, endIndex
-					, numberOfGroups));
+					fs.readBytes(tmp, 0, toRead);
+					var newMd5:String = MD5.hashBytes(tmp);
+					md5s = md5s + newMd5;
+					trace("MD5 HASH:" + newMd5 + " for file sector " + i.toString());
 				}
+			fs.close();
+
+			//Mysql format: id(autogen) | FileName.ext | Start Index | EndIndex |  groupID | md5
+			var submitSt:SQLStatement = new SQLStatement();
+			submitSt.text = "INSERT INTO files (`filename`, `startindex`, `endindex`, `groupid`, `md5`)"
+				+ " VALUES ('" + file.name + "'," + startIndex.toString() + "," + endIndex.toString() + "," + numberOfGroups.toString() + ",'" + md5s + "');";

-				function submitFailure(data:Object, token:MySqlToken):void
-				{
-					trace("Final submit failure. Mysql Error: " + data);
-					dispatchEvent(new FileSharingEvent(FileSharingEvent.ERROR, "Failed to added file " + file.name + ". Couldn't submit to database..."));
-					return;
-				}
-			}
-
-			function mysqlNearIDUpdateError(info:Object, token:MySqlToken):void
-			{
-				trace("MYSQL ERROR: " + info);
-				dispatchEvent(new FileSharingEvent(FileSharingEvent.ERROR, "Failed to contact database for file submission.", file.name));
-			}
+			trace("Submitting file to p2p database..");
+			var submitResult = c.databaseService.writeToDB(SERVICE_NAME, submitSt);
+
+			if (submitResult is SQLError)
+			{
+				trace("Final submit failure. Mysql Error: " + submitResult);
+				dispatchEvent(new FileSharingEvent(FileSharingEvent.ERROR, "Failed to added file " + file.name + ". Couldn't submit to database..."));
+				return;
+			}
+
+			trace("Writing to group..");
+			//write to group
+			c.addHaveObject(SERVICE_NAME + numberOfGroups.toString(), startIndex, endIndex);
+
+			//write to index
+			trace("Writing to index..");
+			for (var i:Number = startIndex; i < endIndex; i++)
+			{
+				_filePaths.push(file.nativePath);
+				_fileIDs.push(i);
+				_groupIDs.push(numberOfGroups);
+				_fileStartIndex.push(startIndex);
+				_fileEndIndex.push(endIndex);
+			}
+
+			trace("Writing to filesharing info..");
+			//write to filesharinginfo
+			var fs:FileStream = new FileStream();
+
+			fs.open(fileSharingInfo, FileMode.WRITE);
+				fs.writeFloat(new Number(_filePaths.length)) //Write number of files to first float
+				fs.close();
+			fs.open(fileSharingInfo, FileMode.APPEND);
+				fs.writeUTF(file.nativePath);
+				fs.writeFloat(numberOfGroups);
+				fs.writeFloat(lastEndIndex + 1);
+				fs.close();
+
+			dispatchEvent(new FileSharingEvent(FileSharingEvent.FILE_ADDED, "Successfully added file " + file.name, file.nativePath, startIndex, endIndex, numberOfGroups));
 		}

@@ -375,34 +375,30 @@
 		{
 			var file:File = new File();

-			var statement:Statement = mysqlConnection.createStatement();
-			statement.sql = "SELECT * from `files` WHERE `publickey`=" + groupNumber.toString() + " AND `startindex`=" + startIndex.toString() + ";";
-			var token:MySqlToken = statement.executeQuery();
-
-			token.addResponder(new AsyncResponder(getFileInfoSuccess, getFileInfoFailure, token));
-
-			function getFileInfoSuccess(data:Object, token:MySqlToken):void
-			{
-				var resultSet:ResultSet = new ResultSet(token);
-				//Mysql format: id(autogen) | FileName.ext | Start Index | EndIndex |  groupID | md5
-
-				if (resultSet.next())
-				{
-					//Reference to file exists. Browse for save..
-					file.browseForDirectory("Select a location to save the file..");
-					file.addEventListener(Event.SELECT, handleBrowseForSaveSelection);
-					//tmp index
-					saveLocations.push(file);
-					resultSets.push(resultSet);
-				}
-				else
-				{
-					dispatchEvent(new FileSharingEvent(FileSharingEvent.ERROR, "No file by that ID exists in the public database.."));
-				}
-			}
-			function getFileInfoFailure(data:Object, token:MySqlToken):void
-			{
-				dispatchEvent(new FileSharingEvent(FileSharingEvent.ERROR, "MYSQL Error: " + data));
+			var statement:SQLStatement = new SQLStatement();
+			statement.text = "SELECT * from `files` WHERE `publickey`=" + groupNumber.toString() + " AND `startindex`=" + startIndex.toString() + ";";
+
+			var result = c.databaseService.readFromDB(SERVICE_NAME, statement);
+			if (result is SQLError)
+			{
+				dispatchEvent(new FileSharingEvent(FileSharingEvent.ERROR, "MYSQL Error: " + (result as SQLError).details));
+				return;
+			}
+
+			//Mysql format: id(autogen) | FileName.ext | Start Index | EndIndex |  groupID | md5
+
+			if ((result as SQLResult).data.length == -1)
+			{
+				dispatchEvent(new FileSharingEvent(FileSharingEvent.ERROR, "No file by that ID exists in the public database.."));
+			}
+			else
+			{
+				//Reference to file exists. Browse for save..
+				file.browseForDirectory("Select a location to save the file..");
+				file.addEventListener(Event.SELECT, handleBrowseForSaveSelection);
+				//tmp index
+				saveLocations.push(file);
+				resultSets.push(result);
 			}
 		}

@@ -410,19 +406,19 @@
 		{
 			e.target.removeEventListener(Event.SELECT, handleBrowseForSaveSelection);

-			var resultSet:ResultSet = resultSets[saveLocations.indexOf(e.target)];
+			var resultSet:SQLResult = resultSets[saveLocations.indexOf(e.target)];
 			resultSets.splice(resultSets.indexOf(resultSet),1);//Remove from tmp index
 			saveLocations.splice(saveLocations.indexOf(e.target),1); //Remove from tmp index

-			var groupNumber:Number = resultSet.getNumber("groupid");
-			var startIndex:Number = resultSet.getNumber("startindex");
-			var endIndex:Number = resultSet.getNumber("endindex");
-
+			var groupNumber:Number = resultSet.data[0].groupid;
+			var startIndex:Number = resultSet.data[0].startindex;
+			var endIndex:Number = resultSet.data[0].endindex;
+
 			var filePartListing:Vector.<Number> = new Vector.<Number>();
 			var filePathListing:Vector.<String> = new Vector.<String>();;
 			var fileMd5Listing:Vector.<String> = new Vector.<String>();;

-			var mdraw:Array = resultSet.getString("md5").split(",");
+			var mdraw:Array = resultSet.data[0].md5.split(",");

 			for (var i:Number = startIndex; i < endIndex; i++)
 			{
@@ -434,10 +430,10 @@
 			//Order [idnumbers][paths] max | md5 | name | groupID | locationToSave
 			filesToHandle.push(filePartListing); //idnumbers
 			filesToHandle.push(filePathListing); //paths
-			filesToHandle.push(resultSet.getInt("endindex"));
-			filesToHandle.push(resultSet.getString("md5"));
-			filesToHandle.push(resultSet.getString("filename"));
-			filesToHandle.push(resultSet.getInt("groupID"));
+			filesToHandle.push(resultSet.data[0].endindex);
+			filesToHandle.push(resultSet.data[0].md5);
+			filesToHandle.push(resultSet.data[0].filename);
+			filesToHandle.push(resultSet..data[0].groupID);
 			filesToHandle.push(e.target);

 			c.addWantObject(SERVICE_NAME + groupNumber.toString(), startIndex, endIndex);


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

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

 package spark.skins.mobile
 {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/spark/src/spark/components/supportClasses/TouchScrollHelper.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/TouchScrollHelper.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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.components.supportClasses
 {


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

--- frameworks/projects/spark/src/spark/components/supportClasses/TouchScrollHelper.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/TouchScrollHelper.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.components.supportClasses
 {


qnd: perform detection only for video entries

git-svn-id: 3f608e5a9a704dd448217c0a64c508e7f145cfa1@92294 6b8eccd3-e8c5-4e7d-8186-e12b5326b719

--- plugins/bitrateDetectionPlugin/src/com/kaltura/kdpfl/plugin/component/BitrateDetectionMediator.as
+++ plugins/bitrateDetectionPlugin/src/com/kaltura/kdpfl/plugin/component/BitrateDetectionMediator.as
@@ -91,8 +91,11 @@

 					var mediaProxy:MediaProxy = facade.retrieveProxy(MediaProxy.NAME) as MediaProxy;
 					if (!mediaProxy.vo.entry ||
-						((mediaProxy.vo.entry is KalturaMediaEntry) && (int(mediaProxy.vo.entry.mediaType)==KalturaMediaType.IMAGE)))
+						((mediaProxy.vo.entry is KalturaMediaEntry) && (int(mediaProxy.vo.entry.mediaType)!=KalturaMediaType.VIDEO)))
+					{
+						trace ("--bitrate detection: no BW CHECK, not a video entry");
 						return;
+					}

 					if (_viewComp.runPreCheck)
 					{
@@ -101,7 +104,7 @@
 							var highBR:int = mediaProxy.vo.kalturaMediaFlavorArray[mediaProxy.vo.kalturaMediaFlavorArray.length - 1].bitrate;
 							if (0.8 * highBR <= mediaProxy.vo.preferedFlavorBR)
 							{
-								trace ("--bitrate detection: no BW CHECK");
+								trace ("--bitrate detection: no BW CHECK, no higher flavors");
 								//// if the last preferred bitrate is higher or equals (with 20% error range) to the current highest bitrate,
 								//no need to perform BW check
 								return;


compositecommand now should not throw any exceptions any more if cancel() or execute() is called before any commands are pushed

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

--- src/reprise/commands/CompositeCommand.as
+++ src/reprise/commands/CompositeCommand.as
@@ -63,7 +63,10 @@
 		//*****************************************************************************************
 		//*                                     Public Methods                                    *
 		//*****************************************************************************************
-		public function CompositeCommand() {}
+		public function CompositeCommand()
+		{
+			reset();
+		}

 		/**
@@ -89,7 +92,7 @@
 		public function addCommand(cmd:ICommand):void
 		{
 			// we automatically reset everything for a new run
-			if (!m_pendingCommands || (!m_isExecuting && !m_pendingCommands.length))
+			if (!m_isExecuting && !m_pendingCommands.length)
 			{
 				reset();
 			}
@@ -232,7 +235,7 @@
 		*/
 		protected function executeNext() : void
 		{
-			if (!m_pendingCommands || m_pendingCommands.length == 0 && m_currentCommands.length == 0)
+			if (m_pendingCommands.length == 0 && m_currentCommands.length == 0)
 			{
 				m_isExecuting = false;
 				// we only dispatch a event if we're executing asynchronously


added BoundingSphere.testRay()

added BoundingSphere.testRay()

--- src/aerys/minko/type/bounding/BoundingSphere.as
+++ src/aerys/minko/type/bounding/BoundingSphere.as
@@ -1,6 +1,8 @@
 package aerys.minko.type.bounding
 {
 	import aerys.minko.ns.minko_math;
+	import aerys.minko.type.math.Matrix4x4;
+	import aerys.minko.type.math.Ray;
 	import aerys.minko.type.math.Vector4;

@@ -14,6 +16,9 @@
 	{
 		use namespace minko_math;

+		private static const TMP_VECTOR4_1	: Vector4	= new Vector4();
+		private static const TMP_VECTOR4_2	: Vector4	= new Vector4();
+
 		private var _center	: Vector4	= new Vector4();
 		private var _radius	: Number	= 0;

@@ -56,7 +61,7 @@

 		private function centerChangedHandler(center : Vector4, property : String) : void
 		{
-			throw new Error("This property is read-only.");
+			throw new Error('This property is read-only.');
 		}

 		/**
@@ -91,5 +96,56 @@
 		{
 			return new BoundingSphere(_center, radius);
 		}
+
+		public function testRay(ray			: Ray,
+								transform 	: Matrix4x4	= null,
+								maxDistance	: Number	= Number.POSITIVE_INFINITY) : Number
+		{
+			var localOrigin		: Vector4	= ray.origin;
+			var localDirection 	: Vector4 	= ray.direction;
+
+			if (transform)
+			{
+				localOrigin = transform.transformVector(ray.origin, TMP_VECTOR4_1);
+
+				localDirection = transform.deltaTransformVector(ray.direction, TMP_VECTOR4_2);
+				localDirection.normalize();
+			}
+
+			if (localOrigin.length > maxDistance)
+				return -1.0;
+
+			var a 		: Number = localDirection.lengthSquared;
+			var b 		: Number = 2 * Vector4.dotProduct(localDirection, localOrigin);
+			var c 		: Number = localOrigin.lengthSquared - (_radius * _radius);
+			var disc 	: Number = b * b - 4 * a * c;
+
+			if (disc < 0)
+				return -1.0;
+
+			var distSqrt	: Number = Math.sqrt(disc);
+			var q 			: Number = 0.;
+
+			if (b < 0)
+				q = (-b - distSqrt) * 0.5;
+			else
+				q = (-b + distSqrt) * 0.5;
+
+			var t0 : Number = q / a;
+			var t1 : Number = c / q;
+
+			if (t0 > t1)
+			{
+				var tmp : Number = t0;
+
+				t0 = t1;
+				t1 = tmp;
+			}
+
+			if (t1 < 0)
+				return -1.0;
+
+			return t0 < 0 ? t1 : t0;
+		}
 	}
 }


Passes error registering callback with arguments

--- src/asfac/src/com/thedevstop/asfac/AsFactory.as
+++ src/asfac/src/com/thedevstop/asfac/AsFactory.as
@@ -1,5 +1,6 @@
 package com.thedevstop.asfac
 {
+	import avmplus.getQualifiedClassName;
 	import flash.errors.IllegalOperationError;
 	import flash.utils.describeType;
 	import flash.utils.Dictionary;
@@ -56,7 +57,9 @@

 		public function registerCallback(callback:Function, type:Class):void
 		{
-			var description:XML = describeType(callback);
+			if (callback.length > 0)
+				throw new IllegalOperationError("Callback function registered for {0} must not have arguments".replace("{0}", getQualifiedClassName(type)));
+
 			_registrations[type] = callback;
 		}


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package spark.components.gridClasses
 {


Revert "Stop RTE with DataGrid inside ViewStack"

This reverts commit 5048ff082d209b868a7c89d1013d51b15bda70eb.

--- frameworks/projects/mx/src/mx/controls/DataGrid.as
+++ frameworks/projects/mx/src/mx/controls/DataGrid.as
@@ -3589,10 +3589,6 @@
     protected function drawVerticalLine(s:Sprite, colIndex:int, color:uint, x:Number):void
     {
         var contentHolder:ListBaseContentHolder = s.parent.parent as ListBaseContentHolder;
-
-		if (isNaN(contentHolder.height))
-			return;
-
         //draw our vertical lines
         var g:Graphics = s.graphics;
         g.lineStyle();


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package mx.utils
 {


added targetIsVectorOrArray

added targetIsVectorOrArray

--- src/aze/motion/EazeTween.as
+++ src/aze/motion/EazeTween.as
@@ -163,7 +163,7 @@
 					if (t.slowTween)
 					{
 						if (t.autoVisible)
-						if (target is Array || isVector(target))
+						if (t.targetIsVectorOrArray)
 						{
 							for each (var subTarget : * in target)
 							{
@@ -252,6 +252,7 @@
 		private var next:EazeTween;
 		private var rnext:EazeTween;
 		private var isDead:Boolean;
+		private var targetIsVectorOrArray:Boolean;

 		private var target:*;
 		private var reversed:Boolean;
@@ -290,6 +291,7 @@

 			this.target = target;
 			this.autoStart = autoStart;
+			this.targetIsVectorOrArray = (this.target is Array || isVector(this.target));
 			_ease = defaultEasing;
 		}

@@ -301,7 +303,7 @@
 			this.duration = duration;

 			// properties
-			if (this.target is Array || isVector(this.target)) {
+			if (this.targetIsVectorOrArray) {
 				for each (var target : * in this.target) {
 					configureTarget(target, newState, duration, reversed);
 				}


Transferred from the Adobe Open Source Subversion Repository

Revision: 19467
Author:   cframpto@adobe.com
Date:     2010-12-17T21:27:38.093578Z

Log Message:
-----------
Fix DG tooltips for rtl layoutDirection and centralize the toolTipShowHandler() for the DG item renderers.  Fix optimization in scrollPositionChanged so it works as intended.
Added for tooling - if UIComponentGlobals.designMode, initialize exceptions will be caught and an intializeError event dispatched.

QE notes:
Doc notes:
Bugs: SDK-28743, SDK-28894
Reviewer: Ryan (SDK-28743), Hans (SDK-28894)
Tests run: cyclone
Is noteworthy for integration: yes: if UIComponentGlobals.designMode, initialize exceptions will be caught and an intializeError event dispatched

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/UITextFieldGridItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridColumnHeaderGroupLayout.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/spark/src/spark/components/gridClasses/GridItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DefaultGridItemRenderer.as</path>

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

--- frameworks/projects/spark/src/spark/skins/spark/TextFieldGridItemRendererInclude.as
+++ frameworks/projects/spark/src/spark/skins/spark/TextFieldGridItemRendererInclude.as
@@ -29,12 +29,15 @@
     import mx.core.DesignLayer;
     import mx.core.IFlexDisplayObject;
     import mx.core.IFlexModuleFactory;
+    import mx.core.ILayoutDirectionElement;
     import mx.core.IToolTip;
+    import mx.core.LayoutDirection;
     import mx.core.mx_internal;
     import mx.events.FlexEvent;
     import mx.events.ToolTipEvent;
     import mx.geom.TransformOffsets;
     import mx.managers.ISystemManager;
+    import mx.managers.ToolTipManager;
     import mx.styles.CSSStyleDeclaration;
     import mx.styles.IStyleClient;
     import mx.styles.StyleProtoChain;
@@ -640,11 +643,11 @@
             return;

         updatePreferredSize();
-
-        // If the effective value of showDataTips has changed for this column, then
+
+		// If the effective value of showDataTips has changed for this column, then
         // set the renderer's toolTip property to a placeholder.  The real tooltip
         // text is computed in the TOOL_TIP_SHOW handler below.
-
+
         // TBD(hmuller) - this code should be common with GridItemRenderer

         const showDataTips:Boolean = rowIndex != -1 && column && column.getShowDataTips();
@@ -1342,35 +1345,3 @@
     {
         _styleDeclaration = value;
     }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Event Handlers
-    //
-    //--------------------------------------------------------------------------
-
-    // TBD(hmuller) - this code should be common with GridItemRenderer
-    private function toolTipShowHandler(event:ToolTipEvent):void
-    {
-        var toolTip:IToolTip = event.toolTip;
-
-        toolTip.text = column.itemToDataTip(data);  // Lazily compute the tooltip text
-
-        // Move the origin of the tooltip to the origin of this item renderer
-
-        var sm:ISystemManager = systemManager.topLevelSystemManager;
-        var sbRoot:DisplayObject = sm.getSandboxRoot();
-        var screen:Rectangle = sm.getVisibleApplicationRect(null, true);
-        var pt:Point = new Point(0, 0);
-        pt = localToGlobal(pt);
-        pt = sbRoot.globalToLocal(pt);
-
-        toolTip.move(pt.x, Math.round(pt.y + (height - toolTip.height) / 2));
-
-        var screenRight:Number = screen.x + screen.width;
-        pt.x = toolTip.x;
-        pt.y = toolTip.y;
-        pt = sbRoot.localToGlobal(pt);
-        if (pt.x + toolTip.width > screenRight)
-            toolTip.move(toolTip.x - (pt.x + toolTip.width - screenRight), toolTip.y);
-    }


Transferred from the Adobe Open Source Subversion Repository

Revision: 9715
Author:   aharui@adobe.com
Date:     2009-08-27T21:20:28.280781Z

Log Message:
-----------
Introduce tabFocusEnabled to IFocusManagerComponent.  This replaces tabEnabled as the way to remove a component from the tabbing loop.  tabEnabled should be set to true for any component that can receive focus, and tabFocusEnabled determines whether the FocusManager will actually give it focus.  If tabEnabled=false on a non-TextField, the player will sometimes momentarily remove focus and dispatch a focusOut when the component has focus and is later clicked on.  This is now quite common with TLF-based text components so we are forced to make this change.

QE Notes: tests using tabEnabled must now use tabFocusEnabled
Doc Notes: needs documentation
Bugs: SDK-22731
Reviewer: Gordon
API Change: Yes
Is noteworthy for integration: Yes
tests: checkintests cyclone

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/Window.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/FlexHTMLLoader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/accordionClasses/AccordionHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/IFocusManagerComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/HTML.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateChooser.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/FlexEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Accordion.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Menu.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/sliderClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Image.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/TabNavigator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>

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

--- frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as
+++ frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as
@@ -2661,7 +2661,7 @@
      *  on the child component.

      *
      *
This will cause the FocusManager to ignore this component
-     *  and not monitor it for changes to the tabEnabled,
+     *  and not monitor it for changes to the tabFocusEnabled,
      *  tabChildren, and mouseFocusEnabled properties.
      *  This also means you cannot change this value after
      *  addChild() and expect the FocusManager to notice.

@@ -2766,6 +2766,55 @@
     public function get mouseFocusEnabled():Boolean
     {
         return false;
+    }
+
+    //----------------------------------
+    //  tabFocusEnabled
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the tabFocusEnabled property.
+     */
+    private var _tabFocusEnabled:Boolean = true;
+
+    [Bindable("tabFocusEnabledChange")]
+    [Inspectable(defaultValue="true")]
+
+    /**
+     *  A flag that indicates whether child objects can receive focus
+     *
+     *
This is similar to the tabEnabled property
+     *  used by the Flash Player.

+     *
+     *
This is usually true for components that
+     *  handle keyboard input, but some components in controlbars
+     *  have them set to false because they should not steal
+     *  focus from another component like an editor.
+     *

+     *
+     *  @default true
+     *
+     *  @langversion 4.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get tabFocusEnabled():Boolean
+    {
+        return _tabFocusEnabled;
+    }
+
+    /**
+     *  @private
+     */
+    public function set tabFocusEnabled(value:Boolean):void
+    {
+        if (value != _tabFocusEnabled)
+        {
+            _tabFocusEnabled = value;
+            dispatchEvent(new Event("tabFocusEnabledChange"));
+        }
     }

     //--------------------------------------------------------------------------
@@ -4420,7 +4469,10 @@
             {
                 focusableObjects.push(child);
                 if (!explicitTabEnabledChanged)
+                {
                     tabEnabled = true;
+                    tabFocusEnabled = true;
+                }
             }

             if (child is DisplayObjectContainer)


Transferred from the Adobe Open Source Subversion Repository

Revision: 5101
Author:   gauravj@adobe.com
Date:     2009-02-27T05:22:45.887116Z

Log Message:
-----------
Update action script files with asdoc version tags.

QE Notes: None.
Doc Notes: Please review and update as necessary.
tests: checkintests

Modified Paths:
--------------
663 paths were modified

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

--- frameworks/projects/mx/src/mx/accessibility/DateChooserAccImpl.as
+++ frameworks/projects/mx/src/mx/accessibility/DateChooserAccImpl.as
@@ -23,6 +23,11 @@
 /**
  *  DateChooserAccImpl is a subclass of AccessibilityImplementation
  *  which implements accessibility for the DateChooser class.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class DateChooserAccImpl extends AccImpl
 {
@@ -58,6 +63,11 @@
 	 *  Afterwards, when instances of DateChooser are initialized,
 	 *  their accessibilityImplementation property
 	 *  will be set to an instance of this class.

+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public static function enableAccessibility():void
 	{
@@ -89,6 +99,11 @@
 	 *
 	 *  @param master The UIComponent instance that this AccImpl instance
 	 *  is making accessible.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public function DateChooserAccImpl(master:UIComponent)
 	{


Transferred from the Adobe Open Source Subversion Repository

Revision: 5797
Author:   jimurphy@adobe.com
Date:     2009-03-31T15:35:34.544076Z

Log Message:
-----------
Merged revisions 3.x 5505,5526-5527,5535,5540,5542,5572,5616-5617,5656-5657,5671,5674,5683,5687-5688,5690,5698,5708-5709,5713-5716,5719-5723,5726,5728-5729,5736,5752,5754,5761,5774,5780,5784 -> trunk

most of these are user submitted patches! very cool.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/VideoDisplay.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/resources/IResourceManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ToggleButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Menu.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/CalendarLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ProgressIndeterminateSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/NavBar.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="D">/flex/sdk/trunk/modules/compiler/FlexCompilerShell-license.txt</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/DividedBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/formatters/DateFormatter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/FormItem.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/NativeDragManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridColumn.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/validators/PhoneNumberValidator.as</path>
<path kind="file" copyfrom-path="/flex/sdk/branches/3.x/frameworks/projects/framework/src/mx/validators/NumberValidatorDomainType.as" copyfrom-rev="5784" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/validators/NumberValidatorDomainType.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/ToolTipManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/ObjectUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/validators/NumberValidator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/validators/CurrencyValidator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Form.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/resources/ResourceManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Label.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/CalendarLayoutChangeEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/DataGridEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/sliderClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpMenuButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Text.as</path>

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

--- frameworks/projects/mx/src/mx/events/CalendarLayoutChangeEvent.as
+++ frameworks/projects/mx/src/mx/events/CalendarLayoutChangeEvent.as
@@ -103,6 +103,9 @@
                                               triggerEvent:Event = null)
 	{
 		super(type, bubbles, cancelable);
+
+		this.newDate = newDate;
+		this.triggerEvent = triggerEvent;
 	}

 	//--------------------------------------------------------------------------


Transferred from the Adobe Open Source Subversion Repository

Revision: 23247
Author:   cframpto@adobe.com
Date:     2011-12-20T19:21:13.134833Z

Log Message:
-----------
Remove ADOBE SYSTEMS license and replace with Apache license in headers - frameworks.  A 2nd pass will be needed to get the files not handled up by the scripts.

Modified Paths:
--------------
4959 paths were modified

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

--- frameworks/projects/rpc/src/mx/messaging/errors/MessagingError.as
+++ frameworks/projects/rpc/src/mx/messaging/errors/MessagingError.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2005-2007 Adobe Systems Incorporated
-//  All Rights Reserved.
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You 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
 //
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
+//      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.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package spark.effects
 {


Reverted implementation of min-height and max-height CSS properties because they were really buggy

Reverted commit: 09571e7c4ece1869325a9cfa5455dea4b8656ba0

--- src/reprise/ui/UIComponent.as
+++ src/reprise/ui/UIComponent.as
@@ -73,9 +73,7 @@
 		[
 			['top', true],
 			['bottom', true],
-			['height', true],
-			['minHeight', true],
-			['maxHeight', true]
+			['height', true]
 		];
 		protected static const OWN_WIDTH_RELATIVE_PROPERTIES:Array =
 		[
@@ -2111,36 +2109,24 @@
 			}

 			resolvePropsToValue(styles, HEIGHT_RELATIVE_PROPERTIES, parentH);
-			var usedHeight : int = m_currentStyles.height;
-            const baseHeight : int = usedHeight;
-
-            if (borderBoxSizing)
-			{
-                const subtractFromHeight : int =
-					m_currentStyles.borderTopWidth + m_currentStyles.paddingTop +
-					m_currentStyles.borderBottomWidth + m_currentStyles.paddingBottom;
-                if (!m_autoFlags.height && m_complexStyles.getStyle('height').isRelativeValue())
-                {
-                    usedHeight = Math.max(baseHeight - subtractFromHeight, 0);
-                }
-                if (m_complexStyles.hasStyle('maxHeight') && m_complexStyles.getStyle('maxHeight').isRelativeValue())
-                {
-                    m_currentStyles.maxHeight = m_currentStyles.maxHeight - subtractFromHeight;
-                }
-                if (m_complexStyles.hasStyle('minHeight') && m_complexStyles.getStyle('minHeight').isRelativeValue())
-                {
-                    m_currentStyles.minHeight = m_currentStyles.minHeight - subtractFromHeight;
-                }
-				m_currentStyles.height = usedHeight;
-				if (usedHeight != baseHeight)
+			m_contentBoxHeight = m_currentStyles.height;
+
+			if (borderBoxSizing && !m_autoFlags.height)
+			{
+				var baseHeight : int = styles.getStyle('height').resolveRelativeValueTo(parentH);
+				m_contentBoxHeight = baseHeight -
+					(m_currentStyles.borderTopWidth + m_currentStyles.paddingTop +
+					m_currentStyles.borderBottomWidth + m_currentStyles.paddingBottom);
+				if (m_contentBoxHeight < 0)
+				{
+					m_contentBoxHeight = 0;
+				}
+				m_currentStyles.height = m_contentBoxHeight;
+				if (!m_changedStyleProperties.height && m_contentBoxHeight != baseHeight)
 				{
 					m_changedStyleProperties.addChange('height');
 				}
 			}
-
-            usedHeight = Math.min(usedHeight, m_currentStyles.maxHeight);
-            m_contentBoxHeight = Math.max(usedHeight, m_currentStyles.minHeight);
-
 			//TODO: verify that we should really resolve the border-radii this way
 			resolvePropsToValue(styles, OWN_WIDTH_RELATIVE_PROPERTIES,
 				m_contentBoxWidth + m_currentStyles.borderTopWidth);
@@ -2175,7 +2161,7 @@
 				else
 				{
 					m_autoFlags[propName] = props[i][1];
-					m_currentStyles[propName] = ComputedStyles.BASELINE[propName];
+					m_currentStyles[propName] = 0;
 				}
 			}
 		}


Convenience functions

Convenience functions

git-svn-id: b675b909355d5cf946977f44a8ec5a6ceb3782e4@765 ed5b42cb-e716-0410-a449-f6a68f950b19

--- src/as/com/threerings/flash/DisplayUtil.as
+++ src/as/com/threerings/flash/DisplayUtil.as
@@ -31,6 +31,28 @@

 public class DisplayUtil
 {
+    /**
+     * Adds newChild to container, directly below another child of the container.
+     */
+    public static function addChildBelow (container :DisplayObjectContainer,
+                                          newChild :DisplayObject,
+                                          below :DisplayObject) :void
+    {
+        var ii :int = (below.parent == container ? container.getChildIndex(below) : 0);
+        container.addChildAt(newChild, ii);
+    }
+
+    /**
+     * Adds newChild to container, directly above another child of the container.
+     */
+    public static function addChildAbove (container :DisplayObjectContainer,
+                                          newChild :DisplayObject,
+                                          above :DisplayObject) :void
+    {
+        var ii :int = (above.parent == container ? container.getChildIndex(above) + 1 : 0);
+        container.addChildAt(newChild, ii);
+    }
+
     /**
      * Sets the top-left pixel of a DisplayObject to the given location, relative to another
      * DisplayObject's coordinate space.


Subscription to player destroyed event that is send by the player object

--- DroneAnarchy/Resources/Scripts/DroneAnarchy.as
+++ DroneAnarchy/Resources/Scripts/DroneAnarchy.as
@@ -414,6 +414,7 @@
 	SubscribeToEvent("DroneDestroyed", "HandleDroneDestroyed");
 	SubscribeToEvent("CountFinished", "HandleCountFinished");
 	SubscribeToEvent("SoundGenerated", "HandleSoundGenerated");
+	SubscribeToEvent("PlayerDestroyed", "HandlePlayerDestroyed");
 	SubscribeToEvent(scene_.physicsWorld, "PhysicsPreStep", "HandleFixedUpdate");

 }


sort published movies by name so that our output is deterministic

--- exporter/src/main/as/flump/xfl/XflLibrary.as
+++ exporter/src/main/as/flump/xfl/XflLibrary.as
@@ -54,7 +54,7 @@

     public function get publishedMovies () :Vector.<MovieMold> {
         const result :Vector.<MovieMold> = new Vector.<MovieMold>();
-        for each (var movie :MovieMold in _toPublish.toArray()) result.push(movie);
+        for each (var movie :MovieMold in _toPublish.toArray().sortOn("id")) result.push(movie);
         return result;
     }


Fixed SASL failure. XIFF-33 XIFF-34. Reviewer=David

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

--- src/org/jivesoftware/xiff/core/XMPPBOSHConnection.as
+++ src/org/jivesoftware/xiff/core/XMPPBOSHConnection.as
@@ -182,6 +182,10 @@
 					break;

 				case "success":
+					handleAuthentication( currentNode );
+					break;
+
+				case "failure":
 					handleAuthentication( currentNode );
 					break;
 				default:
@@ -387,7 +391,7 @@
 	                bindConnection();
 	            }
 	            else {
-	                dispatchEvent(new ErrorEvent(ErrorEvent.ERROR));
+					dispatchError("Authentication Error", "", "", 401);
 	                disconnect();
 	            }
 	        }