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

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

 package mx.charts.series.items
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 20275
Author:   rfrishbe@adobe.com
Date:     2011-02-10T19:09:50.248259Z

Log Message:
-----------
Increasing the hitArea of TextInput to make it easier to drop the caret in the correct place.  We can increase the hitArea on the left by increasing marginLeft (same for marginRight on right), and we can increase the hitArea on the bottom by increasing the height of the TextField.  There's no way to increase the hitArea of the top, but I did file an AIR request to allow us to change the hitArea of a TextField.

QE notes: -
Doc notes:
Bugs: SDK-29405, SDK-29406
Reviewer: Glenn, Jason SJ
Tests run: checkintests, Mac ran TextInput/TextArea tests and some TextInput ones need to be updated
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableTextField.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TextInputSkin.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/TextInputSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/TextInputSkin.as
@@ -181,9 +181,33 @@

         if (textDisplay)
         {
+            // We're going to do a few tricks to try to increase the size of our hitArea to make it
+            // easier for users to select text or put the caret in a certain spot.  To do that,
+            // rather than set textDisplay.x=paddingLeft,  we are going to set
+            // textDisplay.leftMargin = paddingLeft.  In addition, we're going to size the height
+            // of the textDisplay larger than just the size of the text inside to increase the hitArea
+            // on the bottom.  We'll also assign textDisplay.rightMargin = paddingRight to increase the
+            // the hitArea on the right.  Unfortunately, there's no way to increase the hitArea on the top
+            // just yet, but these three tricks definitely help out with regards to user experience.
+            // See http://bugs.adobe.com/jira/browse/SDK-29406 and http://bugs.adobe.com/jira/browse/SDK-29405
+
+            // set leftMargin, rightMargin to increase the hitArea.  Need to set it before calling commitStyles().
+            var marginChanged:Boolean = ((textDisplay.leftMargin != paddingLeft) ||
+                (textDisplay.rightMargin != paddingRight));
+
+            textDisplay.leftMargin = paddingLeft;
+            textDisplay.rightMargin = paddingRight;
+
+            // need to force a styleChanged() after setting leftMargin, rightMargin if they
+            // changed values.  Then we can validate the styles through commitStyles()
+            if (marginChanged)
+                textDisplay.styleChanged(null);
             textDisplay.commitStyles();
-            setElementSize(textDisplay, unscaledTextWidth, unscaledTextHeight);
-            setElementPosition(textDisplay, paddingLeft, textY);
+
+            // the height of the textDisplay to unscaledTextHeight + paddingBottom to increase hitArea on bottom
+            setElementSize(textDisplay, unscaledWidth, unscaledTextHeight + paddingBottom);
+            // set x=0 since we're using textDisplay.leftMargin = paddingLeft
+            setElementPosition(textDisplay, 0, textY);
         }

         if (promptDisplay)


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

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

 package spark.components
 {


Put Upload New button at top of media picker list

--- flexEditor/src/org/arisgames/editor/components/ItemEditorMediaPickerView.as
+++ flexEditor/src/org/arisgames/editor/components/ItemEditorMediaPickerView.as
@@ -172,6 +172,15 @@
 		var numIconDefaults:Number = 0;
 		for (var k:Number = 0; k <= 1; k++) //Iterates over list twice; once for uploaded items, again for default
 		{
+			//Add "Upload new" in between uploaded and default pictures
+			if(k==0 && (!this.isIconPicker && !this.isNPC)){
+				xmlData.node.(@label == AppConstants.MEDIATYPE_IMAGE).appendChild('<node label="' + AppConstants.MEDIATYPE_UPLOADNEW + '" icon="'+ AppConstants.MEDIATREEICON_UPLOAD +'"/>');
+				xmlData.node.(@label == AppConstants.MEDIATYPE_AUDIO).appendChild('<node label="' + AppConstants.MEDIATYPE_UPLOADNEW + '" icon="'+ AppConstants.MEDIATREEICON_UPLOAD +'"/>');
+				xmlData.node.(@label == AppConstants.MEDIATYPE_VIDEO).appendChild('<node label="' + AppConstants.MEDIATYPE_UPLOADNEW + '" icon="'+ AppConstants.MEDIATREEICON_UPLOAD +'"/>');
+			}
+			else if(k == 0){
+				xmlData.appendChild('<node label="' + AppConstants.MEDIATYPE_UPLOADNEW + '" icon="'+ AppConstants.MEDIATREEICON_UPLOAD +'"/>');
+			}
 			for (var j:Number = 0; j < media.length; j++)
 			{
 				var o:Object = media[j];
@@ -237,16 +246,6 @@
 					}
 				}
 			}
-
-			//Add "Upload new" in between uploaded and default pictures
-			if(k==0 && (!this.isIconPicker && !this.isNPC)){
-				xmlData.node.(@label == AppConstants.MEDIATYPE_IMAGE).appendChild('<node label="' + AppConstants.MEDIATYPE_UPLOADNEW + '" icon="'+ AppConstants.MEDIATREEICON_UPLOAD +'"/>');
-				xmlData.node.(@label == AppConstants.MEDIATYPE_AUDIO).appendChild('<node label="' + AppConstants.MEDIATYPE_UPLOADNEW + '" icon="'+ AppConstants.MEDIATREEICON_UPLOAD +'"/>');
-				xmlData.node.(@label == AppConstants.MEDIATYPE_VIDEO).appendChild('<node label="' + AppConstants.MEDIATYPE_UPLOADNEW + '" icon="'+ AppConstants.MEDIATREEICON_UPLOAD +'"/>');
-			}
-			else if(k == 0){
-				xmlData.appendChild('<node label="' + AppConstants.MEDIATYPE_UPLOADNEW + '" icon="'+ AppConstants.MEDIATREEICON_UPLOAD +'"/>');
-			}
 		}
         trace("ItemEditorMediaPickerView: handleLoadingOfMediaIntoXML: Just finished loading Media Objects into XML.  Here's what the new XML looks like:");
         this.printXMLData();


Max0 nodes.

Max0 nodes.

Setters that write to a span property (width/height) now have a Max0 node inserted, which returns Math.max(0, child.eval())

