Transferred from the Adobe Open Source Subversion Repository

Revision: 20736
Author:   smgilson@adobe.com
Date:     2011-03-09T21:18:00.204102Z

Log Message:
-----------
Merge 20719 - ASDoc updates

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextFormat.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/RuntimeDPIProvider.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/EdgeMetrics.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/mx/src/mx/controls/dataGridClasses/DataGridColumn.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/DeferredInstanceFromFunction.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/advancedgrids/src/mx/controls/advancedDataGridClasses/AdvancedDataGridBase.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/WindowedApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/mx/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/Window.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IFlexModuleFactory.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/FlexHTMLLoader.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/mx/src/mx/controls/dataGridClasses/DataGridBase.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/mx/src/mx/core/Container.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/FTETextField.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ITextInput.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ITextFieldInterface.as</path>
<path kind="dir" action="M">/private/flex/sdk/trunk</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/windowClasses/TitleBar.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/DPIClassification.as</path>

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

--- frameworks/projects/mx/src/mx/core/Container.as
+++ frameworks/projects/mx/src/mx/core/Container.as
@@ -3343,10 +3343,10 @@
             // Set the position and size of the overlay .
             if (effectOverlay)
             {
-				effectOverlay.x = 0;
-				effectOverlay.y = 0;
-				effectOverlay.width = unscaledWidth;
-				effectOverlay.height = unscaledHeight;
+                effectOverlay.x = 0;
+                effectOverlay.y = 0;
+                effectOverlay.width = unscaledWidth;
+                effectOverlay.height = unscaledHeight;
             }

             // Set the positions and sizes of the scrollbars.
@@ -4244,6 +4244,8 @@
      *  If true, after creating the component, Flex calls
      *  the createComponentsFromDescriptors() method to create all or some
      *  of its children, based on the value of the component's creationPolicy property.
+     *
+     *  @return The created component.
      *
      *  @see mx.core.UIComponentDescriptor
      *
@@ -5066,7 +5068,7 @@
             needHorizontal ||
             needVertical ||
             hasNegativeCoords ||
-			effectOverlay != null ||
+            effectOverlay != null ||
             vm.left > 0 ||
             vm.top > 0;


FLEX-33307: fix another couple of 'variable definition duplicates function parameter' warnings.

Signed-off-by: Erik de Bruin <c195b508e6f0c57aeafdb5e96947e2b79e6a4b40@ixsoftware.nl>

--- frameworks/projects/spark/src/spark/components/gridClasses/DataGridEditor.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/DataGridEditor.as
@@ -1053,8 +1053,8 @@
         // increment is -1 if we are moving backward and 1 if moving
         // forward.
         const increment:int = backward ? -1 : 1;
-        var rowIndex:int = rowIndex;
-        var columnIndex:int = columnIndex;
+        //var rowIndex:int = rowIndex;
+        //var columnIndex:int = columnIndex;
         do {
             var nextColumn:int = columnIndex + increment;
             if (nextColumn >= 0 && nextColumn < dataGrid.columns.length)


Transferred from the Adobe Open Source Subversion Repository

Revision: 16745
Author:   klin@adobe.com
Date:     2010-06-30T18:26:23.782445Z

Log Message:
-----------
The following changes apply to Spark DataGrid only.   Code reviews have been deferred until the implementation is closer to completion.

-GridRowNode's updateMaxHeight now returns true if the max height updates.
-getRow/ColumnBounds returns an empty rectangle instead of null to prevent null pointer exceptions.
-getRowIndexAt() now uses a cached cumulative y value of the last searched row to search for the next row index. It uses the helper methods getPrevRowIndexAt and getNextRowIndexAt to search for values before and after the cached value. These methods iterates through the rowList and calculates the range of y values represented between two nodes, which it uses to find the target row index.
-clear() nulls out the cached recentNode.

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridDimensions.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridRowNode.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridRowList.as</path>

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

--- frameworks/projects/spark/src/spark/components/gridClasses/GridDimensions.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridDimensions.as
@@ -42,6 +42,10 @@

     private var rowList:GridRowList = new GridRowList();
     private var _columnWidths:Vector.<Number>;
+
+    //cache for cumulative y values.
+    private var startY:Number = 0;
+    private var recentNode:GridRowNode = null;

     //--------------------------------------------------------------------------
     //
@@ -408,7 +412,8 @@
         if (node)
         {
             node.cellHeights[col] = height;
-            node.updateMaxHeight();
+            if (node.updateMaxHeight())
+                recentNode = null;
         }
     }

@@ -482,7 +487,6 @@
             // index is now equal to node's index but row index is > node's index so we add node.
             y += node.maxCellHeight;
             index++;
-
             node = node.next;
         }