--- raw/src/org/yellcorp/lib/layout/Layout.as
+++ raw/src/org/yellcorp/lib/layout/Layout.as
@@ -302,6 +302,7 @@
     {
         resolveVirtualSetters();
         filterProgramInPlace(updateProgram, virtualGetResolver);
+        filterProgramInPlace(updateProgram, new Max0SpanSetters());
         if (rounding)
         {
             filterProgramInPlace(updateProgram, new RoundSetters());
@@ -737,6 +738,33 @@
 }

+class Max0 implements ASTNode
+{
+    public var child:ASTNode;
+
+    public function Max0(child:ASTNode)
+    {
+        this.child = child;
+    }
+
+    public function eval():*
+    {
+        var e:* = child.eval();
+        return e > 0 ? e : 0;
+    }
+
+    public function acceptFilter(filter:ASTFilter):ASTNode
+    {
+        return filter.filterMax0Node(this);
+    }
+
+    public function filterChildren(filter:ASTFilter):void
+    {
+        child = filter.filter(child);
+    }
+}
+
+
 class GetRuntimeProp implements ASTNode
 {
     public var object:Object;
@@ -944,6 +972,7 @@
     public function filterMultiplyNode(n:Multiply):ASTNode { return n; }
     public function filterDivideNode(n:Divide):ASTNode { return n; }
     public function filterRoundNode(n:Round):ASTNode { return n; }
+    public function filterMax0Node(n:Max0):ASTNode { return n; }
     public function filterGetRuntimePropNode(n:GetRuntimeProp):ASTNode { return n; }
     public function filterSetRuntimePropNode(n:SetRuntimeProp):ASTNode { return n; }
     public function filterGetVirtualPropNode(n:GetVirtualProp):ASTNode { return n; }
@@ -994,6 +1023,22 @@
 }

+class Max0SpanSetters extends ASTFilter
+{
+    override public function filterSetRuntimePropNode(n:SetRuntimeProp):ASTNode
+    {
+        if (n.prop == "width" || n.prop == "height")
+        {
+            return new SetRuntimeProp(n.object, n.prop, new Max0(n.child));
+        }
+        else
+        {
+            return n;
+        }
+    }
+}
+
+
 class RoundSetters extends ASTFilter
 {
     public override function filterSetRuntimePropNode(n:SetRuntimeProp):ASTNode


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

--- frameworks/projects/rpc/src/mx/messaging/management/MBeanOperationInfo.as
+++ frameworks/projects/rpc/src/mx/messaging/management/MBeanOperationInfo.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.messaging.management
 {


better error message when xml schema loader fails to load schema

--- as3/xobjas3/src/com/rpath/xobj/XObjSchemaLoader.as
+++ as3/xobjas3/src/com/rpath/xobj/XObjSchemaLoader.as
@@ -29,6 +29,7 @@
 [Bindable]
 public class XObjSchemaLoader
 {
+    public var schemaName:String;
     public var schemaUrl:String;

     private var schemaManager:SchemaManager;
@@ -46,8 +47,9 @@
     public var loadFailedHandler:Function;
     public var loadStatusHandler:Function;

-    public function XObjSchemaLoader(schemaUrl:String=null, loadCompleteHandler:Function=null, loadFailedHandler:Function=null, loadStatusHandler:Function=null)
+    public function XObjSchemaLoader(schemaName:String=null, schemaUrl:String=null, loadCompleteHandler:Function=null, loadFailedHandler:Function=null, loadStatusHandler:Function=null)
     {
+        this.schemaName = schemaName;
         this.schemaUrl = schemaUrl;
         this.loadCompleteHandler = loadCompleteHandler;
         this.loadFailedHandler = loadFailedHandler;
@@ -69,7 +71,7 @@

     private function schemaLoader_xmlLoadHandler(event:XMLLoadEvent):void
     {
-        message = "Loading schema " + event.location + "...";
+        message = "Loading schema " + schemaName + " from " + event.location + "...";
         processStatus();
     }

@@ -81,7 +83,7 @@

     private function schemaLoader_faultHandler(event:FaultEvent):void
     {
-        message = event.fault.faultString;
+        message = "Failed loading schema " + schemaName + " from " + schemaUrl + ": " + event.fault.faultString;
         processFailure();
     }


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

--- frameworks/projects/authoringsupport/src/com/adobe/viewsource/ViewSource.as
+++ frameworks/projects/authoringsupport/src/com/adobe/viewsource/ViewSource.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 com.adobe.viewsource
 {


Mouseover text in carousel. Better handling of knowing when a stream ends. New smoke testing page.

git-svn-id: 02605e11d3a461bc7e12f3f3880edf4b0c8dcfd0@4835 3e7533ad-8678-4d30-8e38-00a379d3f0d0

--- src/laml/display/Carousel.as
+++ src/laml/display/Carousel.as
@@ -105,10 +105,15 @@
 			}

 			itemView.addEventListener(PayloadEvent.CHANGED, itemChangedHandler, false, 0, true);
+			itemView.addEventListener(PayloadEvent.SELECTION_CHANGED, itemSelectionChangedHandler, false, 0, true);
 			contentContainer.addChild(itemView);
 		}

 		protected function itemChangedHandler(event:PayloadEvent):void {
+			dispatchEvent(event);
+		}
+
+		protected function itemSelectionChangedHandler(event:PayloadEvent):void {
 			dispatchEvent(event);
 		}


Changed error 807 to RTSP error code (401)

--- src/com/axis/audioclient/AxisTransmit.as
+++ src/com/axis/audioclient/AxisTransmit.as
@@ -184,7 +184,7 @@
         authOpts = parsed.headers['www-authenticate'];
         var newAuthState:String = auth.nextMethod(authState, authOpts);
         if (authState === newAuthState) {
-          ErrorManager.dispatchError(807, [urlParsed.host]);
+          ErrorManager.dispatchError(parsed.code);
           return;
         }


Added support for inline functions.

Added support for inline functions.

--- WeaveCore/src/weave/compiler/Compiler.as
+++ WeaveCore/src/weave/compiler/Compiler.as
@@ -164,6 +164,11 @@
 		 */
 		public static const OPERATOR_ESCAPE:String = '\\';

+		public static const FUNCTION:String = 'function';
+		public static const FUNCTION_PARAM_NAMES:String = 'names';
+		public static const FUNCTION_PARAM_VALUES:String = 'values';
+		public static const FUNCTION_CODE:String = 'code';
+
 		/**
 		 * This is a String containing all the characters that are treated as whitespace.
 		 */
@@ -393,7 +398,7 @@
 					default: throw new Error("Too many constructor parameters (maximum 10)");
 				}
 			};
-			operators['function'] = function(..._):void { };
+			operators[FUNCTION] = function(..._):*{};
 			// property access should not be optimized to constants
 			operators["."] = function(object:*, ...chain):* {
 				for (var i:int = 0; i < chain.length; i++)
@@ -1121,8 +1126,51 @@

 				if (leftBracket == '{')
 				{
-					compiledToken = compileTokens(subArray, true);
-					tokens.splice(open, 2, compileOperator(';', [compiledToken]));
+					// It's ok if it creates an extra {} wrapper because optimize() will take care of that.
+					// It's important to remember that the brackets existed for statement processing.
+					tokens.splice(open, 2, compileOperator(';', [compileTokens(subArray, true)]));
+
+					// compile inline function
+					if (open >= 2 && tokens[open - 2] == FUNCTION)
+					{
+						var call:CompiledFunctionCall = compiledToken as CompiledFunctionCall;
+						if (!call || call.evaluatedMethod != operators[','])
+							throwInvalidSyntax(FUNCTION);
+
+						// verify that each parameter inside operator ',' is a variable name or a local assignment to a constant.
+						var variableNames:Array = [];
+						var variableValues:Array = [];
+						for each (token in call.compiledParams)
+						{
+							var variable:CompiledFunctionCall = token as CompiledFunctionCall;
+							if (!variable)
+								throwInvalidSyntax(FUNCTION);
+
+							if (!variable.compiledParams)
+							{
+								// local variable
+								variableNames.push(variable.evaluatedMethod);
+								variableValues.push(undefined);
+							}
+							else if (variable.evaluatedMethod == operators['='] && variable.compiledParams.length == 2 && variable.compiledParams[1] is CompiledConstant)
+							{
+								// local variable assignment
+								variableNames.push(variable.evaluatedParams[0]);
+								variableValues.push(variable.evaluatedParams[1]);
+							}
+							else
+								throwInvalidSyntax(FUNCTION);
+						}
+						var functionParams:Object = {};
+						functionParams[FUNCTION_PARAM_NAMES] = variableNames;
+						functionParams[FUNCTION_PARAM_VALUES] = variableValues;
+						functionParams[FUNCTION_CODE] = optimize(tokens[open]);
+						call = compileOperator(FUNCTION, [new CompiledConstant(null, functionParams)]);
+						call.originalTokens = tokens.slice(open - 2, open + 1);
+						tokens.splice(open - 2, 3, call);
+						continue;
+					}
+
 					continue;
 				}

@@ -2068,6 +2116,12 @@
 							else // all other single-parameter type casting operations
 								result = method(call.evaluatedParams[0]);
 						}
+						else if (method == operators[FUNCTION])
+						{
+							// inline function
+							var funcParams:Object = call.evaluatedParams[0];
+							result = compileObjectToFunction(funcParams[FUNCTION_CODE], symbolTable, ignoreRuntimeErrors, useThisScope, funcParams[FUNCTION_PARAM_NAMES], funcParams[FUNCTION_PARAM_VALUES]);
+						}
 						else
 						{
 							// function call


made all URLs protocol relative

made all URLs protocol relative

--- src/flash/htmlelements/YouTubeElement.as
+++ src/flash/htmlelements/YouTubeElement.as
@@ -131,7 +131,7 @@

 			// chromeless
 			if (_isChromeless) {
-				_playerLoader.load(new URLRequest("http://www.youtube.com/apiplayer?version=3&controls=1&rel=0&showinfo=0&iv_load_policy=1"));
+				_playerLoader.load(new URLRequest("//www.youtube.com/apiplayer?version=3&controls=1&rel=0&showinfo=0&iv_load_policy=1"));
 			}

@@ -307,7 +307,7 @@
 			_youTubeId = getYouTubeId(url);

 			if (!_playerIsLoaded && !_isChromeless) {
-				_playerLoader.load(new URLRequest("http://www.youtube.com/v/" + _youTubeId + "?version=3&controls=0&rel=0&showinfo=0&iv_load_policy=1"));
+				_playerLoader.load(new URLRequest("//www.youtube.com/v/" + _youTubeId + "?version=3&controls=0&rel=0&showinfo=0&iv_load_policy=1"));
 			}
 		}


fixed bug in debug label

fixed bug in debug label

Change-Id: I12207557357dfcc62b72dfbb1bc191d15fdb352f

--- WeaveAdmin/src/weave/ui/EntityNode.as
+++ WeaveAdmin/src/weave/ui/EntityNode.as
@@ -75,7 +75,7 @@
 				var typeStr:String = typeStrs[typeInts.indexOf(typeInt)];
 				var childrenStr:String = '';
 				if (typeInt != Entity.TYPE_COLUMN)
-					childrenStr = '; ' + _childNodes.length + ' children';
+					childrenStr = '; ' + children.length + ' children';
 				var idStr:String = '(' + typeStr + "#" + id + childrenStr + ') ' + debugId(this);
 				title = idStr + ' ' + title;
 			}


As part of the cleanup, remove tons of code from ColorMatrix.as. We really don't need all this stuff for applying mutations to the color wheel bitmap data. Infact, most likely the direction here is to entirely remove the need for the ColorMatrix class and incorporate all it's functionality in Wheel.as itself -- meaning that Wheel.as can apply saturation and brightness modifiers to _itself_. This will also limit exposure and code duplication of this work in ColorWheel.mxml.

--- com/thenduks/ilac/ColorMatrix.as
+++ com/thenduks/ilac/ColorMatrix.as
@@ -28,68 +28,16 @@
 THE SOFTWARE.
 */

-// Changes in v1.1:
-// Changed the RGB to luminance constants
-// Added colorize() method
-
-// Changes in v1.2:
-// Added clone()
-// Added randomize()
-// Added blend()
-// Added "filter" property
-
-// Changes in v1.3:
-// Added invertAlpha()
-// Added thresholdAlpha()
-
-// Changes in v1.4:
-// Added luminance2Alpha()
-
-//Changes in v1.5
-// Added rotateX();
-// Added rotateY();
-// Added rotateZ();
-// Added shearZ();
-
-//changes in v2.0
-// AS3 optimizations
-// Added setMultiplicators()
-// Added clearChannels()
-// Added rotateHue()
-// Added transformVector()
-// Added applyMatrix()
-// Added rotateRed()
-// Added rotateGreen()
-// Added rotateBlue()
-// Added shearRed()
-// Added shearGreen()
-// Added shearBlue()
-
-//changes in v2.1
-// Added applyColorDeficiency()
-
 package com.thenduks.ilac {
   import flash.filters.ColorMatrixFilter;

   public class ColorMatrix {
-    public static const COLOR_DEFICIENCY_TYPES:Array = [
-      'Protanopia', 'Protanomaly', 'Deuteranopia',
-      'Deuteranomaly', 'Tritanopia', 'Tritanomaly',
-      'Achromatopsia', 'Achromatomaly'
-    ];
-
     // RGB to Luminance conversion constants as found on
     // Charles A. Poynton's colorspace-faq:
     // http://www.faqs.org/faqs/graphics/colorspace-faq/
     private static const LUMA_R:Number = 0.212671;
     private static const LUMA_G:Number = 0.71516;
     private static const LUMA_B:Number = 0.072169;
-
-    // There seem different standards for converting RGB
-    // values to Luminance. This is the one by Paul Haeberli:
-    private static const LUMA_R2:Number = 0.3086;
-    private static const LUMA_G2:Number = 0.6094;
-    private static const LUMA_B2:Number = 0.0820;

     private static const ONETHIRD:Number = 1 / 3;

@@ -103,10 +51,6 @@
     private static const RAD:Number = Math.PI / 180;

     public var matrix:Array;
-
-    private var preHue:ColorMatrix;
-    private var postHue:ColorMatrix;
-    private var hueInitialized:Boolean;

     /*
       Function: ColorMatrix
@@ -150,15 +94,6 @@
       return new ColorMatrix( matrix );
     }

-    public function invert():void {
-      concat(
-        [ -1 ,  0,  0, 0, 255,
-           0 , -1,  0, 0, 255,
-           0 ,  0, -1, 0, 255,
-           0,   0,  0, 1,   0 ]
-      );
-    }
-
     /*
       Function: adjustSaturation

@@ -195,34 +130,6 @@
       );
     }

-    /*
-      Function: adjustContrast
-
-      Changes the contrast
-
-      Parameters:
-        s - typical values come in the range -1.0 ... 1.0 where
-              -1.0 means no contrast (grey)
-              0 means no change
-              1.0 is high contrast
-
-      Returns: void
-    */
-    public function adjustContrast( r:Number, g:Number = NaN, b:Number = NaN ):void {
-      if( isNaN( g ) ) { g = r; }
-      if( isNaN( b ) ) { b = r; }
-      r += 1;
-      g += 1;
-      b += 1;
-
-      concat(
-        [ r, 0, 0, 0, (128 * (1 - r)),
-          0, g, 0, 0, (128 * (1 - g)),
-          0, 0, b, 0, (128 * (1 - b)),
-          0, 0, 0, 1, 0 ]
-      );
-    }
-
     public function adjustBrightness( r:Number, g:Number=NaN, b:Number = NaN ):void {
       if( isNaN( g ) ) { g = r; }
       if( isNaN( b ) ) { b = r; }
@@ -232,58 +139,6 @@
           0, 1, 0, 0, g,
           0, 0, 1, 0, b,
           0, 0, 0, 1, 0 ]
-      );
-    }
-
-    public function adjustHue( degrees:Number ):void {
-      degrees *= RAD;
-      var cos:Number = Math.cos( degrees );
-      var sin:Number = Math.sin( degrees );
-
-      concat(
-        [ ((LUMA_R + (cos * (1 - LUMA_R))) + (sin * -(LUMA_R))),
-          ((LUMA_G + (cos * -(LUMA_G))) + (sin * -(LUMA_G))),
-          ((LUMA_B + (cos * -(LUMA_B))) + (sin * (1 - LUMA_B))),
-          0, 0,
-
-          ((LUMA_R + (cos * -(LUMA_R))) + (sin * 0.143)),
-          ((LUMA_G + (cos * (1 - LUMA_G))) + (sin * 0.14)),
-          ((LUMA_B + (cos * -(LUMA_B))) + (sin * -0.283)),
-          0, 0,
-
-          ((LUMA_R + (cos * -(LUMA_R))) + (sin * -((1 - LUMA_R)))),
-          ((LUMA_G + (cos * -(LUMA_G))) + (sin * LUMA_G)),
-          ((LUMA_B + (cos * (1 - LUMA_B))) + (sin * LUMA_B)),
-          0, 0,
-
-          0, 0, 0, 1, 0 ]
-      );
-    }
-
-    public function rotateHue( degrees:Number ):void {
-      initHue();
-
-      concat( preHue.matrix );
-      rotateBlue( degrees );
-      concat( postHue.matrix );
-    }
-
-    public function luminance2Alpha():void {
-      concat(
-        [ 0, 0, 0, 0, 255,
-          0, 0, 0, 0, 255,
-          0, 0, 0, 0, 255,
-          LUMA_R, LUMA_G, LUMA_B, 0, 0 ]
-      );
-    }
-
-    public function adjustAlphaContrast( amount:Number ):void {
-      amount += 1;
-      concat(
-        [ 1, 0, 0, 0, 0,
-          0, 1, 0, 0, 0,
-          0, 0, 1, 0, 0,
-          0, 0, 0, amount, (128 * (1 - amount)) ]
       );
     }

@@ -318,192 +173,6 @@
       );
     }

-    public function setChannels( r:int = 1, g:int = 2, b:int = 4, a:int = 8 ):void {
-      var rf:Number = ((((((r & 1) == 1)) ? 1 : 0 + (((r & 2) == 2)) ? 1 : 0) +
-                      (((r & 4) == 4)) ? 1 : 0) + (((r & 8) == 8)) ? 1 : 0);
-      if( rf > 0 ) { rf = (1 / rf); }
-
-      var gf:Number = ((((((g & 1) == 1)) ? 1 : 0 + (((g & 2) == 2)) ? 1 : 0) +
-                      (((g & 4) == 4)) ? 1 : 0) + (((g & 8) == 8)) ? 1 : 0);
-      if( gf > 0 ) { gf = (1 / gf); }
-
-      var bf:Number = ((((((b & 1) == 1)) ? 1 : 0 + (((b & 2) == 2)) ? 1 : 0) +
-                      (((b & 4) == 4)) ? 1 : 0) + (((b & 8) == 8)) ? 1 : 0);
-      if( bf > 0 ) { bf = (1 / bf); }
-
-      var af:Number = ((((((a & 1) == 1)) ? 1 : 0 + (((a & 2) == 2)) ? 1 : 0) +
-                      (((a & 4) == 4)) ? 1 : 0) + (((a & 8) == 8)) ? 1 : 0);
-      if( af > 0 ) { af = (1 / af); }
-
-      concat(
-        [ (((r & 1) == 1)) ? rf : 0,
-          (((r & 2) == 2)) ? rf : 0,
-          (((r & 4) == 4)) ? rf : 0,
-          (((r & 8) == 8)) ? rf : 0,
-          0,
-          (((g & 1) == 1)) ? gf : 0,
-          (((g & 2) == 2)) ? gf : 0,
-          (((g & 4) == 4)) ? gf : 0,
-          (((g & 8) == 8)) ? gf : 0,
-          0,
-          (((b & 1) == 1)) ? bf : 0,
-          (((b & 2) == 2)) ? bf : 0,
-          (((b & 4) == 4)) ? bf : 0,
-          (((b & 8) == 8)) ? bf : 0,
-          0,
-          (((a & 1) == 1)) ? af : 0,
-          (((a & 2) == 2)) ? af : 0,
-          (((a & 4) == 4)) ? af : 0,
-          (((a & 8) == 8)) ? af : 0,
-          0 ]
-      );
-    }
-
-    public function blend( mat:ColorMatrix, amount:Number ):void {
-      var inv_amount:Number = (1 - amount);
-      var i:int = 0;
-
-      while( i < 20 ) {
-        matrix[i] = ((inv_amount * Number(matrix[i])) +
-                    (amount * Number(mat.matrix[i])));
-        i++;
-      }
-    }
-
-    public function average( r:Number = ONETHIRD, g:Number = ONETHIRD, b:Number = ONETHIRD):void {
-      concat(
-        [ r, g, b, 0, 0,
-          r, g, b, 0, 0,
-          r, g, b, 0, 0,
-          0, 0, 0, 1, 0 ]
-      );
-    }
-
-    public function threshold( threshold:Number, factor:Number = 256 ):void {
-      concat(
-        [ (LUMA_R * factor),
-          (LUMA_G * factor),
-          (LUMA_B * factor),
-          0,
-          (-(factor) * threshold),
-
-          (LUMA_R * factor),
-          (LUMA_G * factor),
-          (LUMA_B * factor),
-          0,
-          (-(factor) * threshold),
-
-          (LUMA_R * factor),
-          (LUMA_G * factor),
-          (LUMA_B * factor),
-          0,
-          (-(factor) * threshold),
-
-          0, 0, 0, 1, 0 ]
-      );
-    }
-
-    public function desaturate():void {
-      concat(
-        [ LUMA_R, LUMA_G, LUMA_B, 0, 0,
-          LUMA_R, LUMA_G, LUMA_B, 0, 0,
-          LUMA_R, LUMA_G, LUMA_B, 0, 0,
-          0, 0, 0, 1, 0 ]
-      );
-    }
-
-    public function randomize( amount:Number = 1 ):void {
-      var inv_amount:Number = (1 - amount);
-      var r1:Number = (inv_amount + (amount * (Math.random() - Math.random())));
-      var g1:Number = (amount * (Math.random() - Math.random()));
-      var b1:Number = (amount * (Math.random() - Math.random()));
-      var o1:Number = ((amount * 0xFF) * (Math.random() - Math.random()));
-      var r2:Number = (amount * (Math.random() - Math.random()));
-      var g2:Number = (inv_amount + (amount * (Math.random() - Math.random())));
-      var b2:Number = (amount * (Math.random() - Math.random()));
-      var o2:Number = ((amount * 0xFF) * (Math.random() - Math.random()));
-      var r3:Number = (amount * (Math.random() - Math.random()));
-      var g3:Number = (amount * (Math.random() - Math.random()));
-      var b3:Number = (inv_amount + (amount * (Math.random() - Math.random())));
-      var o3:Number = ((amount * 0xFF) * (Math.random() - Math.random()));
-
-      concat(
-        [ r1, g1, b1, 0, o1,
-          r2, g2, b2, 0, o2,
-          r3, g3, b3, 0, o3,
-          0, 0, 0, 1, 0 ]
-      );
-    }
-
-    public function setMultiplicators( r:Number = 1, g:Number = 1, b:Number = 1, a:Number = 1 ):void {
-      concat(
-        [ r, 0, 0, 0, 0,
-          0, g, 0, 0, 0,
-          0, 0, b, 0, 0,
-          0, 0, 0, a, 0 ]
-      );
-    }
-
-    public function clearChannels( r:Boolean = false, g:Boolean = false, b:Boolean = false, a:Boolean = false ):void {
-      if( r ) {
-        matrix[0] = matrix[1] = matrix[2] = matrix[3] = matrix[4] = 0;
-      }
-      if( g ) {
-        matrix[5] = matrix[6] = matrix[7] = matrix[8] = matrix[9] = 0;
-      }
-      if( b ) {
-        matrix[10] = matrix[11] = matrix[12] = matrix[13] = matrix[14] = 0;
-      }
-      if( a ) {
-        matrix[15] = matrix[16] = matrix[17] = matrix[18] = matrix[19] = 0;
-      }
-    }
-
-    public function thresholdAlpha( threshold:Number, factor:Number = 256 ):void {
-      concat(
-        [ 1, 0, 0, 0, 0,
-          0, 1, 0, 0, 0,
-          0, 0, 1, 0, 0,
-          0, 0, 0, factor, (-factor * threshold) ]
-      );
-    }
-
-    public function averageRGB2Alpha():void {
-      concat(
-        [ 0, 0, 0, 0, 255,
-          0, 0, 0, 0, 255,
-          0, 0, 0, 0, 255,
-          ONETHIRD, ONETHIRD, ONETHIRD, 0, 0 ]
-      );
-    }
-
-    public function invertAlpha():void {
-      concat(
-        [ 1, 0, 0, 0, 0,
-          0, 1, 0, 0, 0,
-          0, 0, 1, 0, 0,
-          0, 0, 0, -1, 255 ]
-      );
-    }
-
-    public function rgb2Alpha( r:Number, g:Number, b:Number ):void {
-      concat(
-        [ 0, 0, 0, 0, 255,
-          0, 0, 0, 0, 255,
-          0, 0, 0, 0, 255,
-          r, g, b, 0, 0 ]
-      );
-    }
-
-    public function setAlpha( alpha:Number ):void {
-      concat(
-        [ 1, 0, 0, 0, 0,
-          0, 1, 0, 0, 0,
-          0, 0, 1, 0, 0,
-          0, 0, 0, alpha, 0 ]
-      );
-    }
-
     public function get filter():ColorMatrixFilter {
       return new ColorMatrixFilter( matrix );
     }
@@ -526,154 +195,5 @@

       matrix = temp;
     }