@@ -498,7 +502,7 @@
     {
         // TBD: provide optional return value (Rectangle) parameter
         if ((row < 0) || (row >= rowCount))
-            return null;  // TBD: return empty Rectangle instead
+            return new Rectangle();  // TBD: return empty Rectangle instead

         const firstCellR:Rectangle = getCellBounds(row, 0);
         const lastCellR:Rectangle = getCellBounds(row, columnCount - 1);
@@ -514,7 +518,7 @@
     {
         // TBD: provide optional return value (Rectangle) parameter
         if ((col < 0) || (col >= columnCount))
-            return null;  // TBD: return empty Rectangle instead
+            return new Rectangle();  // TBD: return empty Rectangle instead

         const firstCellR:Rectangle = getCellBounds(0, col);
         const lastCellR:Rectangle = getCellBounds(rowCount - 1, col);
@@ -527,52 +531,197 @@
      *  Returns the index of the row at the specified coordinates. If
      *  the coordinates lie in a gap area, the index returned is the
      *  previous row.
+     *
+     *  @return The index of the row at the coordinates provided. If the
+     *  coordinates are out of bounds, return -1.
      */
     public function getRowIndexAt(x:Number, y:Number):int
     {
+        if (y < 0)
+            return -1;
+
         if (!isNaN(fixedRowHeight))
             return y / (fixedRowHeight + rowGap);

         if (rowList.length == 0)
             return y / (defaultRowHeight + rowGap);

-        var node:GridRowNode = rowList.first;
-        var index:int = 0;
-        var cur:Number = y;
-        var n:int;
+        if (y == 0)
+        {
+            recentNode = null;
+            return 0;
+        }
+
+        // initialize first node.
+        if (!recentNode)
+        {
+            recentNode = rowList.first;
+            startY = recentNode.rowIndex * (defaultRowHeight + rowGap);
+        }
+
+        var index:int;
+
+        // if we are already at the right row, then use the index.
+        if (isYInRow(y, startY, recentNode))
+            index = recentNode.rowIndex;
+        else if (y < startY)
+            index = getPrevRowIndexAt(y, recentNode, startY);
+        else
+            index = getNextRowIndexAt(y, recentNode, startY);
+
+        return index;
+    }
+
+    /**
+     *  Checks if a certain y value lies in a row's bounds.
+     */
+    private function isYInRow(y:Number, startY:Number, node:GridRowNode):Boolean
+    {
+        var end:Number = startY + node.maxCellHeight;
+
+        // don't add gap for last row.
+        if (node.rowIndex != rowCount - 1)
+            end += rowGap;
+
+        // if y is between cumY and cumY + rowHeight - 1 then y is in the row.
+        if (y >= startY && y < end)
+            return true;
+
+        return false;
+    }
+
+    /**
+     *  Returns the index of the row that contains the specified y value.
+     *  The row will be before startNode.
+     *
+     *  @param y the target y value
+     *  @param startNode the node to search from
+     *  @param startY the cumulative y value from the first row to startNode
+     *
+     *  @return the index of the row that contains the y value.
+     */
+    private function getPrevRowIndexAt(y:Number, startNode:GridRowNode, startY:Number):int
+    {
+        var node:GridRowNode = startNode;
+        var prevNode:GridRowNode = null;
+        var index:int = node.rowIndex;
+        var currentY:Number = startY;
+        var prevY:Number;
+        var targetY:Number = y;

         while (node)
         {
-            // add not included rows.
-            if (node.rowIndex > index)
-            {
-                n = node.rowIndex - index;
-                for (var i:int = 0; i < n; i++)
-                {
-                    cur -= defaultRowHeight + rowGap;
-                    if (cur < 0)
-                        return index;
-                    index++;
-                }
-            }
-
-            cur -= node.maxCellHeight + rowGap;
-            if (cur < 0)
-                return index;
-            index++;
+            // check the current node.
+            if (isYInRow(targetY, currentY, node))
+                break;
+
+            // calculate previous y.
+            prevNode = node.prev;
+            if (!prevNode)
+            {
+                prevY = 0;
+            }
+            else
+            {
+                prevY = currentY;
+
+                var indDiff:int = node.rowIndex - prevNode.rowIndex;
+
+                // subtract default row heights if difference is greater than one.
+                if (indDiff > 1)
+                    prevY -= (indDiff - 1) * (defaultRowHeight + rowGap);
+            }
+
+            // check if target Y is in range.
+            if (targetY < currentY && targetY >= prevY)
+            {
+                index = index - Math.ceil(Number(currentY - targetY)/(defaultRowHeight + rowGap));
+                break;
+            }
+
+            // subtract previous node's height and its gap.
+            currentY = prevY - prevNode.maxCellHeight - rowGap;
+            node = node.prev;
+            index = node.rowIndex;
+        }
+
+        this.recentNode = node;
+        this.startY = currentY;
+
+        return index;
+    }
+
+    /**
+     *  Returns the index of the row that contains the specified y value.
+     *  The row will be after startNode.
+     *
+     *  @param y the target y value
+     *  @param startNode the node to search from
+     *  @param startY the cumulative y value from the first row to startNode
+     *
+     *  @return the index of the row that contains the y value.
+     */
+    private function getNextRowIndexAt(y:Number, startNode:GridRowNode, startY:Number):int
+    {
+        var node:GridRowNode = startNode;
+        var nextNode:GridRowNode = null;
+        var index:int = node.rowIndex;
+        var currentY:Number = startY;
+        var nextY:Number;
+        var targetY:Number = y;
+
+        while (node)
+        {
+            // check the current node.
+            if (isYInRow(targetY, currentY, node))
+                break;
+
+            // calculate next y.
+            nextNode = node.next;
+
+            nextY = currentY;
+
+            var indDiff:int;
+
+            if (!nextNode)
+            {
+                indDiff = rowCount - 1 - node.rowIndex;
+                // the y at the end doesn't have a rowGap, but includes the final pixel.
+                nextY += indDiff * (defaultRowHeight + rowGap) - rowGap + 1;
+            }
+            else
+            {
+                indDiff = nextNode.rowIndex - node.rowIndex;
+                nextY += (indDiff - 1) * (defaultRowHeight + rowGap);
+            }
+
+            // check if target Y is within default row heights range.
+            if (targetY >= currentY && targetY < nextY)
+            {
+                index = index - Math.ceil(Number(currentY - targetY)/(defaultRowHeight + rowGap));
+                break;
+            }
+
+            // if no next node and we didn't find the target, then the row doesn't exist.
+            if (!nextNode)
+            {
+                index = -1;
+                break;
+            }
+
+            // add next node's height and its gap if necessary.
+            currentY = nextY + nextNode.maxCellHeight;
+            if (nextNode.rowIndex != rowCount - 1)
+                currentY += rowGap;

             node = node.next;
-        }
-
-        n = this.rowCount;
-        for (; index < n; index++)
-        {
-            cur -= defaultRowHeight + rowGap;
-            if (cur < 0)
-                return index;
-        }
-
-        return -1;
+            index = node.rowIndex;
+        }
+
+        this.recentNode = node;
+        this.startY = currentY;
+
+        return index;
     }

     /**
@@ -730,6 +879,8 @@
     {
         rowCount = 0;
         rowList.removeAll();
+        this.recentNode = null;
+        this.startY = 0;
     }

     /**


Additional ASDocs and notes

Additional ASDocs and notes

--- com/zehfernando/input/binding/KeyActionBinder.as
+++ com/zehfernando/input/binding/KeyActionBinder.as
@@ -17,10 +17,11 @@
 		// http://zehfernando.com/2013/abstracting-key-and-game-controller-inputs-in-adobe-air/

 		// TODO:
-		// * Read if it was pressed/released THIS frame? (or in any ms) or valueOnce
+		// * isActionActivated() must properly support time tolerance
 		// * Allow sensitive controls to be treated as normal controls
 		// * Add gamepad index to return signals
 		// * Use caching samples?
+		// * Some missing asdocs

 		// Properties
 		private var _isRunning:Boolean;
@@ -401,6 +402,23 @@
 			return actionsActivations.hasOwnProperty(__action) ? (actionsActivations[__action] as ActivationInfo).value : 0;
 		}

+		/**
+		 * Checks whether an action is currently activated (in practice, a button is pressed).
+		 *
+		 * @param action				An arbritrary String id identifying the action that should be checked.
+		 *
+		 *
Examples:

+		 *
+		 *

+		 * // Moves player right when right is pressed
+		 * // Setup:
+		 * addGamepadActionBinding("move-right", GamepadControls.DPAD_RIGHT);
+		 * // In the game loop:
+		 * if (isActionActivated("move-right")) {
+		 *     player.moveRight();
+		 * }
+		 *

+		 */
 		public function isActionActivated(__action:String):Boolean {
 			return actionsActivations.hasOwnProperty(__action) && (actionsActivations[__action] as ActivationInfo).activations.length > 0;
 		}


Renamed onGameInputDeviceChanged (which doesn't make sense) to onGameInputControlChanged

--- com/zehfernando/input/binding/KeyActionBinder.as
+++ com/zehfernando/input/binding/KeyActionBinder.as
@@ -430,7 +430,7 @@
 					device.enabled = true;
 					for (j = 0; j < device.numControls; j++) {
 //						debug("    Control id = " + device.getControlAt(j).id + ", val = " + device.getControlAt(j).minValue + " => " + device.getControlAt(j).maxValue);
-						device.getControlAt(j).addEventListener(Event.CHANGE, onGameInputDeviceChanged, false, 0, true);
+						device.getControlAt(j).addEventListener(Event.CHANGE, onGameInputControlChanged, false, 0, true);
 					}
 				}
 			}
@@ -446,7 +446,7 @@
 				device = GameInput.getDeviceAt(i);
 				if (device != null) {
 					for (j = 0; j < device.numControls; j++) {
-						device.getControlAt(j).removeEventListener(Event.CHANGE, onGameInputDeviceChanged);
+						device.getControlAt(j).removeEventListener(Event.CHANGE, onGameInputControlChanged);
 					}
 				}
 			}
@@ -523,7 +523,7 @@
 			refreshGameInputDeviceList();
 		}