-
-    public function rotateRed( degrees:Number ):void {
-      rotateColor( degrees, 2, 1 );
-    }
-
-    public function rotateGreen( degrees:Number ):void {
-      rotateColor( degrees, 0, 2 );
-    }
-
-    public function rotateBlue( degrees:Number ):void {
-       rotateColor( degrees, 1, 0 );
-    }
-
-    private function rotateColor( degrees:Number, x:int, y:int ):void {
-      degrees *= RAD;
-      var mat:Array = IDENTITY.concat();
-      mat[ x + x * 5 ] = mat[ y + y * 5 ] = Math.cos( degrees );
-      mat[ y + x * 5 ] = Math.sin( degrees );
-      mat[ x + y * 5 ] = -Math.sin( degrees );
-      concat( mat );
-    }
-
-    public function shearRed( green:Number, blue:Number ):void {
-      shearColor( 0, 1, green, 2, blue );
-    }
-
-    public function shearGreen( red:Number, blue:Number ):void {
-      shearColor( 1, 0, red, 2, blue );
-    }
-
-    public function shearBlue( red:Number, green:Number ):void {
-      shearColor( 2, 0, red, 1, green );
-    }
-
-    private function shearColor( x:int, y1:int, d1:Number, y2:int, d2:Number ):void {
-      var mat:Array = IDENTITY.concat();
-      mat[ y1 + x * 5 ] = d1;
-      mat[ y2 + x * 5 ] = d2;
-      concat( mat );
-    }
-
-    public function applyColorDeficiency( type:String ):void {
-      // the values of this method are copied from http://www.nofunc.com/Color_Matrix_Library/
-      switch( type ) {
-        case 'Protanopia':
-          concat( [ 0.567, 0.433, 0, 0, 0, 0.558, 0.442, 0, 0, 0,
-                    0, 0.242, 0.758, 0, 0, 0, 0, 0, 1, 0 ] );
-          break;
-        case 'Protanomaly':
-          concat( [ 0.817, 0.183, 0, 0, 0, 0.333, 0.667, 0, 0, 0,
-                    0, 0.125, 0.875, 0, 0, 0, 0, 0, 1, 0 ] );
-          break;
-        case 'Deuteranopia':
-          concat( [ 0.625, 0.375, 0, 0, 0, 0.7, 0.3, 0, 0, 0,
-                    0, 0.3, 0.7, 0, 0, 0, 0, 0, 1, 0 ] );
-          break;
-        case 'Deuteranomaly':
-          concat( [ 0.8, 0.2, 0, 0, 0, 0.258, 0.742, 0, 0, 0,
-                    0, 0.142, 0.858, 0, 0, 0, 0, 0, 1, 0 ] );
-          break;
-        case 'Tritanopia':
-          concat( [ 0.95, 0.05, 0, 0, 0, 0, 0.433, 0.567, 0, 0,
-                    0, 0.475, 0.525, 0, 0, 0, 0, 0, 1, 0 ] );
-          break;
-        case 'Tritanomaly':
-          concat( [ 0.967, 0.033, 0, 0, 0, 0, 0.733, 0.267, 0, 0,
-                    0, 0.183, 0.817, 0, 0, 0, 0, 0, 1, 0 ] );
-          break;
-        case 'Achromatopsia':
-            concat( [ 0.299, 0.587, 0.114, 0, 0, 0.299, 0.587, 0.114, 0, 0,
-                      0.299, 0.587, 0.114, 0, 0, 0, 0, 0, 1, 0 ] );
-            break;
-        case 'Achromatomaly':
-          concat( [ 0.618, 0.320, 0.062, 0, 0, 0.163, 0.775, 0.062, 0, 0,
-                    0.163, 0.320, 0.516, 0, 0, 0, 0, 0, 1, 0 ] );
-          break;
-      }
-    }
-
-    public function applyMatrix( rgba:uint ):uint {
-      var a:Number = ( rgba >>> 24 ) & 0xff;
-      var r:Number = ( rgba >>> 16 ) & 0xff;
-      var g:Number = ( rgba >>> 8 ) & 0xff;
-      var b:Number = rgba & 0xff;
-
-      var r2:int = 0.5 + r * matrix[0] + g * matrix[1] +
-                         b * matrix[2] + a * matrix[3] + matrix[4];
-      var g2:int = 0.5 + r * matrix[5] + g * matrix[6] +
-                         b * matrix[7] + a * matrix[8] + matrix[9];
-      var b2:int = 0.5 + r * matrix[10] + g * matrix[11] +
-                         b * matrix[12] + a * matrix[13] + matrix[14];
-      var a2:int = 0.5 + r * matrix[15] + g * matrix[16] +
-                         b * matrix[17] + a * matrix[18] + matrix[19];
-
-      if( a2 < 0 )   a2 = 0;
-      if( a2 > 255 ) a2 = 255;
-      if( r2 < 0 )   r2 = 0;
-      if( r2 > 255 ) r2 = 255;
-      if( g2 < 0 )   g2 = 0;
-      if( g2 > 255 ) g2 = 255;
-      if( b2 < 0 )   b2 = 0;
-      if( b2 > 255 ) b2 = 255;
-
-      return a2 << 24 | r2 << 16 | g2 << 8 | b2;
-    }
-
-    public function transformVector( values:Array ):void {
-      if( values.length != 4 ) return;
-
-      var r:Number = values[0] * matrix[0] + values[1] * matrix[1] +
-                     values[2] * matrix[2] + values[3] * matrix[3] + matrix[4];
-      var g:Number = values[0] * matrix[5] + values[1] * matrix[6] +
-                     values[2] * matrix[7] + values[3] * matrix[8] + matrix[9];
-      var b:Number = values[0] * matrix[10] + values[1] * matrix[11] +
-                     values[2] * matrix[12] + values[3] * matrix[13] + matrix[14];
-      var a:Number = values[0] * matrix[15] + values[1] * matrix[16] +
-                     values[2] * matrix[17] + values[3] * matrix[18] + matrix[19];
-
-      values[0] = r;
-      values[1] = g;
-      values[2] = b;
-      values[3] = a;
-    }
-
-    private function initHue():void {
-      //var greenRotation:Number = 35.0;
-      var greenRotation:Number = 39.182655;
-
-      if( !hueInitialized ) {
-        hueInitialized = true;
-        preHue = new ColorMatrix();
-        preHue.rotateRed( 45 );
-        preHue.rotateGreen( -greenRotation );
-
-        var lum:Array = [ LUMA_R2, LUMA_G2, LUMA_B2, 1.0 ];
-
-        preHue.transformVector( lum );
-
-        var red:Number = lum[0] / lum[2];
-        var green:Number = lum[1] / lum[2];
-
-        preHue.shearBlue( red, green );
-
-        postHue = new ColorMatrix();
-        postHue.shearBlue( -red, -green );
-        postHue.rotateGreen( greenRotation );
-        postHue.rotateRed( -45.0 );
-      }
-    }
   }
 }


fixed null pointer error

fixed null pointer error

--- WeaveCore/src/weave/compiler/Compiler.as
+++ WeaveCore/src/weave/compiler/Compiler.as
@@ -1935,16 +1935,16 @@
 						// check the first parameter of the 'in' operator
 						call = call.compiledParams[0] as CompiledFunctionCall;

-						if (call.evaluatedMethod == operators[','] && call.compiledParams.length == 2)
+						if (call && call.evaluatedMethod == operators[','] && call.compiledParams.length == 2)
 						{
 							var _var:CompiledFunctionCall = call.compiledParams[0] as CompiledFunctionCall;
 							if (!_var || _var.evaluatedMethod != operators[ST_VAR])
 								throwInvalidSyntax(statement);
-							call = call.compiledParams[1]; // should be the variable
+							call = call.compiledParams[1] as CompiledFunctionCall; // should be the variable
 						}

 						// the 'in' operator must have a variable or property reference as its first parameter
-						if (!(call.compiledParams == null || call.evaluatedMethod == operators['.'])) // not a variable and not a property
+						if (!call || !(call.compiledParams == null || call.evaluatedMethod == operators['.'])) // not a variable and not a property
 							throwInvalidSyntax(statement);
 					}


Modify spine file loader, support slot and display object scale.

--- src/utils/formatSpineData.as
+++ src/utils/formatSpineData.as
@@ -33,6 +33,7 @@
 const SCALE:String = "scale";
 const COMBINE:String = "combine";
 const ATTACHMENT:String = "attachment";
+const ADDITIVE:String = "additive";
 const COLOR:String = "color";

 const A_NAME:String = "name";
@@ -142,16 +143,16 @@
 			case "1":
 			case "true":
 			case "yes":
+				boneXML.@[ConstValues.A_SCALE_MODE] = 2;
+				break;
+			default:
 				boneXML.@[ConstValues.A_SCALE_MODE] = 0;
 				break;
-			default:
-				boneXML.@[ConstValues.A_SCALE_MODE] = 1;
-				break;
 		}
 	}
 	else
 	{
-		boneXML.@[ConstValues.A_SCALE_MODE] = 0;
+		boneXML.@[ConstValues.A_SCALE_MODE] = 2;
 	}

 	var parent:String = boneObject[A_PARENT];
@@ -172,6 +173,7 @@

 	var parentName:String;
 	var firstAttachment:String;
+    var blendMode:String;
 	var zOrder:int;
 	for(var slotName:String in skinObject)
 	{
@@ -183,24 +185,42 @@
 			{
 				parentName = slotObjectInList[A_BONE];
 				firstAttachment = slotObjectInList[ATTACHMENT];
+                var additive:Object = slotObjectInList[ADDITIVE];
+                if(additive && additive is Boolean)
+                {
+                    var isAdditive:Boolean = additive as Boolean;
+                    if(isAdditive)
+                    {
+                        blendMode = "add";
+                    }
+                    else
+                    {
+                        blendMode = "normal";
+                    }
+                }
+                else
+                {
+                    blendMode = "normal";
+                }
 				break;
 			}
 			zOrder ++;
 		}
 		//默认的display标记出来，以便放到displayList的首位
-		skinXML.appendChild(formatSlot(skinObject[slotName], slotName, parentName, firstAttachment, zOrder, textureAtlasXML));
+		skinXML.appendChild(formatSlot(skinObject[slotName], slotName, parentName, firstAttachment, blendMode, zOrder, textureAtlasXML));
 	}

 	return skinXML;
 }

-function formatSlot(slotObject:Object, slotName:String, slotParent:String, firstAttachment:String, zOrder:int, textureAtlasXML:XML):XML
+function formatSlot(slotObject:Object, slotName:String, slotParent:String, firstAttachment:String, blendMode:String, zOrder:int, textureAtlasXML:XML):XML
 {
 	var slotXML:XML =
 		<{ConstValues.SLOT}
 			{ConstValues.A_NAME}={slotName}
 			{ConstValues.A_PARENT}={slotParent}
 			{ConstValues.A_Z_ORDER}={zOrder}
+            {ConstValues.A_BLENDMODE}={blendMode}
 		/>;

 	var displayXML:XML;
@@ -239,6 +259,17 @@
 	{
 		scaleX = width / Number(subTextureXML.@[ConstValues.A_WIDTH]);
 		scaleY = height / Number(subTextureXML.@[ConstValues.A_HEIGHT]);
+
+		var spineScaleX:String = displayObject[A_SCALE_X];
+		if (spineScaleX)
+		{
+			scaleX *= Number(spineScaleX);
+		}
+		var spineScaleY:String = displayObject[A_SCALE_Y];
+		if (spineScaleY)
+		{
+			scaleY *= Number(spineScaleY);
+		}

 		if(isNaN(scaleX))
 		{


FillPainter now takes offsets

FillPainter now takes offsets

--- src/org/openPyro/painters/FillPainter.as
+++ src/org/openPyro/painters/FillPainter.as
@@ -24,13 +24,17 @@
 		}

+		public var initX:Number = 0;
+		public var initY:Number = 0;
+
+

 		public function draw(gr:Graphics, w:Number, h:Number):void
 		{
-			var drawX:int = 0;
-			var drawY:int = 0;
-			var drawW:int = w;
-			var drawH:int = h;
+			var drawX:Number = initX;
+			var drawY:Number = initY;
+			var drawW:Number = w;
+			var drawH:Number = h;

 			if(_padding){
 				drawX += _padding.left


Transferred from the Adobe Open Source Subversion Repository

Revision: 8544
Author:   jimurphy@adobe.com
Date:     2009-07-14T14:11:21.674965Z

Log Message:
-----------
-Merged revisions 8510,8532 from 3.x

-Integrated:
lcds - 4.0.0.8527

Modified Paths:
--------------
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/lib/flex-messaging-common.jar</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/DividedBox.as</path>

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

--- frameworks/projects/mx/src/mx/controls/DataGrid.as
+++ frameworks/projects/mx/src/mx/controls/DataGrid.as
@@ -5433,6 +5433,7 @@
                 {
                     header.headerItemsChanged = true;
                     header.invalidateDisplayList(); // make sure it redraws, even if size didn't change
+                header.validateNow();
                     // internal renderers could have changed
                 }
             }


Fixed issue (RTEs) with editable data grid when it has an array of simple values (Number, String etc)

--- frameworks/projects/mx/src/mx/controls/DataGrid.as
+++ frameworks/projects/mx/src/mx/controls/DataGrid.as
@@ -2797,15 +2797,21 @@
                 // this is an old recordset - use its columns
                 var n:int = cols.length;
                 var colName:Object;
-                for (var i:int = 0; i < n; i++)
-                {
-                    colName = cols[i];
-                    if (colName is QName)
-                        colName = QName(colName).localName;
-                    col = new DataGridColumn();
-                    col.dataField = String(colName);
-                    newCols.push(col);
-                }
+				if (n == 0) {
+					col = new DataGridColumn();
+					newCols.push(col);
+				}
+				else {
+	                for (var i:int = 0; i < n; i++)
+	                {
+	                    colName = cols[i];
+	                    if (colName is QName)
+	                        colName = QName(colName).localName;
+	                    col = new DataGridColumn();
+	                    col.dataField = String(colName);
+	                    newCols.push(col);
+	                }
+				}
             }

             columns = newCols;
@@ -5326,8 +5332,8 @@
                 var newData:Object = itemEditorInstance[_columns[event.columnIndex].editorDataField];
                 var property:String = _columns[event.columnIndex].dataField;
                 var data:Object = event.itemRenderer.data;
-                var typeInfo:String = "";
-                for each(var variable:XML in describeType(data).variable)
+                var typeInfo:String = describeType(data).@name;
+                for each (var variable:XML in describeType(data).variable)
                 {
                     if (property == variable.@name.toString())
                     {
@@ -5359,9 +5365,12 @@
                 /** Old code assumed that the property would be a simply name that could be dereferenced
                   * through array notation. Using a method call here provides, minimally, an override
                   * point where developers could extend this functionality in their own datagrid subclass **/
-                if (property != null && getCurrentDataValue( data, property ) !== newData)
-                {
-                    bChanged = setNewValue( data, property, newData, event.columnIndex );
+                if (getCurrentDataValue(data, property) !== newData)
+                {
+                    bChanged = setNewValue(data, property, newData, event.columnIndex);
+
+					if (property == null)
+						collection[event.rowIndex] = newData;
                 }
                 if (bChanged && !(data is IPropertyChangeNotifier || data is XML))
                 {
@@ -5414,9 +5423,9 @@
     /**
      *  @private
      */
-    protected function isComplexColumn( property:String ):Boolean
-    {
-        return ( property.indexOf( "." ) != -1 );
+    protected function isComplexColumn(property:String):Boolean
+    {
+        return property != null && property.indexOf( "." ) != -1;
     }

     //Gets the reference to the parent object where a property will be updated
@@ -5441,33 +5450,37 @@
     /**
      *  @private
      */
-    protected function getCurrentDataValue( data:Object, property:String ):String
-    {
-        if ( !isComplexColumn( property ) )
-            return data[ property ];
+    protected function getCurrentDataValue(data:Object, property:String):String
+    {
+		if (property == null)
+			return String(data);
+
+        if (!isComplexColumn(property))
+            return data[property];

-        var complexFieldNameComponents:Array = property.split( "." );
-        var obj:Object = deriveComplexFieldReference( data, complexFieldNameComponents );
-
-        return String( obj );
+        var complexFieldNameComponents:Array = property.split(".");
+        var obj:Object = deriveComplexFieldReference(data, complexFieldNameComponents);
+
+        return String(obj);
     }

     //Passing all of these parameters as it basically allows everything you would need to subclass for all sorts of fun implementations
     /**
      *  @private
      */
-    protected function setNewValue( data:Object, property:String, value:Object, columnIndex:int ):Boolean
-    {
-        if ( !isComplexColumn( property ) )
-        {
-            data[ property ] = value;
+    protected function setNewValue(data:Object, property:String, value:Object, columnIndex:int):Boolean
+    {
+        if (!isComplexColumn(property))
+        {
+			if (property != null)
+            	data[property] = value;
         }
         else
         {
-            var complexFieldNameComponents:Array = property.split( "." );
+            var complexFieldNameComponents:Array = property.split(".");
             var lastProp:String = complexFieldNameComponents.pop();
-            var parent:Object = deriveComplexFieldReference( data, complexFieldNameComponents );
-            parent[ lastProp ] = value;
+            var parent:Object = deriveComplexFieldReference(data, complexFieldNameComponents);
+            parent[lastProp] = value;
         }

         //The value they typed in is always converted to a string, but is the value actually a string in the dataprovider?


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

--- frameworks/projects/mx/src/mx/events/VideoEvent.as
+++ frameworks/projects/mx/src/mx/events/VideoEvent.as
@@ -23,6 +23,11 @@
  *  the VideoDisplay.state property.
  *
  *  @see mx.controls.VideoDisplay
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class VideoEvent extends Event
 {
@@ -42,6 +47,11 @@
      *
This is a responsive state. In the responsive state, calls to
      *  the play(), load(), stop(),
      *  and pause() methods are executed immediately.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
 	public static const BUFFERING:String = "buffering";

@@ -72,6 +82,11 @@
 	 *

 	 *
 	 *  @eventType close
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public static const CLOSE:String = "close";

@@ -102,6 +117,11 @@
 	 *

 	 *
 	 *  @eventType complete
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public static const COMPLETE:String = "complete";

@@ -115,6 +135,11 @@
 	 *  play(), load(), stop(),
 	 *  and pause() methods are queued,
 	 *  and then executed when the control changes to the responsive state.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public static const CONNECTION_ERROR:String = "connectionError";

@@ -125,6 +150,11 @@
      *
This is a responsive state. In the responsive state, calls to
      *  the play(), load(), stop(),
      *  and pause() methods are executed immediately.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
 	public static const DISCONNECTED:String = "disconnected";

@@ -138,6 +168,11 @@
 	 *  play(), load(), stop(),
 	 *  and pause() methods are queued,
 	 *  and then executed when the control changes to the responsive state.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public static const EXEC_QUEUED_CMD:String = "execQueuedCmd";

@@ -150,6 +185,11 @@
 	 *  play(), load(), stop(),
 	 *  and pause() methods are queued,
 	 *  and then executed when the control changes to the responsive state.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public static const LOADING:String = "loading";

@@ -162,6 +202,11 @@
      *
This is a responsive state. In the responsive state, calls to
      *  the play(), load(), stop(),
      *  and pause() methods are executed immediately.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public static const PAUSED:String = "paused";

@@ -192,6 +237,11 @@
 	 *

 	 *
 	 *  @eventType playheadUpdate
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public static const PLAYHEAD_UPDATE:String = "playheadUpdate";

@@ -204,6 +254,11 @@
      *
This is a responsive state. In the responsive state, calls to
      *  the play(), load(), stop(),
      *  and pause() methods are executed immediately.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public static const PLAYING:String = "playing";

@@ -234,6 +289,11 @@
 	 *

 	 *
 	 *  @eventType ready
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public static const READY:String = "ready";

@@ -245,6 +305,11 @@
 	 *  play(), load(), stop(),
 	 *  and pause() methods are queued,
 	 *  and then executed when the control changes to the responsive state.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public static const RESIZING:String = "resizing";

@@ -275,6 +340,11 @@
 	 *

 	 *
 	 *  @eventType rewind
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public static const REWIND:String = "rewind";

@@ -288,6 +358,11 @@
 	 *  play(), load(), stop(),
 	 *  and pause() methods are queued,
 	 *  and then executed when the control changes to the responsive state.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public static const REWINDING:String = "rewinding";

@@ -300,6 +375,11 @@
 	 *  play(), load(), stop(),
 	 *  and pause() methods are queued,
 	 *  and then executed when the control changes to the responsive state.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public static const SEEKING:String = "seeking";

@@ -330,6 +410,11 @@
 	 *

 	 *
 	 *  @eventType stateChange
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
     public static const STATE_CHANGE:String = "stateChange";

@@ -342,6 +427,11 @@
      *
This is a responsive state. In the responsive state, calls to
      *  the play(), load(), stop(),
      *  and pause() methods are executed immediately.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public static const STOPPED:String = "stopped";

@@ -365,6 +455,11 @@
 	 *  when the event occurs.
 	 *
 	 *  @param playeheadTime The location of the playhead when the event occurs.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
 	public function VideoEvent(type:String, bubbles:Boolean = false,
 							   cancelable:Boolean = false,
@@ -389,6 +484,11 @@
     /**
 	 *  The location of the playhead of the VideoDisplay control
 	 *  when the event occurs.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public var playheadTime:Number;

@@ -401,6 +501,11 @@
 	 *  when the event occurs.
 	 *
 	 *  @see mx.controls.VideoDisplay#state
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
 	public var state:String;

@@ -413,6 +518,11 @@
 	 *  when the event occurs.
 	 *
 	 *  @see mx.controls.VideoDisplay#stateResponsive
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public function get stateResponsive():Boolean
 	{


Added keyword expansion for file version

--- src/br/com/stimuli/string/printf.as
+++ src/br/com/stimuli/string/printf.as
@@ -214,6 +214,7 @@
 /** A string rep of a Date object on the current locale.*/
 const DATE_TOLOCALE_FORMATTER : String = "c";

+var version String = "$Id$"


Transferred from the Adobe Open Source Subversion Repository

Revision: 18139
Author:   hmuller@adobe.com
Date:     2010-10-12T19:02:33.052295Z

Log Message:
-----------
Data,Grid variableRowHeight is now false by default.

The DefaultGridItemRenderer and UITextFieldItemRenderer classes now configure their wordWrap property to match variableRowHeight, unless wordWrap is explicitly specified.

Fixed layoutItemRenderers() which had never (!) called the prepare()/discard() IGridItemRenderer methods.

Fixed GridDimensions/getTypicalContentHeight() - removed dependency on variableRowHeight.

QE notes: This commit's cyclone failures have been vetted
Doc notes:
Bugs: SDK-28179
Reviewer: Kevin
Tests run: checkin, mustella cyclone
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/IGridItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/UITextFieldGridItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Grid.as</path>
<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/skins/spark/TextFieldGridItemRendererInclude.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DefaultGridItemRenderer.as</path>

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

--- frameworks/projects/spark/src/spark/components/gridClasses/GridDimensions.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridDimensions.as
@@ -333,7 +333,7 @@
      *  If variableRowHeight is false, calling getRowHeight
      *  will return the value of defaultRowHeight.
      */
-    public var variableRowHeight:Boolean = true;
+    public var variableRowHeight:Boolean = false;  // default value must match Grid property default value

     //----------------------------------
     //  minRowHeight
@@ -1115,7 +1115,7 @@
         if (nRows > 1)
             contentHeight += (nRows - 1) * rowGap;

-        if (!variableRowHeight || !isNaN(defaultRowHeight))
+        if (!isNaN(defaultRowHeight))
             return contentHeight + nRows * defaultRowHeight;

         return 0;


We use StreamableHashMap sensible and only store one kind of key.
Let's guess the type based on the first key unserialized, and guess if it
was empty.

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

--- src/as/com/threerings/util/StreamableHashMap.as
+++ src/as/com/threerings/util/StreamableHashMap.as
@@ -25,13 +25,24 @@
 import com.threerings.io.ObjectOutputStream;
 import com.threerings.io.Streamable;

+import com.threerings.util.Log;
+import com.threerings.util.Maps;
+import com.threerings.util.maps.ForwardingMap;
+
 /**
  * A {@link HashMap} that can be sent over the wire, bearing in mind that all keys and values must
  * be primitives or implement {@link Streamable}.
  */
-public class StreamableHashMap extends HashMap
+public class StreamableHashMap extends ForwardingMap
     implements Streamable
 {
+    public function StreamableHashMap (keyClazz :Class = null)
+    {
+        if (keyClazz != null) {
+            super(Maps.newMapOf(keyClazz));
+        }
+    }
+
     // documentation inherited from interface Streamable
     public function writeObject (out :ObjectOutputStream) :void
     {
@@ -46,8 +57,20 @@
     public function readObject (ins :ObjectInputStream) :void
     {
         var ecount :int = ins.readInt();
-        for (var ii :int = 0; ii < ecount; ii++) {
-            put(ins.readObject(), ins.readObject());
+        if (ecount > 0) {
+            // guess the type of map based on the first key
+            var key :Object = ins.readObject();
+            _source = Maps.newMapOf(ClassUtil.getClass(key));
+            put(key, ins.readObject());
+            // now read the rest
+            for (var ii :int = 1; ii < ecount; ii++) {
+                put(ins.readObject(), ins.readObject());
+            }
+
+        } else {
+            // shit!
+            Log.getLog(this).warning("Empty StreamableHashMap read, guessing DictionaryMap.");
+            _source = Maps.newDictionaryMap();
         }
     }
 }


修复 Varint 大于 127 时组包错误的问题

修复 Varint 大于 127 时组包错误的问题

--- as3/com/netease/protobuf/VarintWriter.as
+++ as3/com/netease/protobuf/VarintWriter.as
@@ -8,21 +8,25 @@
 // as listed at <url: http://www.opensource.org/licenses/bsd-license.php >.

 package com.netease.protobuf {
-	import flash.utils.*
+	import flash.utils.*;
 	public final class VarintWriter extends ByteArray {
 		private var bitsLeft:uint = 0
 		public function end():void {
 			if (length == 1) {
 				this[0] &= 0x7F
 			} else {
-				for (var i:uint = length; i > 0; i--) {
-					const byte:uint = this[i - 1]
+				for (var i:uint = length; i > 0;) {
+					const l:uint = i - 1
+					const byte:uint = this[l]
 					if (byte != 0x80) {
-						this[i - 1] = 0x7F & byte
+						this[l] = byte & 0x7F
 						length = i
 						return
 					}
+					i = l
 				}
+				this[0] = 0
+				length = 1
 			}
 		}
 		public function write(number:uint, bits:uint):void {


Transferred from the Adobe Open Source Subversion Repository

Revision: 19680
Author:   rfrishbe@adobe.com
Date:     2011-01-10T22:59:13.303277Z

Log Message:
-----------
Fixing up textreflow in Mobile TextAreaSkin and IconItemRenderer after SVN 19635.

QE notes:
Doc notes:
Bugs:
Reviewer: Evtim
Tests run: checkintests, mustella mobile TextArea
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TextAreaSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/IconItemRenderer.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/IconItemRenderer.as
+++ frameworks/projects/mobilecomponents/src/spark/components/IconItemRenderer.as
@@ -77,8 +77,6 @@
  *  @productversion Flex 4.5
  */
 [Style(name="messageStyleName", type="String", inherit="no")]
-
-// FIXME (rfrishbe): add verticalGap

 /**
  *  The IconItemRenderer class is a performant item
@@ -213,6 +211,27 @@
             _imageCache.enableCaching = true;
             _imageCache.maxCacheEntries = 100;
         }
+
+        // set default messageDisplay width
+        switch (applicationDPI)
+        {
+            case DPIClassification.DPI_320:
+            {
+                oldUnscaledWidth = 640;
+                break;
+            }
+            case DPIClassification.DPI_240:
+            {
+                oldUnscaledWidth = 480;
+                break;
+            }
+            default:
+            {
+                // default PPI160
+                oldUnscaledWidth = 320;
+                break;
+            }
+        }
     }

     //--------------------------------------------------------------------------
@@ -277,6 +296,18 @@
      *  The source to set iconDisplay to, after waiting an appropriate delay period
      */
     private var iconSourceToLoad:Object;
+
+    /**
+     *  @private
+     *  The width of the component on the previous layout manager
+     *  pass.  This gets set in updateDisplayList() and used in measure() on
+     *  the next layout pass.  This is so our "guessed width" in measure()
+     *  will be as accurate as possible since messageDisplay is multiline and
+     *  the messageDisplay height is dependent on the width.
+     *
+     *  In the constructor, this is actually set based on the DPI.
+     */
+    private var oldUnscaledWidth:Number;

     //--------------------------------------------------------------------------
     //
@@ -1721,19 +1752,18 @@

         if (hasMessage)
         {
-            // FIXME: (aharui)
-            var estimatedWidth:Number = 480;
             // now we need to measure messageDisplay's height.  Unfortunately, this is tricky and
-            // is dependent on messageDisplay's width
-            // if we have an explicit width, use it to calculate messageDisplay's width.
-            // Otherwise, we'll keep it the same width as it was before
-            if (!isNaN(estimatedWidth))
-			{
-				messageWidth = estimatedWidth - paddingAndGapWidth - decoratorWidth - myIconWidth;
-                setElementSize(messageDisplay, messageWidth, getElementPreferredHeight(messageDisplay));
-			}
+            // is dependent on messageDisplay's width.
+            // Use the old unscaledWidth width as an estimte for the new one.
+            // If we are wrong, we'll find out in updateDisplayList()
+
+            // FIXME (rfrishbe) in justify layout, we can guess better than this our first time around...
+            var messageDisplayEstimatedWidth:Number = oldUnscaledWidth - paddingAndGapWidth - myIconWidth - decoratorWidth;
+
+            setElementSize(messageDisplay, messageDisplayEstimatedWidth, NaN);
+
             messageWidth = getElementPreferredWidth(messageDisplay);
-            messageHeight = getElementPreferredHeight(messageDisplay);
+            messageHeight = getElementPreferredHeight(messageDisplay);
         }

         myMeasuredWidth += Math.max(labelWidth, messageWidth);
@@ -1897,11 +1927,45 @@

         if (hasMessage)
         {
-            // handle message
+            // handle message...because the text is multi-line, measuring and layout
+            // can be somewhat tricky
             messageWidth = Math.max(labelComponentsViewWidth, 0);
-
-			messageHeight = getElementPreferredHeight(messageDisplay);
-            setElementSize(messageDisplay, messageWidth, messageHeight);
+
+            // We get called with unscaledWidth = 0 a few times...
+            // rather than deal with this case normally,
+            // we can just special-case it later to do something smarter
+            if (unscaledWidth == 0)
+            {
+                // if unscaledWidth is 0, we want to make sure messageDisplay is invisible.
+                // we could set messageDisplay's width to 0, but that would cause an extra
+                // layout pass because of the text reflow logic.  Because of that, we
+                // can just set its height to 0.
+                setElementSize(messageDisplay, NaN, 0);
+            }
+            else
+            {
+                // grab old textDisplay height before resizing it
+                var oldPreferredMessageHeight:Number = getElementPreferredHeight(messageDisplay);
+
+                // keep track of oldUnscaledWidth so we have a good guess as to the width
+                // of the messageDisplay on the next measure() pass
+                oldUnscaledWidth = unscaledWidth;
+
+                // set the width of messageDisplay to messageWidth.
+                // set the height to oldMessageHeight.  If the height's actually wrong,
+                // we'll invalidateSize() and go through this layout pass again anyways
+                setElementSize(messageDisplay, messageWidth, oldPreferredMessageHeight);
+
+                // grab new messageDisplay height after the messageDisplay has taken its final width
+                var newPreferredMessageHeight:Number = getElementPreferredHeight(messageDisplay);
+
+                // if the resize caused the messageDisplay's height to change (because of
+                // text reflow), then we need to remeasure ourselves with our new width
+                if (oldPreferredMessageHeight != newPreferredMessageHeight)
+                    invalidateSize();
+
+    			messageHeight = newPreferredMessageHeight;
+            }

             // since it's multi-line, no need to truncate
             //if (messageDisplay.isTruncated)


fixed compiler warning

fixed compiler warning

Change-Id: I07fcf5f4d9e0ed00759aa7da057ce6e4e9266b21

--- WeaveJS/src/weavejs/util/DateUtils.as
+++ WeaveJS/src/weavejs/util/DateUtils.as
@@ -43,7 +43,7 @@

 			for each (var date:String in dates)
 			{
-				for (var fmtIdx:int in validFormatsSparse)
+				for (var fmtIdx:String in validFormatsSparse)
 				{
 					fmt = validFormatsSparse[fmtIdx];
 					if (!fmt)


Updated Chart demo to use scaleType of AxisLayout

git-svn-id: 6aa7ccb0a2048310a30f08a72aaff4ca39d980ed@121 91848ab2-c4ae-4e4f-8e6a-6a52ea0dccc3

--- flare.demos/flare/demos/Chart.as
+++ flare.demos/flare/demos/Chart.as
@@ -14,7 +14,7 @@
 	import flare.vis.operator.encoder.SizeEncoder;
 	import flare.vis.operator.layout.AxisLayout;
 	import flare.vis.palette.ColorPalette;
-	import flare.vis.scale.Scales;
+	import flare.vis.scale.ScaleType;
 	import flare.vis.util.Filters;

 	import flash.events.Event;
@@ -48,9 +48,9 @@
 			});
 			vis.operators.add(new AxisLayout(field1, field2));
 			vis.operators.add(new ShapeEncoder(field1));
-			vis.operators.add(new SizeEncoder(field2, Data.NODES, Scales.QUANTILE, 5));
+			vis.operators.add(new SizeEncoder(field2, Data.NODES, ScaleType.QUANTILE, 5));
 			vis.operators.add(new ColorEncoder(field1,Data.NODES, "lineColor",
-			    ColorPalette.category(stats1.unique), Scales.ORDINAL));
+			    ColorPalette.category(stats1.unique), ScaleType.ORDINAL));
 			vis.xyAxes.xAxis.fixLabelOverlap = false; // keep overlapping labels
 			vis.update();

@@ -76,7 +76,7 @@
 				// change the x-axis scale and animate the result
 				var al:AxisLayout = vis.operators[0] as AxisLayout;
 				al.xScaleType =
-					al.xScaleType==Scales.LOG ? Scales.LINEAR : Scales.LOG;
+					al.xScaleType==ScaleType.LOG ? ScaleType.LINEAR : ScaleType.LOG;
 				vis.update(new Transitioner(2)).play();
 			});
 			bs.x = 10; bs.y = HEIGHT - 10 - bs.height;


Removed toHexString().
It's not needed, as the 'int' class has various formatting functions.
These functions can even be called on constants, if you trick the compiler
a little bit by wrapping them in parens:

    trace("hex: " + (4097).toString(16));

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

--- src/as/com/threerings/util/StringUtil.as
+++ src/as/com/threerings/util/StringUtil.as
@@ -171,18 +171,6 @@
     }

     /**
-     * Return a hex string representation of the specified value.
-     */
-    public static function toHexString (value :uint) :String
-    {
-        var str :String = "";
-        for (var x :int = 0; x < 8; x++) {
-            str = HEX[(value >> (x * 4)) & 0xF] + str;
-        }
-        return "0x" + str;
-    }
-
-    /**
      * Generates a string from the supplied bytes that is the hex encoded
      * representation of those byts. Returns the empty String for a
      * null or empty byte array.


Added toHexString().

Added toHexString().

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

--- src/as/com/threerings/util/StringUtil.as
+++ src/as/com/threerings/util/StringUtil.as
@@ -171,6 +171,18 @@
     }

     /**
+     * Return a hex string representation of the specified value.
+     */
+    public static function toHexString (value :uint) :String
+    {
+        var str :String = "";
+        for (var x :int = 0; x < 8; x++) {
+            str = HEX[(value >> (x * 4)) & 0xF] + str;
+        }
+        return "0x" + str;
+    }
+
+    /**
      * Generates a string from the supplied bytes that is the hex encoded
      * representation of those byts. Returns the empty String for a
      * null or empty byte array.


Adjust weighting to react to latest segment speed exclusively.

--- HLSPlugin/src/com/kaltura/hls/m2ts/M2TSNetLoader.as
+++ HLSPlugin/src/com/kaltura/hls/m2ts/M2TSNetLoader.as
@@ -20,6 +20,14 @@
 	import org.osmf.net.httpstreaming.HTTPStreamingNetLoader;
 	import org.osmf.net.httpstreaming.dvr.DVRInfo;
 	import org.osmf.traits.LoadState;
+
+	import org.osmf.net.NetStreamSwitchManagerBase
+	import org.osmf.net.metrics.BandwidthMetric;
+	import org.osmf.net.DynamicStreamingResource;
+	import org.osmf.net.httpstreaming.DefaultHTTPStreamingSwitchManager;
+
+	import org.osmf.net.metrics.MetricType;
+	import org.osmf.net.rules.BandwidthRule;

 	/**
 	 * Factory to identify and process MPEG2 TS via OSMF.
@@ -45,8 +53,41 @@
 			return httpNetStream;
 		}

+		override protected function createNetStreamSwitchManager(connection:NetConnection, netStream:NetStream, dsResource:DynamicStreamingResource):NetStreamSwitchManagerBase
+		{
+			var switcher:DefaultHTTPStreamingSwitchManager = super.createNetStreamSwitchManager(connection, netStream, dsResource) as DefaultHTTPStreamingSwitchManager;
+
+			// Since our segments are large, switch rapidly.
+
+			// First, try to bias the bandwidth metric itself.
+			var weights:Vector.<Number> = new Vector.<Number>;
+			weights.push(1.0);
+			weights.push(0.0);
+			weights.push(0.0);
+			var bw:BandwidthMetric = switcher.metricRepository.getMetric(MetricType.BANDWIDTH, weights) as BandwidthMetric;
+			trace("Tried to override BandwidthMetric to N=1, and N=" + bw.weights.length);
+
+			// Second, bias the bandwidthrule.
+			for(var i:int=0; i<switcher.normalRules.length; i++)
+			{
+				var bwr:BandwidthRule = switcher.normalRules[i] as BandwidthRule;
+				if(!bwr)
+					continue;
+
+				bwr.weights.length = 3;
+				bwr.weights[0] = 1.0;
+				bwr.weights[1] = 0.0;
+				bwr.weights[2] = 0.0;
+
+				trace("Adjusted BandwidthRule");
+			}
+
+			return switcher;
+		}
+
 		override protected function processFinishLoading(loadTrait:NetStreamLoadTrait):void
 		{
+			// Set up DVR state updating.
 			var resource:URLResource = loadTrait.resource as URLResource;

 			if (!dvrMetadataPresent(resource))


commented out assertion code

commented out assertion code

--- WeaveData/src/weave/primitives/BLGTree.as
+++ WeaveData/src/weave/primitives/BLGTree.as
@@ -168,9 +168,12 @@
 				if (newNode.index < currentNode.index) // newNode should go to the left of currentNode
 				{
 					if (newNode.index < leftTraversalNode.index) // will only happen once, when leftTraversalNode == currentNode
-					{
+					{
+						/*
+						// for debugging
 						if (leftTraversalNode != currentNode)
 							throw new Error("Unexpected error. leftTraversalNode != currentNode");
+						*/

 						if (leftTraversalNode.left != null)
 						{
@@ -201,9 +204,12 @@
 				else // newNode should go to the right of currentNode
 				{
 					if (newNode.index > rightTraversalNode.index) // will only happen once, when rightTraversalNode == currentNode
-					{
+					{
+						/*
+						// for debugging
 						if (rightTraversalNode != currentNode)
 							throw new Error("Unexpected error. rightTraversalNode != currentNode");
+						*/

 						if (rightTraversalNode.right != null)
 						{
@@ -267,7 +273,6 @@
 				var prevPrevGridTest:uint = 0;
 				var prevGridTest:uint = 0;
 				var gridTest:uint;
-				var sameOutsideGridID:Boolean = false; // true when the two previous consecutive points were in the same off-screen grid
 				var stackPos:int = 0;
 				var node:BLGNode;
 				var operation:int;


level loader: use retry mechanism in case of empty playlists

--- src/org/mangui/hls/loader/LevelLoader.as
+++ src/org/mangui/hls/loader/LevelLoader.as
@@ -175,19 +175,35 @@
         /** parse a playlist **/
         private function _parseLevelPlaylist(string : String, url : String, level : int, metrics : HLSLoadMetrics) : void {
             if (string != null && string.length != 0) {
-                // successful loading, reset retry counter
-                _retryTimeout = 1000;
-                _retryCount = 0;
                 CONFIG::LOGGING {
                     Log.debug("level " + level + " playlist:\n" + string);
                 }
                 var frags : Vector.<Fragment> = Manifest.getFragments(string, url, level);
-                // set fragment and update sequence number range
-                _levels[level].updateFragments(frags);
-                _levels[level].targetduration = Manifest.getTargetDuration(string);
-                _hls.dispatchEvent(new HLSEvent(HLSEvent.PLAYLIST_DURATION_UPDATED, _levels[level].duration));
-            }
-
+                if(frags.length) {
+                    // successful loading, reset retry counter
+                    _retryTimeout = 1000;
+                    _retryCount = 0;
+                    // set fragment and update sequence number range
+                    _levels[level].updateFragments(frags);
+                    _levels[level].targetduration = Manifest.getTargetDuration(string);
+                    _hls.dispatchEvent(new HLSEvent(HLSEvent.PLAYLIST_DURATION_UPDATED, _levels[level].duration));
+                } else {
+                    if(HLSSettings.manifestLoadMaxRetry == -1 || _retryCount < HLSSettings.manifestLoadMaxRetry) {
+                        CONFIG::LOGGING {
+                            Log.warn("empty level Playlist, retry in " + _retryTimeout + " ms");
+                        }
+                        _timeoutID = setTimeout(_loadActiveLevelPlaylist, _retryTimeout);
+                        /* exponential increase of retry timeout, capped to manifestLoadMaxRetryTimeout */
+                        _retryTimeout = Math.min(HLSSettings.manifestLoadMaxRetryTimeout, 2 * _retryTimeout);
+                        _retryCount++;
+                        return;
+                    } else {
+                        var hlsError : HLSError = new HLSError(HLSError.MANIFEST_LOADING_IO_ERROR, _url, "no fragments in playlist");
+                        _hls.dispatchEvent(new HLSEvent(HLSEvent.ERROR, hlsError));
+                        return;
+                    }
+                }
+            }
             // Check whether the stream is live or not finished yet
             if (Manifest.hasEndlist(string)) {
                 _type = HLSTypes.VOD;


Fixed issue with identical sound file names (resolves #12)

--- actionscript/src/com/digitalstrawberry/nativeExtensions/anesounds/ANESounds.as
+++ actionscript/src/com/digitalstrawberry/nativeExtensions/anesounds/ANESounds.as
@@ -131,10 +131,10 @@
 			// the Android documentation states that these assets should not be compressed.
 			if(file.nativePath == "")
 			{
-				var tmpArray:Array = file.url.split('/');
-				var filename:String = tmpArray.pop();
-
-				var newFilename:String = filename.replace('/', '_');
+				var newFilename:String = file.url;
+				newFilename = newFilename.replace(/\//g, "_");
+				newFilename = newFilename.replace(/:/g, "");
+
 				var newFile:File = File.applicationStorageDirectory.resolvePath(newFilename);

 				file.copyTo(newFile, true);


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

--- frameworks/projects/framework/src/mx/effects/effectClasses/SequenceInstance.as
+++ frameworks/projects/framework/src/mx/effects/effectClasses/SequenceInstance.as
@@ -0,0 +1,425 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.effects.effectClasses
+{
+
+import mx.core.UIComponent;
+import mx.core.mx_internal;
+import mx.effects.EffectInstance;
+import mx.effects.IEffectInstance;
+import mx.effects.Tween;
+
+use namespace mx_internal;
+
+/**
+ *  The SequenceInstance class implements the instance class
+ *  for the Sequence effect.
+ *  Flex creates an instance of this class when it plays a Sequence effect;
+ *  you do not create one yourself.
+ *
+ *  @see mx.effects.Sequence
+ */
+public class SequenceInstance extends CompositeEffectInstance
+{
+    include "../../core/Version.as";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Constructor.
+	 *
+	 *  @param target This argument is ignored for Sequence effects.
+	 *  It is included only for consistency with other types of effects.
+	 */
+	public function SequenceInstance(target:Object)
+	{
+		super(target);
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Variables
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	private var activeChildCount:Number;
+
+	/**
+	 *  @private
+	 *  Used internally to store the sum of all previously playing effects.
+	 */
+	private var currentInstanceDuration:Number = 0;
+
+	/**
+	 *  @private
+	 *  Used internally to track the set of effect instances
+	 *  that the Sequence is currently playing.
+	 */
+	private var currentSet:Array;
+
+	/**
+	 *  @private
+	 *  Used internally to track the index number of the current set
+	 *  of playing effect instances
+	 */
+	private var currentSetIndex:int = -1;
+
+	/**
+	 *  @private
+	 */
+	private var startTime:Number = 0;
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties
+	//
+	//--------------------------------------------------------------------------
+
+ 	//----------------------------------
+	//  durationWithoutRepeat
+	//----------------------------------
+
+	/**
+	 *  @private
+	 */
+	override mx_internal function get durationWithoutRepeat():Number
+	{
+		var _duration:Number = 0;
+
+		var n:int = childSets.length;
+		for (var i:int = 0; i < n; i++)
+		{
+			var instances:Array = childSets[i];
+			_duration += instances[0].actualDuration;
+		}
+
+		return _duration;
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Overridden methods
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	override public function play():void
+	{
+		// Create a new queue.
+		activeEffectQueue = [];
+
+		// Start at the beginning or the end
+		// depending if we are playing backwards.
+		currentSetIndex = playReversed ? childSets.length : -1;
+
+		var n:int;
+		var i:int;
+		var m:int;
+		var j:int;
+
+		// Each childSets contains an instance of an effect for each target.
+		// Flatten these instances into the effectQueue.
+		// Put a null object between each effect so that the sequence knows
+		// when to stop and wait for the previous instances to finish.
+		n = childSets.length;
+		for (i = 0; i < n; i++)
+		{
+			var instances:Array = childSets[i];
+			activeEffectQueue.push(instances);
+		}
+
+		// Dispatch an effectStart event from the target.
+		super.play();
+
+		startTime = Tween.intervalTime;
+
+		if (activeEffectQueue.length == 0)
+		{
+			 finishRepeat();
+			 return;
+		}
+
+		playNextChildSet();
+	}
+
+	/**
+	 *  @private
+	 */
+	override public function pause():void
+	{
+		super.pause();
+
+		if (currentSet && currentSet.length > 0)
+		{
+			var n:int = currentSet.length;
+			for (var i:int = 0; i < n; i++)
+			{
+				currentSet[i].pause();
+			}
+		}
+	}
+
+	/**
+	 *  @private
+	 */
+	override public function stop():void
+	{
+		if (activeEffectQueue && activeEffectQueue.length > 0)
+		{
+			var queueCopy:Array = activeEffectQueue.concat();
+			activeEffectQueue = null;
+
+			// Call stop on the currently playing set
+			var currentInstances:Array = queueCopy[currentSetIndex];
+			var currentCount:int = currentInstances.length;
+
+			for (var i:int = 0; i < currentCount; i++)
+				currentInstances[i].stop();
+
+			// For instances that have yet to run, we will delete them
+			// without dispatching events.
+			// (Another alternative would have been add them into
+			// currentInstances and currentSet, then just stop them
+			// along with the others. In this case, they would have
+			// dispatched effectEnd events).
+			var n:int = queueCopy.length;
+			for (var j:int = currentSetIndex + 1; j < n; j++)
+			{
+				var waitingInstances:Array = queueCopy[j];
+				var m:int = waitingInstances.length;
+
+				for (var k:int = 0; k < m; k++)
+				{
+					var instance:IEffectInstance = waitingInstances[k];
+					instance.effect.deleteInstance(instance);
+				}
+			}
+		}
+
+		super.stop();
+	}
+
+	/**
+	 *  @private
+	 */
+	override public function resume():void
+	{
+		super.resume();
+
+		if (currentSet && currentSet.length > 0)
+		{
+			var n:int = currentSet.length;
+			for (var i:int = 0; i < n; i++)
+			{
+				currentSet[i].resume();
+			}
+		}
+	}
+
+	/**
+	 *  @private
+	 */
+	override public function reverse():void
+	{
+		super.reverse();
+
+		if (currentSet && currentSet.length > 0)
+		{
+			// PlayNextChildSet handles the logic of playing previously completed effects
+			var n:int = currentSet.length;
+			for (var i:int = 0; i < n; i++)
+			{
+				currentSet[i].reverse();
+			}
+		}
+	}
+
+	/**
+	 *  Interrupts any effects that are currently playing, skips over
+	 *  any effects that haven't started playing, and jumps immediately
+	 *  to the end of the composite effect.
+	 */
+	override public function end():void
+	{
+		endEffectCalled = true;
+
+		// activeEffectQueue are all effects to play
+		// currentSetIndex is where we want to start
+		// if play() hasn't been called on us yet (b/c of startDelay),
+		// activeEffectQueue will have nothing in it.  In this case,
+		// we leave the component in it's current state, rather than
+		// call .playWithNoDuration() on all the effects that haven't
+		// been run (or even added to the activeEffectQueue yet)
+		if (activeEffectQueue && activeEffectQueue.length > 0)
+		{
+			var queueCopy:Array = activeEffectQueue.concat();
+			activeEffectQueue = null;
+
+			// Call end on the currently playing set
+			var currentInstances:Array = queueCopy[currentSetIndex];
+			var currentCount:int = currentInstances.length;
+
+			for (var i:int = 0; i < currentCount; i++)
+			{
+				currentInstances[i].end();
+			}
+
+			var n:int = queueCopy.length;
+			for (var j:int = currentSetIndex + 1; j < n; j++)
+			{
+				var waitingInstances:Array = queueCopy[j];
+				var m:int = waitingInstances.length;
+
+				for (var k:int = 0; k < m; k++)
+				{
+					EffectInstance(waitingInstances[k]).playWithNoDuration();
+				}
+			}
+		}
+
+		super.end();
+	}
+
+	/**
+	*  Each time a child effect of SequenceInstance finishes,
+	*  Flex calls the onEffectEnd() method.
+	*  For SequenceInstance, it plays the next effect.
+	*  This method implements the method of the superclass.
+	*
+	*  @param childEffect The child effect.
+	*/
+	override protected function onEffectEnd(childEffect:IEffectInstance):void
+	{
+		// Each child effect notifies us when it is finished.
+		// Remove the notifying child from childSets,
+		// so that the end() method doesn't call it.
+		// When the last child notifies us that it's finished,
+		// notify our listener that we're finished.
+		// Resume the background processing that was suspended earlier
+		if (Object(childEffect).suspendBackgroundProcessing)
+			UIComponent.resumeBackgroundProcessing();
+
+		// See endEffect, above.
+		if (endEffectCalled)
+			return;
+
+		for (var i:int = 0; i < currentSet.length; i++)
+		{
+			if (childEffect == currentSet[i])
+			{
+				currentSet.splice(i, 1);
+				break;
+			}
+		}
+
+		if (currentSet.length == 0)
+		{
+			if (false == playNextChildSet())
+				finishRepeat();
+		}
+	}
+	//--------------------------------------------------------------------------
+	//
+	//  Methods
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	private function playNextChildSet(offset:Number = 0):Boolean
+	{
+		if (!playReversed)
+		{
+			if (!activeEffectQueue ||
+				currentSetIndex++ >= activeEffectQueue.length - 1)
+			{
+				return false;
+			}
+		}
+		else
+		{
+			if (currentSetIndex-- <= 0)
+				return false;
+		}
+
+		var childEffect:EffectInstance;
+		var instances:Array = activeEffectQueue[currentSetIndex];
+
+		currentSet = [];
+
+		for (var i:int = 0; i < instances.length; i++)
+		{
+			childEffect = instances[i];
+
+			/*
+			if (childEffect is TweenEffectInstance)
+			{
+				var offset:Number =
+					Tween.intervalTime - startTime - currentInstanceDuration;
+				offset = isNaN(offset) ? 0 : offset;
+				TweenEffectInstance(childEffect).seek(offset);
+			}
+			*/
+
+			currentSet.push(childEffect);
+			childEffect.playReversed = playReversed;
+			// Block all layout, responses from web services, and other
+			// background processing until the effect finishes executing.
+			if (childEffect.suspendBackgroundProcessing)
+				UIComponent.suspendBackgroundProcessing();
+			childEffect.startEffect();
+		}
+
+		currentInstanceDuration += childEffect.actualDuration;
+
+		/*
+		while (activeEffectQueue[activeChildCount])
+		{
+			childEffect = activeEffectQueue[activeChildCount];
+			activeChildCount++;
+
+
+			if (childEffect is TweenEffectInstance)
+			{
+				var offset:Number =
+					Tween.intervalTime - startTime - currentInstanceDuration;
+				offset = isNaN(offset) ? 0 : offset;
+				TweenEffectInstance(childEffect).seek(offset);
+			}
+			childEffect.startEffect();
+			// Block all layout, responses from web services, and other
+			// background processing until the effect finishes executing.
+			if (childEffect.suspendBackgroundProcessing)
+				UIComponent.suspendBackgroundProcessing();
+
+			if (!activeEffectQueue)
+				break;
+		}
+
+		currentInstanceDuration += childEffect.duration;
+		*/
+
+		return true;
+	}
+}
+
+}