-		private function onGameInputDeviceChanged(__e:Event):void {
+		private function onGameInputControlChanged(__e:Event):void {
 			var control:GameInputControl = __e.target as GameInputControl;

 			// Find the re-mapped control id


Transferred from the Adobe Open Source Subversion Repository

Revision: 12864
Author:   mhorn@adobe.com
Date:     2009-12-11T21:35:24.243046Z

Log Message:
-----------
asdoc minor fixes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/SpriteAsset.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/MovieClipAsset.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextArea.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/core/BitmapAsset.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/controls/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>

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

--- frameworks/projects/framework/src/mx/core/SpriteAsset.as
+++ frameworks/projects/framework/src/mx/core/SpriteAsset.as
@@ -14,7 +14,7 @@

 /**
  *  SpriteAsset is a subclass of the flash.display.Sprite class which
- *  represents vector graphic images that you embed in a Flex application.
+ *  represents vector graphic images that you embed in an application.
  *  It implements the IFlexDisplayObject interface, which makes it
  *  possible for an embedded vector graphic image to be displayed in an Image
  *  control, or to be used as a container background or a component skin.
@@ -37,12 +37,12 @@
  *  by writing the following:

  *
  *

- *  <mx:Style>
- *      Application
- *      {
+ *  <fx:Style>
+ *      @namespace mx "library://ns.adobe.com/flex/mx"
+ *      mx|Application {
  *          backgroundImage: Embed(source="Assets.swf", symbol='Logo')
  *      }
- *  <mx:Style/>

+ *  <fx:Style/>

  *
  *
without having to understand that the MXML compiler has created
  *  a subclass of BitmapAsset for you.


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

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

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

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

--- frameworks/projects/rpc/src/mx/rpc/remoting/Operation.as
+++ frameworks/projects/rpc/src/mx/rpc/remoting/Operation.as
@@ -89,6 +89,12 @@
      */
     override public function send(... args:Array):AsyncToken
     {
+        if (service != null)
+            service.initialize();
+
+        if (operationManager != null)
+            return operationManager(args);
+
         if (!args || (args.length == 0 && this.arguments))
         {
             if (this.arguments is Array)


Transferred from the Adobe Open Source Subversion Repository

Revision: 6352
Author:   smgilson@adobe.com
Date:     2009-04-28T20:04:17.982098Z

Log Message:
-----------
ASDoc edits for containers

QE Notes: None
Doc Notes: None
Bugs: -
Checkintests: passed

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/IItemRendererOwner.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/IItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/events/RendererExistenceEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Application.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/HGroup.as</path>

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

--- frameworks/projects/spark/src/spark/components/HGroup.as
+++ frameworks/projects/spark/src/spark/components/HGroup.as
@@ -18,14 +18,29 @@
 [IconFile("HGroup.png")]

 /**
- * A Group with a HorizontalLayout.
+ *  The HGroup container is an instance of the Group container
+ *  that uses the HorizontalLayout class.
+ *  Do not modify the layout property.
+ *  instead, use the properties of the HGroup class to modify the
+ *  characteristics of the HorizontalLayout class.
  *
- * All of the HorizontalLayout properties exposed by this class are simply
- * delegated to the layout property.
+ *  @mxml
+ *
+ *
The <HGroup> tag inherits all of the tag
+ *  attributes of its superclass and adds the following tag attributes:

+ *
+ *

+ *  <HGroup
+ *    Properties
+ *    columnWidth="no default"
+ *    gap="6"
+ *    requestedColumnCount="-1"
+ *    variableColumnWidth"true"
+ *    verticalAlign="top"
+ *  />
+ *

  *
- * The layout property should not be set or configured directly.
- *
- * @see spark.layouts.HorizontalLayout
+ *  @see spark.layouts.HorizontalLayout
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
@@ -34,15 +49,14 @@
  */
 public class HGroup extends Group
 {
-	include "../core/Version.as";
-
-    /**
-     *  Initializes the layout property to an instance of HorizontalLayout.
-     *
-     *  Resetting the layout property or setting its properties directly
-     *  is not supported.
-     *
-     *  @see spark.layouts.HorizontalLayout
+    include "../core/Version.as";
+
+    /**
+     *  Constructor.
+     *  Initializes the layout property to an instance of
+     *  the HorizontalLayout class.
+     *
+     *  @see spark.layout.HorizontalLayout
      *  @see spark.components.VGroup
      *
      *  @langversion 3.0
@@ -72,7 +86,9 @@
     //----------------------------------

     /**
-     * @copy spark.layouts.HorizontalLayout#gap
+     *  @copy spark.layouts.HorizontalLayout#gap
+     *
+     *  @default 6
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -99,7 +115,9 @@
     [Bindable("propertyChange")]

     /**
-     * @copy spark.layouts.HorizontalLayout#columnCount
+     *  @copy spark.layouts.HorizontalLayout#columnCount
+     *
+     *  @default -1
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -116,7 +134,9 @@
     //----------------------------------

     /**
-     * @copy spark.layouts.HorizontalLayout#requestedColumnCount
+     *  @copy spark.layouts.HorizontalLayout#requestedColumnCount
+     *
+     *  @default -1
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -171,6 +191,8 @@

     /**
      * @copy spark.layouts.HorizontalLayout#variableColumnWidth
+     *
+     *  @default true
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -195,7 +217,9 @@
     //----------------------------------

     /**
-     * @copy spark.layouts.HorizontalLayout#verticalAlign
+     *  @copy spark.layouts.HorizontalLayout#verticalAlign
+     *
+     *  @default "top"
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -222,7 +246,7 @@
     [Bindable("indexInViewChanged")]

     /**
-     * @copy spark.layouts.HorizontalLayout#firstIndexInView
+     *  @copy spark.layouts.HorizontalLayout#firstIndexInView
      *
      *  @langversion 3.0
      *  @playerversion Flash 10


Transferred from the Adobe Open Source Subversion Repository

Revision: 3509
Author:   jimurphy@adobe.com
Date:     2008-10-07T18:19:17.646255Z

Log Message:
-----------
Rename of flex -> mx.

For compatibility reasons it was decided that the new functionality remain integrated with the old framework, although we will continue to build two separate SWCs, one with primarily existing framework classes, and one with new Flex 4 classes. This change removes duplicate names from the Flex 4 framework to avoid class name overlapping with the old framework code.  The naming overlap consists of two major areas:  New Components, and New Effects

Modified Paths:
--------------
386 paths were modified

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

--- frameworks/projects/spark/src/spark/components/VGroup.as
+++ frameworks/projects/spark/src/spark/components/VGroup.as
@@ -9,11 +9,11 @@
 //
 ////////////////////////////////////////////////////////////////////////////////

-package flex.component
+package mx.components
 {
 import flash.events.Event;
-import flex.core.Group;
-import flex.layout.VerticalLayout;
+import mx.components.Group;
+import mx.layout.VerticalLayout;

 /**
  *  A Group with a VerticalLayout.
@@ -23,7 +23,7 @@
  *
  *  The layout property should not be set or configured directly.
  *
- *  @see flex.layout.VerticalLayout
+ *  @see mx.layout.VerticalLayout
  */
 public class VGroup extends Group
 {
@@ -35,8 +35,8 @@
      *  Resetting the layout property or setting its properties directly
      *  is not supported.
      *
-     *  @see flex.layout.VerticalLayout
-     *  @see flex.component.HGroup
+     *  @see mx.layout.VerticalLayout
+     *  @see mx.components.HGroup
      */
 	public function VGroup():void
 	{
@@ -63,7 +63,7 @@
     //----------------------------------

     /**
-     * @copy flex.layout.VerticalLayout#gap
+     * @copy mx.layout.VerticalLayout#gap
      */
     public function get gap():int
     {
@@ -85,7 +85,7 @@
     [Bindable("propertyChange")]

     /**
-     * @copy flex.layout.VerticalLayout#rowCount
+     * @copy mx.layout.VerticalLayout#rowCount
      */
     public function get rowCount():int
     {
@@ -97,7 +97,7 @@
     //----------------------------------

     /**
-     * @copy flex.layout.VerticalLayout#requestedRowCount
+     * @copy mx.layout.VerticalLayout#requestedRowCount
      */
     public function get requestedRowCount():int
     {
@@ -119,7 +119,7 @@
     [Inspectable(category="General")]

     /**
-     * @copy flex.layout.VerticalLayout#rowHeight
+     * @copy mx.layout.VerticalLayout#rowHeight
      */
     public function get rowHeight():Number
     {
@@ -141,7 +141,7 @@
     [Inspectable(category="General")]

     /**
-     * @copy flex.layout.VerticalLayout#variableRowHeight
+     * @copy mx.layout.VerticalLayout#variableRowHeight
      */
     public function get variableRowHeight():Boolean
     {
@@ -163,7 +163,7 @@
     [Bindable("indexInViewChanged")]

     /**
-     * @copy flex.layout.VerticalLayout#firstIndexInView
+     * @copy mx.layout.VerticalLayout#firstIndexInView
      */
     public function get firstIndexInView():int
     {
@@ -177,7 +177,7 @@
     [Bindable("indexInViewChanged")]

     /**
-     * @copy flex.layout.VerticalLayout#lastIndexInview
+     * @copy mx.layout.VerticalLayout#lastIndexInview
      */
     public function get lastIndexInView():int
     {


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

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

 package spark.effects
 {


fix wipe effect

fix wipe effect

--- frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/Wipe.as
+++ frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/Wipe.as
@@ -92,7 +92,7 @@
      */
     public var direction:String;

-    private var wiper:PlatformWiper;
+    private var wiper:PlatformWiper = new PlatformWiper();

     //--------------------------------------------------------------------------
     //
@@ -131,6 +131,8 @@
         {
             startValue = 0;
             endValue = actualTarget.height;
+            // WipeDown makes something appear
+            actualTarget.visible = true;
             wiper.visibleRect = new Rectangle(0, 0, actualTarget.width, 0);
         }

@@ -139,11 +141,15 @@

 	public function onTweenUpdate(value:Number):void
 	{
+        trace(actualTarget, value);
 		wiper.visibleRect = new Rectangle(0, 0, actualTarget.width, value);
 	}

 	public function onTweenEnd(value:Number):void
 	{
+        // WipeUp makes something disappear
+        if (direction == "up")
+            actualTarget.visible = false;
         wiper.target = null;
 	}
 }


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/mx/src/mx/controls/scrollClasses/ScrollThumb.as
+++ frameworks/projects/mx/src/mx/controls/scrollClasses/ScrollThumb.as
@@ -0,0 +1,225 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2003-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.controls.scrollClasses
+{
+
+import flash.events.MouseEvent;
+import flash.geom.Point;
+import mx.controls.Button;
+import mx.core.mx_internal;
+import mx.events.ScrollEventDetail;
+
+use namespace mx_internal;
+
+/**
+ *  The ScrollThumb class defines the thumb of a ScrollBar control.
+ *
+ *  @see mx.controls.scrollClasses.ScrollBar
+ *  @see mx.controls.HScrollBar
+ *  @see mx.controls.VScrollBar
+ */
+public class ScrollThumb extends Button
+{
+	include "../../core/Version.as";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Constructor.
+	 */
+	public function ScrollThumb()
+	{
+		super();
+
+		explicitMinHeight = 10;
+
+		stickyHighlighting = true;
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Variables
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	private var ymin:Number;
+
+	/**
+	 *  @private
+	 */
+	private var ymax:Number;
+
+	/**
+	 *  @private
+	 */
+	private var datamin:Number;
+
+	/**
+	 *  @private
+	 */
+	private var datamax:Number;
+
+	/**
+	 *  @private
+	 *  Last position of the thumb.
+	 */
+	private var lastY:Number;
+
+	//--------------------------------------------------------------------------
+	//
+	//  Overridden methods: Button
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	override mx_internal function buttonReleased():void
+	{
+		super.buttonReleased();
+
+		stopDragThumb();
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Methods
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 *  Set the range of motion for the thumb:
+	 *  how far it can move and what data values that covers.
+	 */
+	mx_internal function setRange(ymin:Number, ymax:Number,
+								  datamin:Number, datamax:Number):void
+	{
+		this.ymin = ymin;
+		this.ymax = ymax;
+
+		this.datamin = datamin;
+		this.datamax = datamax;
+	}
+
+	/**
+	 *  @private
+	 *  Stop dragging the thumb around.
+	 */
+	private function stopDragThumb():void
+	{
+		var scrollBar:ScrollBar = ScrollBar(parent);
+
+		scrollBar.isScrolling = false;
+
+		scrollBar.dispatchScrollEvent(scrollBar.oldPosition,
+                                      ScrollEventDetail.THUMB_POSITION);
+
+		scrollBar.oldPosition = NaN;
+
+		systemManager.removeEventListener(
+			MouseEvent.MOUSE_MOVE, mouseMoveHandler, true);
+
+		// in case we go offscreen
+		systemManager.stage.removeEventListener(MouseEvent.MOUSE_MOVE,
+							stage_mouseMoveHandler);
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Overridden event handlers: Button
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 *  User pressed on the thumb, so start tracking in case they drag it.
+	 */
+ 	override protected function mouseDownHandler(event:MouseEvent):void
+	{
+		super.mouseDownHandler(event);
+
+		var scrollBar:ScrollBar = ScrollBar(parent);
+        scrollBar.oldPosition = scrollBar.scrollPosition;
+
+		lastY = event.localY;
+
+		systemManager.addEventListener(
+			MouseEvent.MOUSE_MOVE, mouseMoveHandler, true);
+
+		// in case we go offscreen
+		systemManager.stage.addEventListener(MouseEvent.MOUSE_MOVE,
+							stage_mouseMoveHandler);
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Event handlers
+	//
+	//--------------------------------------------------------------------------
+
+	private function stage_mouseMoveHandler(event:MouseEvent):void
+	{
+		if (event.target != stage)
+			return;
+
+		mouseMoveHandler(event);
+	}
+
+	/**
+	 *  @private
+	 *  Drag the thumb around and update the scroll bar accordingly.
+	 */
+	private function mouseMoveHandler(event:MouseEvent):void
+	{
+		if (ymin == ymax)
+			return;
+
+		var pt:Point = new Point(event.stageX, event.stageY);
+		pt = globalToLocal(pt);
+
+		var scrollMove:Number = pt.y - lastY;
+		scrollMove += y;
+
+		if (scrollMove < ymin)
+			scrollMove = ymin;
+		else if (scrollMove > ymax)
+			scrollMove = ymax;
+
+		var scrollBar:ScrollBar = ScrollBar(parent);
+
+		scrollBar.isScrolling = true;
+
+		$y = scrollMove;
+
+		// In an ideal world, this would probably dispatch an event,
+		// however this object is rather hardwired into a scroll bar
+		// so we'll just have it tell the scroll bar to change its position.
+        var oldPosition:Number = scrollBar.scrollPosition;
+		var pos:Number = Math.round(
+			(datamax - datamin) * (y - ymin) / (ymax - ymin)) + datamin;
+		scrollBar.scrollPosition = pos;
+		scrollBar.dispatchScrollEvent(oldPosition,
+									  ScrollEventDetail.THUMB_TRACK);
+		event.updateAfterEvent();
+	}
+
+}
+
+}


Document Flash parameters (e.g. debug=1).

--- swfcat.as
+++ swfcat.as
@@ -1,3 +1,34 @@
+/* Flash parameters. These can change how the program runs from the outside.
+ * They can be set as a URL query string, for example:
+ *      http://www.example.com/swfcat.swf?facilitator=127.0.0.1:9002&debug=1
+ * or in the HTML markup for the embedding of the movie:
+ *      <object>
+ *          <param name="movie" value="http://www.example.com/swfcat.swf">
+ *          <param name="flashvars" value="facilitator=127.0.0.1:9002&debug=1">
+ *          <embed src="http://www.example.com/swfcat.swf"
+ *                 flashvars="facilitator=127.0.0.1:9002&debug=1"></embed>
+ *      </object>
+ *
+ * debug=1
+ * If set (to any value), show verbose terminal-like output instead of the
+ * badge.
+ *
+ * facilitator=<HOST>:<PORT>
+ * The address of the facilitator to use. By default it is
+ * DEFAULT_FACILITATOR_ADDR. Both <HOST> and <PORT> must be present.
+ *
+ * client=1
+ * If set (to any value), run in client RTMFP mode. In this mode, rather than
+ * connecting to a facilitator and attempting to serve clients, swfcat starts an
+ * RTMFP socket and connects to a local address (to the connector, to be exact).
+ * See README for more on running in client RTMFP mode. No argument is required
+ * to use RTMFP when in the usual server mode.
+ *
+ * local=<HOST>:<PORT>
+ * When in client RTMFP mode (client=1), connect to this local address. The
+ * default is DEFAULT_LOCAL_TOR_CLIENT_ADDR.
+ */
+
 package
 {
     import flash.display.Sprite;


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

--- frameworks/projects/framework/src/mx/collections/Sort.as
+++ frameworks/projects/framework/src/mx/collections/Sort.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2005-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 mx.collections
 {


Revert "FLEX-33740 made removedFromStageHandler protected so it could be overridden"

This reverts commit 5d86438e5d5a879b0cc6eabe89bd071e0ca515f6.

--- frameworks/projects/framework/src/mx/core/UIComponent.as
+++ frameworks/projects/framework/src/mx/core/UIComponent.as
@@ -12665,17 +12665,9 @@
     }

     /**
-     *
-	 * Called when a component is removed from the stage.
-	 *
-     *  @param event The event object.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 4.11
-     */
-    protected function removedFromStageHandler(event:Event):void
+     *  @private
+     */
+    private function removedFromStageHandler(event:Event):void
     {
         _systemManagerDirty = true;
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 14869
Author:   cframpto@adobe.com
Date:     2010-03-19T02:24:27.434644Z

Log Message:
-----------
Merge mirroring changes 14728-14730, 14772-14775, 14806 from 4.x to trunk.

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/MenuBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/HScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/UIFTETextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/PopUpAnchor.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/airspark/src/spark/components/WindowedApplication.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/defaults.css</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/spark/src/spark/skins/spark/CheckBoxSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VSlider.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ColorPicker.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateField.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/sparkskins/src/mx/skins/spark/CheckBoxSkin.mxml</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/dataGridClasses/DataGridHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/WindowedApplication.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Scroller.as</path>

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

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

     /**
      *  @private
-     *  Storage for the width property.
+     *  Storage for the width property. This should not be used to set the
+     *  width because it bypasses the mirroring transform in the setter.
      */
     mx_internal var _width:Number;

@@ -7609,6 +7610,8 @@
             if (_layoutFeatures == null)
                 initAdvancedLayoutFeatures();
             _layoutFeatures.mirror = mirror;
+            // width may have already been set
+            _layoutFeatures.layoutWidth = _width;
             invalidateTransform();
         }

@@ -9297,7 +9300,7 @@
         {
             _width = w;
 			if(_layoutFeatures)
-			{
+            {
 				_layoutFeatures.layoutWidth = w;  // for the mirror transform
 				invalidateTransform();
 			}


Transferred from the Adobe Open Source Subversion Repository

Revision: 6077
Author:   hmuller@adobe.com
Date:     2009-04-09T15:43:34.506603Z

Log Message:
-----------
Removed mirroring support.

QE Notes:
Doc Notes:
Bugs:
Reviewer: Chet

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/RichEditableText2.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/TextGraphicElement.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/flash-integration/src/mx/flash/UIMovieClip.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/SkinnableComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/AdvancedLayoutFeatures.as</path>

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

--- frameworks/projects/framework/src/mx/core/UIComponent.as
+++ frameworks/projects/framework/src/mx/core/UIComponent.as
@@ -2322,13 +2322,6 @@

             _width = value;

-            // The width is needed for the mirroring transform.
-            if (_layoutFeatures)
-            {
-                _layoutFeatures.layoutWidth = value;
-                invalidateTransform();
-            }
-
             dispatchEvent(new Event("widthChanged"));
         }
     }
@@ -3148,112 +3141,7 @@
     {
         _tweeningProperties = value;
     }
-
-
-    //----------------------------------
-    //  mirror
-    //----------------------------------
-
-    public function get mirror():Boolean
-    {
-        return _layoutFeatures && _layoutFeatures.mirror;
-    }
-
-    public function set mirror(value:Boolean):void
-    {
-        if (value == mirror)
-            return;
-
-        if (_layoutFeatures == null)
-            initAdvancedLayoutFeatures();
-        _layoutFeatures.mirror = value;
-        invalidateTransform();
-    }
-
-    //----------------------------------
-    //  dir
-    //----------------------------------
-
-    private var _dir:String;
-
-    public function get dir():String
-    {
-        return _dir;
-    }
-
-    public function set dir(value:String):void
-    {
-        if (_dir == value)
-            return;

-        _dir = value;
-        mirrorTree(findAncestorDir(this));
-    }
-
-    /**
-     *  @private
-     *  Return the value of the dir property for the first ancestor whose
-     *  dir is non-null.  Typically that's the FxApplication's dir, which
-     *  is default "ltr".
-     */
-    private function findAncestorDir(elt:IVisualElement):String
-    {
-        var parentElt:IVisualElement = elt.parent as IVisualElement;
-        if (!parentElt)
-            return null;
-        var ancestorDir:String = parentElt.dir;
-        return (ancestorDir) ? ancestorDir : findAncestorDir(parentElt);
-    }
-
-    /**
-     *  @private
-     *  Walk the IVisualElement tree setting the mirror property for elements whose
-     *  dir doesn't match their nearest ancestor's, clearing it if it does match.
-     *
-     *  This is a bit messy because we need to walk into FxComponent skins.  A
-     *  FxComponent::mirrorTree override handles that.
-     *
-     *  It's also messy because although this function is defined on UIComponent,
-     *  we need to visit IVisualElements that are not UIComponents, notably
-     *  GraphicalElements.
-     */
-    mx_internal function mirrorTree(ancestorDir:String):void
-    {
-        ancestorDir = mirrorElement(this, ancestorDir);
-
-        var root:IVisualElementContainer = this as IVisualElementContainer;
-        if (root)
-        {
-            var n:int = root.numElements;
-            for (var i:int = 0; i < n; i++)
-            {
-                var elt:IVisualElement = root.getElementAt(i);
-                if (elt is UIComponent)
-                    UIComponent(elt).mirrorTree(ancestorDir);
-                else
-                    mx_internal::mirrorElement(elt, ancestorDir);
-            }
-        }
-    }
-
-    /**
-     *  @private
-     *  If elt's dir doesn't match ancestorDir (see mirrorTree),
-     *  then set its mirror property.  If that happens elt's dir becomes
-     *  the new ancestorDir, which is what we return.
-     */
-    mx_internal function mirrorElement(elt:IVisualElement, ancestorDir:String):String
-    {
-        if (elt.dir && (elt.dir != ancestorDir))
-        {
-            elt.mirror = (ancestorDir) ? true : (elt.dir == "rtl");
-            ancestorDir = elt.dir;
-        }
-        else
-            elt.mirror = false;
-        return ancestorDir;
-    }
-
     //--------------------------------------------------------------------------
     //
     //  Properties: Manager access
@@ -6501,15 +6389,6 @@
         // but some need to react to even this early change.
         if (child is UIComponent)
             UIComponent(child).stylesInitialized();
-
-        if (child is IVisualElement)
-        {
-            var ancestorDir:String = findAncestorDir(IVisualElement(child));
-            if (child is UIComponent)
-                UIComponent(child).mx_internal::mirrorTree(ancestorDir);
-            else
-                mirrorElement(IVisualElement(child), ancestorDir);
-        }
     }

     /**
@@ -8433,11 +8312,6 @@
         if (_width != w)
         {
             _width = w;
-            if(_layoutFeatures)
-            {
-                _layoutFeatures.layoutWidth = w;
-                invalidateTransform();
-            }
             dispatchEvent(new Event("widthChanged"));
             changed = true;
         }
@@ -11370,7 +11244,6 @@
         features.layoutX = x;
         features.layoutY = y;
         features.layoutZ = z;
-        features.layoutWidth = width;
         _layoutFeatures = features;
         invalidateTransform();
     }


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

--- frameworks/projects/mx/src/mx/controls/HorizontalList.as
+++ frameworks/projects/mx/src/mx/controls/HorizontalList.as
@@ -78,6 +78,11 @@
  *  </pre>
  *
  *  @includeExample examples/HorizontalListExample.mxml
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class HorizontalList extends TileBase
 {
@@ -91,6 +96,11 @@

 	/**
 	 *  Constructor.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public function HorizontalList()
 	{


Transferred from the Adobe Open Source Subversion Repository

Revision: 5104
Author:   clucier@adobe.com
Date:     2009-02-27T14:51:34.248850Z

Log Message:
-----------
Default button support for Spark containers and editable text controls.
QE Notes:
Doc Notes:
Bugs: SDK-19420
Reviewer: Glenn, Gordon

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxContainerBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ContainerGlobals.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/Flex4Classes.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/IFocusManagerContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/colorPickerClasses/SwatchPanel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Menu.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/flex4/src/mx/components/TextView.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxDefaultButtonSkin.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/Button.as
+++ frameworks/projects/spark/src/spark/components/Button.as
@@ -21,12 +21,14 @@
 import flash.utils.Timer;

 import mx.components.baseClasses.FxComponent;
+import mx.core.IButton;
+import mx.core.IDataRenderer;
 import mx.events.FlexEvent;
 import mx.events.SandboxMouseEvent;
-import mx.core.IDataRenderer;
 import mx.graphics.baseClasses.TextGraphicElement;
 import mx.managers.IFocusManagerComponent;
 import mx.utils.BitFlagUtil;
+import mx.utils.StringUtil;

 include "../styles/metadata/BasicTextLayoutFormatStyles.as"

@@ -152,7 +154,8 @@
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-public class FxButton extends FxComponent implements IFocusManagerComponent, IDataRenderer
+public class FxButton extends FxComponent implements IFocusManagerComponent,
+    IDataRenderer, IButton
 {
     include "../core/Version.as";

@@ -458,6 +461,49 @@
         invalidateButtonState();
     }

+    //----------------------------------
+    //  emphasized
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the emphasized property.
+     */
+    private var _emphasized:Boolean = false;
+
+    [Inspectable(category="General", defaultValue="false")]
+
+    /**
+     *  Reflect the default/emphasized as potentially requested by the
+     *  focus manager.
+     *
+     *  @default false
+     */
+    public function get emphasized():Boolean
+    {
+        return _emphasized;
+    }
+
+    /**
+     *  @private
+     */
+    public function set emphasized(value:Boolean):void
+    {
+        if (value == _emphasized)
+            return;
+
+        _emphasized = value;
+        var style:String = styleName is String ? styleName as String : "";
+
+        if (!styleName || styleName is String)
+        {
+            if (_emphasized)
+                styleName = style + " emphasized";
+            else
+                styleName = style.split(" emphasized").join("");
+        }
+    }
+
     /**
      *  @private
      */


added VectorUtils.transpose()

added VectorUtils.transpose()

--- WeaveData/src/weave/utils/VectorUtils.as
+++ WeaveData/src/weave/utils/VectorUtils.as
@@ -563,6 +563,24 @@
 		}

 		/**
+		 * Transposes a two-dimensional table.
+		 */
+		public static function transpose(table:Array):Array
+		{
+			var result:Array = [];
+			for (var iCol:int = 0; iCol < table.length; iCol++)
+			{
+				var col:Array = table[iCol];
+				for (var iRow:int = 0; iRow < col.length; iRow++)
+				{
+					var row:Array = result[iRow] || (result[iRow] = []);
+					row[iRow][iCol] = col[iRow];
+				}
+			}
+			return result;
+		}
+
+		/**
 		 * Creates a lookup from item (or item property) to index. Does not consider duplicate items (or item property values).
 		 * @param propertyChain A property name or chain of property names to index on rather than the item itself.
 		 * @return A reverse lookup.


added functions for loading .weave file content.

--- WeaveJS/src/weavejs/core/WeaveArchive.as
+++ WeaveJS/src/weavejs/core/WeaveArchive.as
@@ -16,8 +16,11 @@
 package weavejs.core
 {
 	import weavejs.WeaveAPI;
+	import weavejs.data.AttributeColumnCache;
+	import weavejs.net.URLRequestUtils;
 	import weavejs.util.JS;
 	import weavejs.util.JSByteArray;
+	import weavejs.util.WeavePromise;

 	/**
 	 * This is an interface for reading and writing data in the Weave file format.
@@ -101,46 +104,76 @@
 			return zip.generate({type: 'blob'});
 		}

-		public static const HISTORY_SYNC_DELAY:int = 100;
-		public static const THUMBNAIL_SIZE:int = 200;
-		public static const ARCHIVE_THUMBNAIL_PNG:String = "thumbnail.png";
-		public static const ARCHIVE_SCREENSHOT_PNG:String = "screenshot.png";
-		public static const ARCHIVE_PLUGINS_AMF:String = "plugins.amf";
+//		public static const HISTORY_SYNC_DELAY:int = 100;
+//		public static const THUMBNAIL_SIZE:int = 200;
+//		public static const ARCHIVE_THUMBNAIL_PNG:String = "thumbnail.png";
+//		public static const ARCHIVE_SCREENSHOT_PNG:String = "screenshot.png";
+//		public static const ARCHIVE_URL_CACHE_AMF:String = "url-cache.amf";
 		public static const ARCHIVE_HISTORY_AMF:String = "history.amf";
-		public static const ARCHIVE_URL_CACHE_AMF:String = "url-cache.amf";
+		public static const ARCHIVE_HISTORY_JSON:String = "history.amf";
 		public static const ARCHIVE_COLUMN_CACHE_AMF:String = "column-cache.amf";
+		public static const ARCHIVE_COLUMN_CACHE_JSON:String = "column-cache.json";
+
+		/**
+		 * Loads a WeaveArchive from file content.
+		 */
+		public static function loadUrl(weave:Weave, fileUrl:String):WeavePromise
+		{
+			return new WeavePromise(weave.root, function(resolve:Function, reject:Function):void {
+				WeaveAPI.URLRequestUtils.request(weave.root, URLRequestUtils.GET, fileUrl, null, null)
+					.then(loadFileContent.bind(WeaveArchive, weave));
+			});
+		}
+
+		/**
+		 * Loads a WeaveArchive from file content.
+		 */
+		public static function loadFileContent(weave:Weave, fileContent:*):void
+		{
+			var archive:WeaveArchive = new WeaveArchive(fileContent);
+
+			var history:Object = archive.objects[ARCHIVE_HISTORY_AMF] || archive.objects[ARCHIVE_HISTORY_JSON];
+			if (history)
+			{
+				weave.history.setSessionState(history);
+			}
+			else
+			{
+				throw new Error("No session history found");
+			}
+
+			var columnCache:Object = archive.objects[ARCHIVE_COLUMN_CACHE_AMF] || archive.objects[ARCHIVE_COLUMN_CACHE_JSON];
+			if (columnCache)
+				(WeaveAPI.AttributeColumnCache as AttributeColumnCache).restoreCache(weave.root, columnCache);
+		}

 		/**
 		 * This function will create an object that can be saved to a file and recalled later with loadWeaveFileContent().
 		 */
-		public static function createWeaveFileContent(weave:Weave, saveScreenshot:Boolean=false, pluginList:Array = null):*
+		public static function createArchive(weave:Weave/*, saveScreenshot:Boolean=false*/):WeaveArchive
 		{
-			var output:WeaveArchive = new WeaveArchive();
+			var archive:WeaveArchive = new WeaveArchive();

 			// thumbnail should go first in the stream because we will often just want to extract the thumbnail and nothing else.
 //			updateLocalThumbnailAndScreenshot(saveScreenshot);

 			// embedded files
 //			for each (var fileName:String in WeaveAPI.URLRequestUtils.getLocalFileNames())
-//				output.files[fileName] = WeaveAPI.URLRequestUtils.getLocalFile(fileName);
-
-			// for forwards compatibility, don't include plugin list unless it has items
-//			if (pluginList && pluginList.length)
-//				output.objects[ARCHIVE_PLUGINS_AMF] = pluginList;
+//				archive.files[fileName] = WeaveAPI.URLRequestUtils.getLocalFile(fileName);

 			// session history
 			var _history:Object = weave.history.getSessionState();
-			output.objects[ARCHIVE_HISTORY_AMF] = _history;
+			archive.objects[ARCHIVE_HISTORY_AMF] = _history;

 			// TEMPORARY SOLUTION - url cache
 //			if (WeaveAPI.URLRequestUtils['saveCache'])
-//				output.objects[ARCHIVE_URL_CACHE_AMF] = WeaveAPI.URLRequestUtils.getCache();
+//				archive.objects[ARCHIVE_URL_CACHE_AMF] = WeaveAPI.URLRequestUtils.getCache();

 			// TEMPORARY SOLUTION - column cache
 			if (WeaveAPI.AttributeColumnCache['saveCache'])
-				output.objects[ARCHIVE_COLUMN_CACHE_AMF] = WeaveAPI.AttributeColumnCache['saveCache'];
+				archive.objects[ARCHIVE_COLUMN_CACHE_AMF] = WeaveAPI.AttributeColumnCache['saveCache'];

-			return output.serialize();
+			return archive;
 		}
 	}
 }


fix AbstractSceneNode.updateRoot() to be called "after" using setTimeout in order to make sure the addedToScene/removedFromScene signals are not called inside the added/removed signals

--- src/aerys/minko/scene/node/AbstractSceneNode.as
+++ src/aerys/minko/scene/node/AbstractSceneNode.as
@@ -13,6 +13,7 @@

 	import flash.utils.Dictionary;
 	import flash.utils.getQualifiedClassName;
+	import flash.utils.setTimeout;

 	use namespace minko_scene;

@@ -265,12 +266,12 @@

 		protected function addedHandler(child : ISceneNode, ancestor : Group) : void
 		{
-            updateRoot();
+            setTimeout(updateRoot, 0);
 		}

 		protected function removedHandler(child : ISceneNode, ancestor : Group) : void
 		{
-            updateRoot();
+			setTimeout(updateRoot, 0);
 		}

         private function updateRoot() : void


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

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

 package mx.controls.fileSystemClasses
 {


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

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

 package mx.automation.delegates.containers
 {


Passes should allow register callback as singleton

--- src/asfac/src/com/thedevstop/asfac/AsFactory.as
+++ src/asfac/src/com/thedevstop/asfac/AsFactory.as
@@ -1,10 +1,10 @@
 package com.thedevstop.asfac
 {
-	import avmplus.getQualifiedClassName;
 	import flash.errors.IllegalOperationError;
 	import flash.utils.describeType;
 	import flash.utils.Dictionary;
 	import flash.utils.getDefinitionByName;
+	import flash.utils.getQualifiedClassName;

 	/**
 	 * ...
@@ -59,8 +59,22 @@
 		{
 			if (callback.length !== 0)
 				throw new IllegalOperationError("Callback function registered for {0} must not have arguments".replace("{0}", getQualifiedClassName(type)));
-
-			_registrations[type] = callback;
+
+			if (asSingleton)
+				_registrations[type] = (function(callback:Function):Function
+				{
+					var instance:Object = null;
+
+					return function():Object
+					{
+						if (!instance)
+							instance = callback();
+
+						return instance;
+					};
+				})(callback);
+			else
+				_registrations[type] = callback;
 		}

 		private function resolveByClass(type:Class):*


A few comments.

A few comments.

git-svn-id: a3e1eb16dde062992de22c830ed8045c8013209a@93 c613c5cb-e716-0410-b11b-feb51c14d237

--- src/as/com/threerings/ezgame/EZGame.as
+++ src/as/com/threerings/ezgame/EZGame.as
@@ -53,6 +53,15 @@
      * Pick (do not remove) the specified number of elements from a collection,
      * and distribute them to a specific player or set them as a property
      * in the game data.
+     *
+     * @param collName the collection name.
+     * @param count the number of elements to pick
+     * @param msgOrPropName the name of the message or property
+     *        that will contain the picked elements.
+     * @param playerIndex if -1 (or unset), the picked elements should be
+     *        set on the gameObject as a property for all to see.
+     *        If a playerIndex is specified, only that player will receive
+     *        the elements as a message.
      */
     // TODO: a way to specify exclusive picks vs. duplicate-OK picks?
     function pickFromCollection (
@@ -63,6 +72,15 @@
      * Deal (remove) the specified number of elements from a collection,
      * and distribute them to a specific player or set them as a property
      * in the game data.
+     *
+     * @param collName the collection name.
+     * @param count the number of elements to pick
+     * @param msgOrPropName the name of the message or property
+     *        that will contain the picked elements.
+     * @param playerIndex if -1 (or unset), the picked elements should be
+     *        set on the gameObject as a property for all to see.
+     *        If a playerIndex is specified, only that player will receive
+     *        the elements as a message.
      */
     // TODO: figure out the method signature of the callback
     function dealFromCollection (


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

--- frameworks/projects/mx/src/mx/events/VideoEvent.as
+++ frameworks/projects/mx/src/mx/events/VideoEvent.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2005-2006 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.events
 {


 - fixed
 	- bug in CSSBoxModelLayoutManager with a save hack

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

--- src/reprise/ui/layoutmanagers/CSSBoxModelLayoutManager.as
+++ src/reprise/ui/layoutmanagers/CSSBoxModelLayoutManager.as
@@ -344,7 +344,7 @@
 			for (var i : int = 0; i < m_displayStack.length; i++)
 			{
 				var element : DisplayObject = m_displayStack[i].element;
-				element.parent.setChildIndex(element,
+				element.parent && element.parent.setChildIndex(element,
 					element.parent == lowerContainer ? lowerIndex++ : upperIndex++);
 			}
 			m_displayStack = null;


Removed compareBytes() and fixed issues with compareDynamicObjects().

Change-Id: I2c0a043bb843a31e8276404aef5387a099870ee2

--- WeaveCore/src/weave/compiler/StandardLib.as
+++ WeaveCore/src/weave/compiler/StandardLib.as
@@ -19,7 +19,6 @@

 package weave.compiler
 {
-	import flash.utils.ByteArray;
 	import flash.utils.getQualifiedClassName;

 	import mx.formatters.DateFormatter;
@@ -580,7 +579,7 @@
 		private static const _timezoneMultiplier:Number = 60000;

 		/**
-		 * This is much faster than using ObjectUtil.compare().	It is meant to be used on dynamic, untyped objects.
+		 * This compares two dynamic objects or primitive values and is much faster than ObjectUtil.compare().
 		 * @param a First dynamic object or primitive value.
 		 * @param b Second dynamic object or primitive value.
 		 * @return A value of zero if the two objects are equal, nonzero if not equal.
@@ -603,7 +602,7 @@
 				return ObjectUtil.numericCompare(a as Number, b as Number);
 			if (typeA == 'string')
 				return ObjectUtil.stringCompare(a as String, b as String);
-			if (typeA == 'xml')
+			if (typeA != 'object')
 				return 1;
 			if (a is Date && b is Date)
 				return ObjectUtil.dateCompare(a as Date, b as Date);
@@ -615,61 +614,35 @@
 				return ObjectUtil.stringCompare(qna, qnb);

 			var p:String;
+
+			// test if objects are dynamic
+			try
+			{
+				a[''];
+				b[''];
+			}
+			catch (e:Error)
+			{
+				return 1; // not dynamic objects
+			}
+
 			// if there are properties in a not found in b, return -1
 			for (p in a)
 			{
-				if (b[p] === undefined)
+				if (!b.hasOwnProperty(p))
 					return -1;
 			}
 			for (p in b)
 			{
 				// if there are properties in b not found in a, return 1
-				var aa:* = a[p];
-				if (aa === undefined)
+				if (!a.hasOwnProperty(p))
 					return 1;

-				var c:int = compareDynamicObjects(aa, b[p]);
+				var c:int = compareDynamicObjects(a[p], b[p]);
 				if (c != 0)
 					return c;
 			}

-			return 0;
-		}
-
-		private static const _1:ByteArray = new ByteArray();
-		private static const _2:ByteArray = new ByteArray();
-
-		/**
-		 * This function writes two objects to two separate ByteArrays and compares the bytes.
-		 * This is much faster than using ObjectUtil.compare() but not guaranteed to give the same results.
-		 * @param object1
-		 * @param object2
-		 * @return A value of zero if the ByteArray serializations of the objects are equal, nonzero if not equal.
-		 */
-		public static function compareBytes(object1:Object, object2:Object):int
-		{
-			if (object1 === object2)
-				return 0;
-
-			// prepare byte arrays
-			_1.length = 0;
-			_1.writeObject(object1);
-			_1.position = 0;
-			_2.length = 0;
-			_2.writeObject(object2);
-			_2.position = 0;
-
-			var n:int = _1.length;
-			if (n != _2.length)
-				return n < _2.length ? 1 : -1;
-
-			while (n-- > 0)
-			{
-				var b1:int = _1.readByte();
-				var b2:int = _2.readByte();
-				if (b1 != b2)
-					return b1 < b2 ? 1 : -1;
-			}
 			return 0;
 		}

@@ -703,11 +676,7 @@
 			for (i = 0; i < 100; i++)
 				if (compareDynamicObjects(o1,o2) != 0)
 					throw "StandardLib.compareDynamicObjects fail";
-			DebugTimer.lap('StandardLib.compareDynamicObjects');
-			for (i = 0; i < 100; i++)
-				if (compareBytes(o1,o2) != 0)
-					throw "StandardLib.compareBytes fail";
-			DebugTimer.end('StandardLib.compareBytes');
+			DebugTimer.end('StandardLib.compareDynamicObjects');
 		}
 	}
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 13022
Author:   gosmith@adobe.com
Date:     2009-12-17T01:20:19.923578Z

Log Message:
-----------
Added ASDoc for the Spark TextBaseAccImpl and RichEditableTextAccImpl, based on the opensource specs.

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/TextBaseAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/RichEditableTextAccImpl.as</path>

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

--- frameworks/projects/spark/src/spark/accessibility/TextBaseAccImpl.as
+++ frameworks/projects/spark/src/spark/accessibility/TextBaseAccImpl.as
@@ -23,10 +23,84 @@

 use namespace mx_internal;

-
 /**
- *  TextBaseAccImpl is a subclass of AccessibilityImplementation
- *  which implements accessibility for the TextBase class.
+ *  TextBaseAccImpl is the accessibility implementation class
+ *  for spark.components.TextBase.
+ *
+ *
When a Spark Label or RichText component is created,
+ *  its accessibilityImplementation property
+ *  is set to an instance of this class.
+ *  The Flash Player then uses this class to allow MSAA clients
+ *  such as screen readers to see and manipulate
+ *  the Label or RichText component.
+ *  See the mx.accessibility.AccImpl and
+ *  flash.accessibility.AccessibilityImplementation classes
+ *  for background information about accessibility implementation
+ *  classes and MSAA.

+ *
+ *
Children

+ *
+ *
A TextBase has no MSAA children.

+ *
+ *
Role

+ *
+ *
The MSAA Role of a TextBase is ROLE_SYSTEM_STATICTEXT.

+ *
+ *
Name

+ *
+ *
The MSAA Name of a TextBase is, by default, the text that it displays.
+ *  When wrapped in a FormItem,
+ *  this text will be combined with the FormItem's label.
+ *  To override this behavior,
+ *  set the component's accessibilityName property.

+ *
+ *
When the Name changes,
+ *  a TextBase dispatches the MSAA event EVENT_OBJECT_NAMECHANGE.

+ *
+ *
Description

+ *
+ *
The MSAA Description of a TextBase is, by default, the empty string,
+ *  but you can set the TextBase's accessibilityDescription
+ *  property.

+ *
+ *
State

+ *
+ *
The MSAA State of a TextBase is a combination of:
+ *

+ *
STATE_SYSTEM_UNAVAILABLE (when enabled is false)

+ *
STATE_SYSTEM_READONLY

+ *

+ *
+ *
When the State changes,
+ *  a TextBase dispatches the MSAA event EVENT_OBJECT_STATECHANGE.

+ *
+ *
Value

+ *
+ *
A TextBase does not have an MSAA Value.

+ *
+ *
Location

+ *
+ *
The MSAA Location of a TextBase is its bounding rectangle.

+ *
+ *
Default Action

+ *
+ *
A TextBase does not have an MSAA DefaultAction.

+ *
+ *
Focus

+ *
+ *
A TextBase does not accept focus.

+ *
+ *
Selection

+ *
+ *
A TextBase does not support selection in the MSAA sense.

+ *
+ *
Other

+ *
+ *
MSAA documentation suggests that the accessibilityShortcut
+ *  should be set to the shortcut keystroke for any associated input component.
+ *  Since the shortcut is an accessibility property
+ *  and not implementable by an AccessibilityImplementation
+ *  it is not addressed in TextBaseAccImpl.

  *
  *  @langversion 3.0
  *  @playerversion Flash 10


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

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

 package mx.controls.advancedDataGridClasses
 {


added StreamedGeometryColumn.prototype.requestAllMetadata()

--- WeaveJS/src/weavejs/data/column/StreamedGeometryColumn.as
+++ WeaveJS/src/weavejs/data/column/StreamedGeometryColumn.as
@@ -134,6 +134,14 @@

 		public var metadataTilesPerQuery:int = 200; //10;
 		public var geometryTilesPerQuery:int = 200; //30;
+
+		public function requestAllMetadata():void
+		{
+			var mode:String = metadataRequestMode;
+			metadataRequestMode = METADATA_REQUEST_MODE_ALL;
+			requestGeometryDetail(collectiveBounds, Infinity);
+			metadataRequestMode = mode;
+		}

 		public function requestGeometryDetail(dataBounds:Bounds2D, lowestImportance:Number):void
 		{


+ 增加技能快捷键

+ 增加技能快捷键

--- age/src/age/pad/KeyboardPadConfig.as
+++ age/src/age/pad/KeyboardPadConfig.as
@@ -56,6 +56,18 @@
 		 */
 		public var attackTimeout:uint = 150;

+		public var skill1:uint = Keyboard.U;
+
+		public var skill2:uint = Keyboard.I;
+
+		public var skill3:uint = Keyboard.O;
+
+		public var skill4:uint = Keyboard.P;
+
+		public var skill5:uint = Keyboard.LEFTBRACKET;
+
+		public var skill6:uint = Keyboard.RIGHTBRACKET;
+
 		/**
 		 * constructor
 		 *


We now use the same slow down as we use everywhere else.


Bug 652768: add version guard for JSON class (r=stejohns)

--- core/JSON.as
+++ core/JSON.as
@@ -52,9 +52,10 @@

 package
 {
-    // Bug 651971: Lars notes: Spec requires that JSON's [[Prototype]] is
-    // Object.prototype; but is it?  Investigate.

+    include "api-versions.as"
+
+    [API(CONFIG::SWF_13)]
     [native(cls="JSONClass", classgc="exact", methods="auto", construct="none")]
     public final class JSON
     {


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

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

 package mx.olap
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 14908
Author:   sramaswa@adobe.com
Date:     2010-03-22T13:21:15.947214Z

Log Message:
-----------
Merging revision 14898 from 4.x branch
QE notes: The AsyncResponder.fault signature has changed to use FaultEvent instead of ErrorMessage.
Doc notes: The AsyncResponder.fault signature has changed to use FaultEvent instead of ErrorMessage. We need to update the docs to reflect this in the samples.
Bugs: FLEXDMV-1900
Reviewer: Sameer
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/datavisualization/bundles/en_US/olap.properties</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/datavisualization/src/mx/olap/OLAPCube.as</path>

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

--- frameworks/projects/advancedgrids/src/mx/olap/OLAPCube.as
+++ frameworks/projects/advancedgrids/src/mx/olap/OLAPCube.as
@@ -27,10 +27,11 @@
 import mx.collections.Sort;
 import mx.core.mx_internal;
 import mx.events.CubeEvent;
-import mx.messaging.messages.ErrorMessage;
 import mx.resources.ResourceManager;
 import mx.rpc.AsyncToken;
+import mx.rpc.Fault;
 import mx.rpc.IResponder;
+import mx.rpc.events.FaultEvent;

 use namespace mx_internal;

@@ -1033,7 +1034,7 @@
     	if (queryAxis.tuples.length == 0)
     	{
                 var message:String = ResourceManager.getInstance().getString(
-                    "olap", "zeroElementsOnAxis", [index]);
+                   "olap", "zeroElementsOnAxis", [index]);
                 throw new QueryError(message);
     	}
     }
@@ -1052,6 +1053,9 @@
             var result:OLAPResult;
             var q:IOLAPQuery = _queriesPending[0];
             var deleteEntry:Boolean = true;
+            var fault:Fault;
+            var faultCode:String;
+            var faultEvent:FaultEvent;

             try
             {
@@ -1073,17 +1077,23 @@
             }
             catch(qe:QueryError)
             {
+                faultCode = ResourceManager.getInstance().getString("olap", "queryError");
+                fault = new Fault(faultCode, qe.message);
+                faultEvent = FaultEvent.createEvent(fault, token);
                 for each (responder in token.responders)
                 {
-                    responder.fault(qe.message);
+                    responder.fault(faultEvent);
                 }
                 result = null;
             }
             catch (e:Error)
             {
+                faultCode = ResourceManager.getInstance().getString("olap", "error");
+                fault = new Fault(faultCode, e.message);
+                faultEvent = FaultEvent.createEvent(fault, token);
                 for each (responder in token.responders)
                 {
-                    responder.fault(e.message);
+                    responder.fault(faultEvent);
                 }
                 result = null;
             }


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

--- frameworks/projects/framework/src/mx/core/ClassFactory.as
+++ frameworks/projects/framework/src/mx/core/ClassFactory.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2005-2006 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@1259556 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/core/IUIComponent.as
+++ frameworks/projects/framework/src/mx/core/IUIComponent.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.core
 {


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

--- frameworks/projects/framework/src/mx/styles/metadata/PaddingStyles.as
+++ frameworks/projects/framework/src/mx/styles/metadata/PaddingStyles.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.
 //
 ////////////////////////////////////////////////////////////////////////////////


remove deprecated camera related matrices

--- src/aerys/minko/render/shader/part/ShaderPart.as
+++ src/aerys/minko/render/shader/part/ShaderPart.as
@@ -123,24 +123,9 @@
 			return _main._meshBindings.getParameter('worldToLocal', 16);
 		}

-		protected function get worldToViewMatrix() : SFloat
-		{
-			return _main._sceneBindings.getParameter('worldToView', 16);
-		}
-
-		protected function get viewToWorldMatrix() : SFloat
-		{
-			return _main._sceneBindings.getParameter('viewToWorld', 16);
-		}
-
 		protected function get worldToScreenMatrix() : SFloat
 		{
 			return _main._sceneBindings.getParameter('worldToScreen', 16);
-		}
-
-		protected function get screenToWorldMatrix() : SFloat
-		{
-			return _main._sceneBindings.getParameter('screenToWorld', 16);
 		}

 		protected function get projectionMatrix() : SFloat
@@ -844,29 +829,14 @@
 			return multiply4x4(localSpaceVector, localToWorldMatrix);
 		}

-		protected final function localToView(localSpaceVector : Object) : SFloat
-		{
-			return worldToView(localToWorld(localSpaceVector));
-		}
-
 		protected final function worldToLocal(worldSpaceVector : Object) : SFloat
 		{
 			return multiply4x4(worldSpaceVector, worldToLocalMatrix);
 		}

-		protected final function worldToView(worldSpaceVector : Object) : SFloat
-		{
-			return multiply4x4(worldSpaceVector, worldToViewMatrix);
-		}
-
 		protected final function worldToScreen(worldSpaceVector : Object) : SFloat
 		{
-			return viewToScreen(worldToView(worldSpaceVector));
-		}
-
-		protected final function viewToWorld(value : Object) : SFloat
-		{
-			return multiply4x4(value, viewToWorldMatrix);
+			return multiply4x4(worldSpaceVector, worldToScreenMatrix);
 		}

 		protected final function localToScreen(localSpaceVector : Object) : SFloat
@@ -890,16 +860,6 @@
 		protected final function deltaWorldToLocal(vertex : Object) : SFloat
 		{
 			return multiply3x3(vertex, worldToLocalMatrix);
-		}
-
-		protected final function deltaWorldToView(vertex : Object) : SFloat
-		{
-			return multiply3x3(vertex, worldToViewMatrix);
-		}
-
-		protected final function deltaViewToWorld(vertex : Object) : SFloat
-		{
-			return multiply3x3(vertex, viewToWorldMatrix);
 		}

 		protected final function getTexture(textureResource : ITextureResource,


Oh baby, I think I fixed it.
- It seems that the camera gets fakey "locked" at the size it was set to
  when the user grants access to it.
  - Listen for status changes, don't set things up until the camera is
    unmuted.
  - record the size at the time of unmuting.

This all seems to work, but I worry about what would happen if access
to the camera had already been granted when this code runs.
There'd be no way to find out what the size was access was granted.
Fortunately, I believe we only use this code presently in a standalone
appletty-type-thing, so access is always granted in here.

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

--- src/as/com/threerings/flash/CameraSnapshotter.as
+++ src/as/com/threerings/flash/CameraSnapshotter.as
@@ -19,7 +19,6 @@
 import com.threerings.util.Log;
 import com.threerings.util.MethodQueue;

-// TODO: use PreferredCamera?
 public class CameraSnapshotter extends Sprite
 {
     /**
@@ -78,7 +77,7 @@
     public function setCamera (camera :Camera) :void
     {
         if (_video != null) {
-            if (_bitmap.parent != null) {
+            if (_bitmap != null && _bitmap.parent != null) {
                 removeChild(_bitmap);
             }
             if (_video.parent != null) {
@@ -88,12 +87,34 @@
             detachVideo();
         }

+        if (_camera != null) {
+            _camera.removeEventListener(StatusEvent.STATUS, handleCameraStatus);
+        }
+
         _camera = camera;
         if (_camera == null) {
             return;
         }
+        _camera.addEventListener(StatusEvent.STATUS, handleCameraStatus);
+        if (_camera.muted) {
+            return;
+
+        } else if (_correctionWidth == 0) {
+            setCorrection();
+        }

         attachVideo();
+    }
+
+    protected function handleCameraStatus (event :StatusEvent) :void
+    {
+        if (event.code == "Camera.Unmuted") {
+            setCorrection();
+            attachVideo();
+
+        } else {
+            detachVideo();
+        }
     }

     public function getCameraName () :String
@@ -108,7 +129,9 @@
     public function setMode (width :int, height :int, fps :Number, favorArea :Boolean = true) :void
     {
         clearSnapshot();
-        removeChild(_video);
+        if (_video != null) {
+            removeChild(_video);
+        }

         detachVideo();
         _camera.setMode(width, height, fps, favorArea);
@@ -121,19 +144,8 @@
             return; // throw exception?
         }

-        // NOTE: we specify a matrix to scale the video, because no matter what size it really
-        // is, it will usually snapshot as if it were at the smallest size. STRANGE.
-        // Note that this stupid hack doesn't always work, but it mostly works, and it's better
-        // than leaving everything alone, which mostly didn't work. But then again,
-        // this code is specifically saying: "fuck up the scale", so if Adobe fixes their
-        // bug in the future, this will cause broken behavior.
-        _bitmap.bitmapData.draw(_video);
-            //new Matrix(_camera.width / 160, 0, 0, _camera.height / 120));
-        Log.getLog(this).debug("Camera snapshotted",
-            "camera.width", _camera.width, "camera.height", _camera.height,
-            "video.width", _video.width, "video.height", _video.height,
-            "videoWidth", _video.videoWidth, "videoHeight", _video.videoHeight,
-            "bitmap.width", _bitmap.width, "bitmap.height", _bitmap.height);
+        _bitmap.bitmapData.draw(_video,
+            new Matrix(_camera.width / _correctionWidth, 0, 0, _camera.height / _correctionHeight));

         if (_video.parent != null) {
             removeChild(_video);
@@ -146,10 +158,10 @@
         if (_camera == null) {
             return;
         }
-        if (_bitmap.parent != null) {
+        if (_bitmap != null && _bitmap.parent != null) {
             removeChild(_bitmap);
         }
-        if (_video.parent == null) {
+        if (_video != null && _video.parent == null) {
             addChild(_video);
         }
     }
@@ -160,6 +172,16 @@
             return null;
         }
         return _bitmap.bitmapData;
+    }
+
+    /**
+     * There appears to be a bug with the camera that "locks" it to the size it was at when
+     * it was unmuted.
+     */
+    protected function setCorrection () :void
+    {
+        _correctionWidth = _camera.width;
+        _correctionHeight = _camera.height;
     }

     protected function attachVideo () :void
@@ -189,5 +211,9 @@
     protected var _video :Video;

     protected var _bitmap :Bitmap;
+
+    protected var _correctionWidth :int;
+
+    protected var _correctionHeight :int;
 }
 }