Fixed bug where time would be wasted doing nothing if async task (or debugging breakpoint) took longer than the alloted time for its task priority.

--- WeaveCore/src/weave/core/StageUtils.as
+++ WeaveCore/src/weave/core/StageUtils.as
@@ -363,7 +363,7 @@
 			var pStart:int = getTimer();
 			var pAlloc:int = int(_priorityAllocatedTimes[_activePriority]);
 			var pElapsed:int = int(_priorityElapsedTimes[_activePriority]);
-			var pStop:int = Math.min(allStop, pStart + pAlloc - pElapsed);
+			var pStop:int = Math.min(allStop, pStart + pAlloc - pElapsed); // account for overtime from previous frame
 			queue = _priorityCallLaterQueues[_activePriority] as Array;
 			countdown = queue.length;
 			while (true)
@@ -374,9 +374,9 @@
 				now = getTimer();
 				if (countdown == 0 || now > pStop)
 				{
-					// keep track of elapsed time for this priority
-					pElapsed += now - pStart;
-					_priorityElapsedTimes[_activePriority] = pElapsed;
+					// keep track of the actual elapsed time for this priority
+					// if we went overtime, let the overflow value carry over to the next frame (but not after that)
+					_priorityElapsedTimes[_activePriority] = Math.min(Math.max(0, now - pStart), pAlloc);

 					// if max computation time was reached for this frame or we have visited all priorities, stop now
 					if (now > allStop || _activePriority == lastPriority)
@@ -389,11 +389,6 @@
 					// stop if no more entries
 					if (remaining == 0)
 						break;
-
-					// reset elapsed counter for next time
-					// if we went overtime, let the overflow value carry over
-					pElapsed = Math.max(0, pElapsed - pAlloc);
-					_priorityElapsedTimes[_activePriority] = pElapsed;

 					// switch to next priority
 					_activePriority++;


cleaning up doc

cleaning up doc

--- WeaveData/src/weave/utils/ZoomUtils.as
+++ WeaveData/src/weave/utils/ZoomUtils.as
@@ -88,7 +88,6 @@
 		}

 		/**
-		 * conformDataBoundsToAspectRatio
 		 * Enforce an aspect ratio on xDataUnitsPerPixel to yDataUnitsPerPixel.
 		 * This will increase the size of the given dataBounds either vertically or horizontally if necessary.
 		 * @param dataBounds The Bounds2D object to enforce an aspectRatio on.


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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 6700
Author:   hmuller@adobe.com
Date:     2009-05-06T22:34:53.316698Z

Log Message:
-----------
Fixed TileLayout:updateVirtualLayout(), virtual elements that aren't needed
after the second layout pass are now hidden with visible=false instead of just
setting their bounds to 0x0.

QE Notes:
Doc Notes:
Bugs: sdk-20983
Reviewer: Evtim

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/TileLayout.as

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

--- frameworks/projects/spark/src/spark/layouts/TileLayout.as
+++ frameworks/projects/spark/src/spark/layouts/TileLayout.as
@@ -14,6 +14,7 @@
 import flash.geom.Rectangle;

 import mx.core.ILayoutElement;
+import mx.core.IVisualElement;
 import mx.events.PropertyChangeEvent;
 import spark.components.supportClasses.GroupBase;
 import spark.core.NavigationUnit;
@@ -1208,9 +1209,10 @@

         // We're responsible for the laying *all* of the elements requested
         // with getVirtualElementAt(), even if they don't fall within the final
-        // visible range.  Hide any extra ones.
+        // visible range.  Hide any extra ones.  On the next layout pass, they'll
+        // be added to DataGroup::freeRenderers

-        var layoutTarget:GroupBase = target;
+        var layoutTarget:GroupBase = target;
         for(var i:int = oldVisibleStartIndex; i <= oldVisibleEndIndex; i++)
         {
             if (i == visibleStartIndex)
@@ -1222,6 +1224,8 @@
             if (!el)
                 continue;
             el.setLayoutBoundsSize(0, 0);
+            if (el is IVisualElement)
+                IVisualElement(el).visible = false;
         }
      }


added backwards compatibility code to fill in missing title metadata in
WeaveDataSource hierarchies.

Change-Id: Iaf088d25f60e3db873f219a9e940f1f1706f5f3d

--- WeaveClient/src/weave/VisApplication.as
+++ WeaveClient/src/weave/VisApplication.as
@@ -88,15 +88,16 @@
 	import weave.compiler.StandardLib;
 	import weave.core.DynamicState;
 	import weave.core.ErrorManager;
+	import weave.core.ExternalSessionStateInterface;
 	import weave.core.LinkableBoolean;
 	import weave.core.SessionManager;
 	import weave.core.SessionStateLog;
 	import weave.core.StageUtils;
-	import weave.core.ExternalSessionStateInterface;
 	import weave.core.weave_internal;
 	import weave.data.AttributeColumns.ColorColumn;
 	import weave.data.AttributeColumns.FilteredColumn;
 	import weave.data.AttributeColumns.KeyColumn;
+	import weave.data.DataSources.WeaveDataSource;
 	import weave.data.KeySets.KeyFilter;
 	import weave.data.KeySets.KeySet;
 	import weave.primitives.AttributeHierarchy;
@@ -903,7 +904,19 @@
 			// An empty subset is not of much use.  If the subset is empty, reset it to include all records.
 			var subset:KeyFilter = Weave.root.getObject(Weave.DEFAULT_SUBSET_KEYFILTER) as KeyFilter;
 			if (subset.includeMissingKeys.value == false && subset.included.keys.length == 0 && subset.excluded.keys.length == 0)
-				subset.includeMissingKeys.value = true;
+				subset.includeMissingKeys.value = true;
+
+			// fill in missing title metadata in WeaveDataSource hierarchies
+			var wdsArray:Array = Weave.root.getObjects(WeaveDataSource);
+			for each (var wds:WeaveDataSource in wdsArray)
+			{
+				var root:XML = getSessionState(wds.attributeHierarchy) as XML;
+				if (!root)
+					continue;
+				for each (var tag:XML in root.descendants('attribute'))
+					if (!tag.@title && tag.@name)
+						tag.@title = tag.@name;
+			}
 		}

 		private function handleWeaveListChange():void


Added context parameter to generateDelayedCallback.

--- WeaveData/src/weave/utils/EventUtils.as
+++ WeaveData/src/weave/utils/EventUtils.as
@@ -26,6 +26,8 @@

 	import mx.binding.utils.BindingUtils;
 	import mx.binding.utils.ChangeWatcher;
+
+	import weave.api.objectWasDisposed;

 	/**
 	 * Static functions related to event callbacks.
@@ -71,17 +73,18 @@

 		public static function addDelayedCallback(eventDispatcher:Object, event:String, callback:Function, delay:int = 500):void
 		{
-			eventDispatcher.addEventListener(event, generateDelayedCallback(callback, [], delay));
+			eventDispatcher.addEventListener(event, generateDelayedCallback(eventDispatcher, callback, [], delay));
 		}

 		/**
 		 * This function generates a delayed version of a callback.
+		 * @param relevantContext If this is not null, then the callback will be removed when the relevantContext object is disposed via SessionManager.dispose().  This parameter is typically a 'this' pointer.
 		 * @param callback The callback function
 		 * @param callbackParams If this is specified, parameters passed to the generated wrapper function will be ignored and these parameters will be used instead when calling the callback.
 		 * @param delay The number of milliseconds to delay before running the callback.
 		 * @return A wrapper around the callback that remembers the parameters and delays calling the original callback.
 		 */
-		public static function generateDelayedCallback(callback:Function, callbackParams:Array = null, delay:int = 500):Function
+		public static function generateDelayedCallback(relevantContext:Object, callback:Function, callbackParams:Array = null, delay:int = 500):Function
 		{
 			var _timer:Timer = new Timer(delay, 1);
 			var _delayedThisArg:Object;
@@ -99,7 +102,8 @@
 			var callback_apply:Function = function(..._):void
 			{
 				// call the original callback with the params passed to delayedCallback
-				callback.apply(_delayedThisArg, callbackParams || _delayedParams);
+				if (!objectWasDisposed(relevantContext))
+					callback.apply(_delayedThisArg, callbackParams || _delayedParams);
 			};
 			_timer.addEventListener(TimerEvent.TIMER_COMPLETE, callback_apply);


if only one call, don't post multirequest - post the call.

git-svn-id: 8a2ccb88241e16c78017770bc38d91d6d5396a5a@58546 6b8eccd3-e8c5-4e7d-8186-e12b5326b719

--- generator/sources/as3/KalturaClient.as
+++ generator/sources/as3/KalturaClient.as
@@ -3,9 +3,19 @@
 	import com.kaltura.config.KalturaConfig;
 	import com.kaltura.net.KalturaCall;

+	import flash.events.Event;
 	import flash.events.EventDispatcher;

 	public class KalturaClient extends EventDispatcher {
+
+		[Event(name="callQueued", type="Event")]
+
+		[Event(name="queueFlushed", type="Event")]
+
+		public static const CALL_QUEUED:String = "callQueued";
+		public static const QUEUE_FLUSHED:String = "queueFlushed";
+
+
 		protected var _currentConfig:KalturaConfig;

 		/**
@@ -107,6 +117,7 @@
 				_queue = new QueuedRequest();
 			}
 			_queue.addAction(call);
+			dispatchEvent(new Event(KalturaClient.CALL_QUEUED));
 		}

@@ -115,8 +126,15 @@
 		 */
 		public function flush():void {
 			if (_queue) {
-				post(_queue);
+				if (_queue.calls.length > 1) {
+					post(_queue);
+				} else {
+					// if there is only one call, don't post it as a multirequest.
+					// this makes fiddler easier to use.
+					_queue.calls[0].execute();
+				}
 				_queue = null;
+				dispatchEvent(new Event(KalturaClient.QUEUE_FLUSHED));
 			}
 		}


fixed probe text jumping bug when weave desktop was too small.

--- WeaveUI/src/weave/utils/ProbeTextUtils.as
+++ WeaveUI/src/weave/utils/ProbeTextUtils.as
@@ -226,24 +226,28 @@
 				// calculate x coordinate
 				var x:int;
 				if (cornerToolTip)
-				{
-					// want toolTip corner to be near probe point
-					if (toolTipToTheLeft)
+				{
+					// check twice to prevent flipping back and forth when weave desktop size is very small
+					for (var checkTwice:int = 0; checkTwice < 2; checkTwice++)
 					{
-						x = stageX - margin - probeToolTip.width;
-						if(xAxisToolTip != null)
-							x = xAxisToolTip.x - margin - probeToolTip.width;
+						// want toolTip corner to be near probe point
+						if (toolTipToTheLeft)
+						{
+							x = stageX - margin - probeToolTip.width;
+							if(xAxisToolTip != null)
+								x = xAxisToolTip.x - margin - probeToolTip.width;
+						}
+						else // to the right
+						{
+							x = stageX + margin;
+							if(xAxisToolTip != null)
+								x = xAxisToolTip.x+xAxisToolTip.width+margin;
+						}
+
+						// flip x position if out of bounds
+						if ((x < xMin && toolTipToTheLeft) || (x > xMax && !toolTipToTheLeft))
+							toolTipToTheLeft = !toolTipToTheLeft;
 					}
-					else // to the right
-					{
-						x = stageX + margin;
-						if(xAxisToolTip != null)
-							x = xAxisToolTip.x+xAxisToolTip.width+margin;
-					}
-
-					// flip x position if out of bounds
-					if ((x < xMin && toolTipToTheLeft) || (x > xMax && !toolTipToTheLeft))
-						toolTipToTheLeft = !toolTipToTheLeft;
 				}
 				else // center x coordinate
 				{


Added support for var in for-in/for-each loop params.

--- WeaveCore/src/weave/compiler/Compiler.as
+++ WeaveCore/src/weave/compiler/Compiler.as
@@ -1617,6 +1617,18 @@
 						if (!call.compiledParams || call.evaluatedMethod == operators['='])
 							tokens[startIndex + iPattern] = token = call = compileOperator(',', [call]);

+						// special case for "for (var x in y) { }"
+						if (call.evaluatedMethod == operators['in'] && call.compiledParams.length == 2)
+						{
+							// check the variable
+							call = call.compiledParams[0] as CompiledFunctionCall;
+							if (!call || call.compiledParams) // not a variable?
+								throwInvalidSyntax(stmt);
+							// save single variable name
+							varNames = [call.evaluatedMethod];
+							continue;
+						}
+
 						if (call.evaluatedMethod != operators[','] || call.compiledParams.length == 0)
 							throwInvalidSyntax(stmt);

@@ -1640,6 +1652,7 @@
 							else
 								throwInvalidSyntax(stmt);
 						}
+						call.evaluateConstants();
 					}
 				}

@@ -1651,7 +1664,13 @@
 				{
 					token = compileOperator(ST_VAR, [new CompiledConstant(null, varNames)]);
 					call = params[0];
-					if (call.compiledParams.length > 0)
+					if (call.evaluatedMethod == operators['in'])
+					{
+						call.compiledParams[0] = compileOperator(',', [token, call.compiledParams[0]]);
+						call.evaluateConstants();
+						token = call;
+					}
+					else if (call.compiledParams.length > 0)
 					{
 						call.compiledParams.unshift(token);
 						call.evaluateConstants();
@@ -1735,9 +1754,18 @@

 						// implemented as "for (each|in)(\in(list), item=undefined, stmt)
 						var _in:CompiledFunctionCall = forParams.compiledParams[0];
-						var _item:ICompiledObject = compileVariableAssignment(_in.compiledParams[0], '=', newUndefinedConstant());
+						var _item:ICompiledObject;
+						var _var:CompiledFunctionCall = _in.compiledParams[0] as CompiledFunctionCall;
+						if (_var.evaluatedMethod == operators[','] && _var.compiledParams.length == 2) // represented as (var x, x)
+						{
+							_var.compiledParams[1] = compileVariableAssignment(_var.compiledParams[1], '=', newUndefinedConstant());
+						}
+						else
+						{
+							_var = compileVariableAssignment(_in.compiledParams[0], '=', newUndefinedConstant());
+						}
 						var _list:ICompiledObject = compileOperator('in', [_in.compiledParams[1]]);
-						tokens[startIndex] = compileOperator(stmt, [_list, _item, params[1]]);
+						tokens[startIndex] = compileOperator(stmt, [_list, _var, params[1]]);
 					}
 				}
 				else if (_jumpStatements.indexOf(stmt) >= 0)
@@ -1785,11 +1813,21 @@
 					{
 						// if 'for' or 'for each' has only one param, it must be the 'in' operator
 						var call:CompiledFunctionCall = params.compiledParams[0] as CompiledFunctionCall; // the first statement param
-						if (!call || call.evaluatedMethod != operators['in'])
+						if (!call || call.evaluatedMethod != operators['in'] || call.compiledParams.length != 2)
 							throwInvalidSyntax(statement);
+
+						// check the first parameter of the 'in' operator
+						call = call.compiledParams[0] as CompiledFunctionCall;
+
+						if (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
+						}

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


311 StringConstants: Correct regex for all-caps identifiers

--- raw/src/org/yellcorp/tools/StringConstants.as
+++ raw/src/org/yellcorp/tools/StringConstants.as
@@ -6,7 +6,7 @@

 public class StringConstants
 {
-    private static const constForm:RegExp = /^[A-Z0-9_]+$/;
+    private static const constForm:RegExp = /^[A-Z_$][A-Z0-9_$]*$/;

     private static const tokenizer:RegExp =
         /([A-Z]+)|([a-z]+)|([0-9]+)/g;


CSVDataSource now generates titles from 'name' or 'csvColumn' if not
specified in the hierarchy.

Change-Id: I642983e5e9c1d3f3f7399bbb755bbd4f2b29edd5

--- WeaveData/src/weave/data/DataSources/CSVDataSource.as
+++ WeaveData/src/weave/data/DataSources/CSVDataSource.as
@@ -29,6 +29,7 @@

 	import weave.api.WeaveAPI;
 	import weave.api.core.ICallbackCollection;
+	import weave.api.data.AttributeColumnMetadata;
 	import weave.api.data.DataTypes;
 	import weave.api.data.IAttributeColumn;
 	import weave.api.data.IColumnReference;
@@ -132,6 +133,19 @@
 		{
 			super.handleHierarchyChange();
 			convertOldHierarchyFormat(_attributeHierarchy.value, "attribute", {name: "csvColumn"});
+			if (_attributeHierarchy.value)
+			{
+				for each (var tag:XML in _attributeHierarchy.value.descendants('attribute'))
+				{
+					if (!String(tag.@title))
+					{
+						var newTitle:String = String(tag.@name) || String(tag.@csvColumn);
+						if (String(tag.@year))
+							newTitle += ' (' + tag.@year + ')';
+						tag.@title = newTitle;
+					}
+				}
+			}
 			_attributeHierarchy.detectChanges();
 		}

@@ -197,6 +211,8 @@
 			// backwards compatibility
 			if (colName == '')
 				colName = proxyColumn.getMetadata("name");
+			if (proxyColumn.getMetadata(AttributeColumnMetadata.TITLE))
+

 			var colIndex:int = (csvDataArray[0] as Array).indexOf(colName);
 			var keyColIndex:int = (csvDataArray[0] as Array).indexOf(keyColName.value); // it is ok if this is -1 because getColumnValues supports -1


minor coding style fix

minor coding style fix

--- src/aerys/minko/type/data/DataBindings.as
+++ src/aerys/minko/type/data/DataBindings.as
@@ -16,7 +16,7 @@
 		private var _properties			: Vector.<String>	= new <String>[];
 		private var _propertyToProvider	: Object			= {};

-		private var _propertyChanged	: Object			= new Object();
+		private var _propertyChanged	: Object			= {};

 		public function get numProperties() : uint
 		{


Fixed failing async test

Fixed failing async test

--- as3/test/asunit4/runners/TestRunnerAsyncMethodTest.as
+++ as3/test/asunit4/runners/TestRunnerAsyncMethodTest.as
@@ -64,7 +64,7 @@
         }

         private function check_runner_result_wasSuccessful2(e:Event):void {
-            assertTrue('runner result was successful222', runnerResult.wasSuccessful);
+            assertTrue('runner result was successful 2', runnerResult.wasSuccessful);
         }

         public function test_run_with_too_slow_async_operation_triggers_result_with_IllegalOperationError():void {
@@ -119,7 +119,7 @@

     import asunit.asserts.*;

-    [Inject]
+    [Async]
     public var async:IAsync;

     private var handlerWasCalled:Boolean = false;


StreamBuffer: allow negative but small values, that could happen because of frag drift related to https://github.com/mangui/flashls/issues/401

--- src/org/mangui/hls/stream/StreamBuffer.as
+++ src/org/mangui/hls/stream/StreamBuffer.as
@@ -195,7 +195,8 @@
                             if(continuity == _fragMainInitialContinuity) {
                                 sliding = _liveSlidingMain = _fragMainInitialStartPosition + (min_pts-_fragMainInitialPTS)/1000 - startPosition;
                                 CONFIG::LOGGING {
-                                    if(sliding < 0) {
+                                    // allow negative but small values, that could happen because of frag drift
+                                    if(sliding < -1) {
                                         Log.warn('negative sliding : sliding/min_pts/_fragMainInitialPTS/startPosition/_fragMainInitialStartPosition:' + sliding + '/' + min_pts + '/' + _fragMainInitialPTS + '/' + startPosition.toFixed(3) + '/' + _fragMainInitialStartPosition);
                                     }
                                 }


Fixed sunspider benchmark.

Fixed sunspider benchmark.

--- src/avm2/tests/sunspider/crypto-md5.as
+++ src/avm2/tests/sunspider/crypto-md5.as
@@ -310,8 +310,6 @@
     plainText += plainText;
 }

-plainText = "ABCDEF";
-
 var md5Output = hex_md5(plainText);
 var totaltime=new Date()-start;
 if (md5Output=="a831e91e0f70eddcb70dc61c6f82f6cd")


Using IStyleClient to check the target for a possibly setStyle() call

--- src/flexlib/css/CSSPropertyInjector.as
+++ src/flexlib/css/CSSPropertyInjector.as
@@ -23,8 +23,8 @@

 package flexlib.css
 {
-import mx.core.UIComponent;
 import mx.styles.CSSStyleDeclaration;
+import mx.styles.IStyleClient;
 import mx.styles.StyleManager;
 import mx.utils.ObjectUtil;

@@ -113,16 +113,16 @@
     }
     public function set styleNames( val : Object ) : void
     {
-    	if ( val == null || ( !( val is Array ) && !( val is String ) ) ) return;
-
-    	if ( val is Array )
-    	{
-        	__styleNames = val as Array;
-     	}
-     	else if ( val is String )
-     	{
-     		__styleNames = ( val as String ).split( "," );
-     	}
+        if ( val == null || ( !( val is Array ) && !( val is String ) ) ) return;
+
+        if ( val is Array )
+        {
+            __styleNames = val as Array;
+         }
+         else if ( val is String )
+         {
+             __styleNames = ( val as String ).split( "," );
+         }

         __styleNamesChanged = true;
         invalidateProperties();
@@ -177,19 +177,19 @@
      */
     protected function getCSSStyleDeclarations() : void
     {
-    	__cssStyleDeclarations = [];
-    	if ( styleName != null )
-    	{
-    		__cssStyleDeclarations.push( getCSSStyleDeclaration( styleName ) );
-    	}
-
-    	if ( styleNames != null )
-    	{
-    		for each ( var name : String in styleNames )
-    		{
-    			__cssStyleDeclarations.push( getCSSStyleDeclaration( name ) );
-    		}
-    	}
+        __cssStyleDeclarations = [];
+        if ( styleName != null )
+        {
+            __cssStyleDeclarations.push( getCSSStyleDeclaration( styleName ) );
+        }
+
+        if ( styleNames != null )
+        {
+            for each ( var name : String in styleNames )
+            {
+                __cssStyleDeclarations.push( getCSSStyleDeclaration( name ) );
+            }
+        }
     }

     /**
@@ -199,7 +199,7 @@
      */
     protected function getCSSStyleDeclaration( styleName : String ) : CSSStyleDeclaration
     {
-    	var cssStyleDeclaration : CSSStyleDeclaration = null;
+        var cssStyleDeclaration : CSSStyleDeclaration = null;
         cssStyleDeclaration = StyleManager.getStyleDeclaration( styleName );

         if ( cssStyleDeclaration == null )
@@ -218,29 +218,29 @@
     protected function applyStyles() : void
     {
         var styles : Array = [];
-		var styleObj : Object = null;
-
-		for each ( var cssStyleDeclaration : CSSStyleDeclaration in __cssStyleDeclarations )
-		{
-			styleObj = {};
-
-			if ( cssStyleDeclaration.factory != null )
-			{
-				cssStyleDeclaration.factory.apply( styleObj );
-			}
-			if ( cssStyleDeclaration.defaultFactory != null )
-			{
-				cssStyleDeclaration.defaultFactory.apply( styleObj );
-			}
-
-			var temp : Array = ObjectUtil.getClassInfo( styleObj ).properties as Array;
-			for ( var propName : String in styleObj )
-			{
-				styles.push( propName );
-			}
-
-			trace( styles, "\n" );
-		}
+        var styleObj : Object = null;
+
+        for each ( var cssStyleDeclaration : CSSStyleDeclaration in __cssStyleDeclarations )
+        {
+            styleObj = {};
+
+            if ( cssStyleDeclaration.factory != null )
+            {
+                cssStyleDeclaration.factory.apply( styleObj );
+            }
+            if ( cssStyleDeclaration.defaultFactory != null )
+            {
+                cssStyleDeclaration.defaultFactory.apply( styleObj );
+            }
+
+            var temp : Array = ObjectUtil.getClassInfo( styleObj ).properties as Array;
+            for ( var propName : String in styleObj )
+            {
+                styles.push( propName );
+            }
+
+            trace( styles, "\n" );
+        }

         if ( target != null )
         {
@@ -263,13 +263,13 @@
      */
     protected function assignStylesToTarget( styles : Array, target : Object ) : void
     {
-    	var cssStyleDeclaration : CSSStyleDeclaration = null;
-    	var val : * = undefined;
-
+        var cssStyleDeclaration : CSSStyleDeclaration = null;
+        var val : * = undefined;
+
         for each ( var style : String in styles )
         {
-        	for each ( cssStyleDeclaration in __cssStyleDeclarations )
-        	{
+            for each ( cssStyleDeclaration in __cssStyleDeclarations )
+            {
                 //  Look for a value for [style] in the CSSStyeDeclaration
                 if ( cssStyleDeclaration.getStyle( style ) != null )
                 {
@@ -283,16 +283,16 @@
                 }

                 //  If there is a property, assign the value
-        		if ( target.hasOwnProperty( style ) )
-        		{
-        			target[ style ] = val;
-        		}
-        		//  If there is no property and target is a UIComponent
-        		//  set the value as a style.
-        		else if ( target is UIComponent )
-        		{
-        			target.setStyle( style, val );
-        		}
+                if ( target.hasOwnProperty( style ) )
+                {
+                    target[ style ] = val;
+                }
+                //  If there is no property and target is a UIComponent
+                //  set the value as a style.
+                else if ( target is IStyleClient )
+                {
+                   ( target as IStyleClient ).setStyle( style, val );
+                }
             }
         }
     }


Removed a useless debugging trace.

Removed a useless debugging trace.

--- src/org/jivesoftware/xiff/im/Roster.as
+++ src/org/jivesoftware/xiff/im/Roster.as
@@ -309,7 +309,6 @@

 					ext.addItem( id, rosterItem.subscribeType, newName, newGroups );
 					tempIQ.addExtension( ext );
-					trace("updateContact: ", tempIQ);
 					myConnection.send( tempIQ );
 					break;
 				}


fix divide at ShaderPart

fix divide at ShaderPart

--- src/aerys/minko/render/shader/part/ShaderPart.as
+++ src/aerys/minko/render/shader/part/ShaderPart.as
@@ -489,7 +489,7 @@
             var result : SFloat = new SFloat(new Instruction(Instruction.DIV, getNode(value1), getNode(value2)));

             for each (var arg : Object in args)
-                result = multiply(result, arg);
+                result = divide(result, arg);

 			return result;
 		}


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

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

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

--- frameworks/projects/framework/src/mx/core/Version.as
+++ frameworks/projects/framework/src/mx/core/Version.as
@@ -15,4 +15,4 @@
  *  @private
  *  Version string for this class.
  */
-mx_internal static const VERSION:String = "3.0.0.0";
+mx_internal static const VERSION:String = "4.0.0.0";


Added a getter/setter for alwaysPreventDefault()

--- src/com/zehfernando/input/binding/KeyActionBinder.as
+++ src/com/zehfernando/input/binding/KeyActionBinder.as
@@ -34,7 +34,7 @@

 		// Properties
 		private var _isRunning:Boolean;
-		private var alwaysPreventDefault:Boolean;						// If true, prevent action by other keys all the time (e.g. menu key)
+		private var _alwaysPreventDefault:Boolean;						// If true, prevent action by other keys all the time (e.g. menu key)

 		// Instances
 		private var bindings:Vector.<BindingInfo>;						// Actual existing bindings, their action, and whether they're activated or not
@@ -183,7 +183,7 @@
 		// CONSTRUCTOR ----------------------------------------------------------------------------------------------------

 		public function KeyActionBinder() {
-			alwaysPreventDefault = true;
+			_alwaysPreventDefault = true;
 			bindings = new Vector.<BindingInfo>();
 			actionsActivations = {};

@@ -393,7 +393,7 @@
 				}
 			}

-			if (alwaysPreventDefault) __e.preventDefault();
+			if (_alwaysPreventDefault) __e.preventDefault();

 			// Check all current game input devices for a key injection definition that matches
 			for (i = 0; i < gameInputDeviceDefinitions.length; i++) {
@@ -422,7 +422,7 @@
 				if ((actionsActivations[filteredKeys[i].action] as ActivationInfo).getNumActivations() == 0) _onActionDeactivated.dispatch(filteredKeys[i].action);
 			}

-			if (alwaysPreventDefault) __e.preventDefault();
+			if (_alwaysPreventDefault) __e.preventDefault();

 			// Check all current game input devices for a key injection definition that matches
 			for (i = 0; i < gameInputDeviceDefinitions.length; i++) {
@@ -744,6 +744,15 @@
 			return _isRunning;
 		}

+		public function get alwaysPreventDefault():Boolean {
+			return _alwaysPreventDefault;
+		}
+
+		public function set alwaysPreventDefault(__value:Boolean):void {
+			// TODO: this is a dumb getter/setter just for ASDocs reasons
+			_alwaysPreventDefault = __value;
+		}
+
 		public function getNumDevices():uint {
 			return gameInputDevices.length;
 		}


Transferred from the Adobe Open Source Subversion Repository

Revision: 5099
Author:   gauravj@adobe.com
Date:     2009-02-27T03:43:02.639229Z

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:
--------------
147 paths were modified

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

--- frameworks/projects/rpc/src/mx/rpc/Fault.as
+++ frameworks/projects/rpc/src/mx/rpc/Fault.as
@@ -15,6 +15,11 @@
 /**
  * The Fault class represents a fault in a remote procedure call (RPC) service
  * invocation.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class Fault extends Error
 {
@@ -25,6 +30,11 @@
      * @param faultString Text description of the fault.
      * @param faultDetail Additional details describing the fault.
      *
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function Fault(faultCode:String, faultString:String, faultDetail:String = null)
     {
@@ -45,12 +55,22 @@
     /**
      * The raw content of the fault (if available), such as an HTTP response
      * body.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public var content:Object;

     /**
      * The cause of the fault. The value will be null if the cause is
      * unknown or whether this fault represents the root itself.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public var rootCause:Object;

@@ -62,6 +82,11 @@

     /**
      * A simple code describing the fault.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get faultCode():String
     {
@@ -70,6 +95,11 @@

     /**
      * Any extra details of the fault.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get faultDetail():String
     {
@@ -78,6 +108,11 @@

     /**
      * Text description of the fault.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get faultString():String
     {
@@ -94,6 +129,11 @@
      * Returns the string representation of a Fault object.
      *
      * @return Returns the string representation of a Fault object.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function toString():String
     {


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

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

 package mx.states
 {


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

--- frameworks/projects/mx/src/mx/effects/SetPropertyAction.as
+++ frameworks/projects/mx/src/mx/effects/SetPropertyAction.as
@@ -46,6 +46,11 @@
  *  @see mx.states.SetProperty
  *
  *  @includeExample ../states/examples/TransitionExample.mxml
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class SetPropertyAction extends Effect
 {
@@ -61,6 +66,11 @@
 	 *  Constructor.
 	 *
 	 *  @param target The Object to animate with this effect.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public function SetPropertyAction(target:Object = null)
 	{
@@ -86,6 +96,11 @@
 	 *  By default, Flex determines this value from the
 	 *  SetProperty property definition
 	 *  in the view state definition.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public var name:String;

@@ -100,6 +115,11 @@
 	 *  By default, Flex determines this value from the
 	 *  SetProperty property definition
 	 *  in the view state definition.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public var value:*;


Transferred from the Adobe Open Source Subversion Repository

Revision: 21221
Author:   jasonsj@adobe.com
Date:     2011-05-06T23:20:48.715283Z

Log Message:
-----------
ASDoc typo heightInChars changed to heightInLines

QE notes:
Doc notes:
Bugs: SDK-30343
Reviewer: none
Tests run: checkintests
Is noteworthy for integration

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

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

--- frameworks/projects/spark/src/spark/components/TextArea.as
+++ frameworks/projects/spark/src/spark/components/TextArea.as
@@ -161,7 +161,7 @@
  *  In those cases, a horizontal scrollbar automatically appears
  *  if any lines of text are wider than the control.

  *
- *
The widthInChars and heightInChars
+ *
The widthInChars and heightInLines
  *  properties let you specify the width and height of the TextArea
  *  in a way that scales with the font size.
  *  You can use the typicalText property as well.


ManagedObjectId deserialization fix.

ManagedObjectId deserialization fix.

--- src/Modi/ManagedArray.as
+++ src/Modi/ManagedArray.as
@@ -639,10 +639,18 @@
 			{
 				var ManagedClass:Class = Class(getDefinitionByName(_childType) as Class);
 				var object:ManagedObject = new ManagedClass();
-				deserializator.pushObject(i.toString())
-				object.deserialize(deserializator);
-				deserializator.popObject();
-
+
+                if (object is ManagedObjectId)
+                {
+                    object = new ManagedObjectId(deserializator.readString(i.toString()));
+                }
+                else
+                {
+                    deserializator.pushObject(i.toString())
+                    object.deserialize(deserializator);
+                    deserializator.popObject();
+                }
+
 				this.push(object);
 			}


CHANGED:update the dialog text;

CHANGED:update the dialog text;

--- src/PlayState.as
+++ src/PlayState.as
@@ -160,46 +160,46 @@
 			foreground.add(this.charactor);
 			// NPC character
 			this.charactor_NPC = new FlxCharacter(10, 5, EmbedAssets.CHARACTER_NPC, this.map_world);
-			this.charactor_NPC.dialog = ["Richard: Hey how are you today!",
-				"You: I'm ok, thank you.",
-				"Richard: I need to write a letter but I don't have anything to write with. Do you have a pencil?",
+			this.charactor_NPC.dialog = ["小罗: 今天过得怎么样!",
+				"亮仔: 还好, 谢谢咯！",
+				"小罗: 我想诗情画意一下，可没有道具. 你有2B铅笔吗?",
 				"::changeCharLine@19",
 				"::checkItem@Pencil,6",
-				"You: Nope.",
+				"亮仔: 冒得.",
 				"::endDialog",
-				"You: Yes, here you go.",
+				"亮仔: 来, 给你一支.",
 				"::remInv@Pencil",
-				"*You give the Pencil to Richard*",
-				"Richard: Thanks a lot! Can you take this letter to Mimi, she lives in the house down the road?",
+				"*亮仔 递给一铅笔给 小罗*",
+				"小罗: 太感谢你了! 你能把这封情书给付婆吗, 她就住在马路的前方?",
 				"::addInv@Letter",
-				"*Richard gives you a Letter*",
-				"You: I'll see what I can do.",
+				"*小罗 给了 亮仔 一份情书*",
+				"亮仔: 我尽快送达.",
 				"::changeCharLine@15",
 				"::endDialog",
-				"Richard: What did Mimi say?",
-				"You: I haven't delivered the letter yet.",
+				"小罗: 付婆 说什么子了?",
+				"亮仔: 我还没有发快递过去呢.",
 				"::endDialog",
-				"Richard: Did you find a pencil yet?",
+				"小罗: 你找到2B铅笔了吗?",
 				"::checkItem@Pencil,6",
-				"You: Nope."];
+				"亮仔: 没有."];
 //			this.add(this.charactor_NPC);
 			foreground.add(this.charactor_NPC);
 			// Item that can be picked up in the world
 			this.character_pencil = new FlxCharacter(18,5,EmbedAssets.INVENTORY_PENCIL,this.map_world);
 			this.character_pencil.dialog = ["::addInv@Pencil",
 				"::tele@-1,-1",
-				"*You have found a pencil.*"];
+				"*亮仔 找到2B铅笔.*"];
 			foreground.add(this.character_pencil);
 			// Character_girl
 			this.character_girl = new FlxCharacter(13,22,EmbedAssets.CHARACTER_GIRL,this.map_world);
 			this.character_girl.dialog =  ["::checkItem@Letter,2",
-				"Mimi: Welcome to my house!",
+				"付婆: 欢迎来到我家!",
 				"::endDialog",
-				"You: I have a letter for you from Richard.",
+				"亮仔: 我这有一封来自小罗的情书.",
 				"::remInv@Letter",
-				"*You give the letter to Mimi*",
-				"Mimi: Oh, how exciting, thanks a lot!",
-				"You: Well, it seems my adventure ends here, I've done a great job today...",
+				"*亮仔 传递情书给了 付婆*",
+				"付婆: 噢, 太兴奋了, 太感谢了!",
+				"亮仔: 好吧, 好像我的冒险就到这了, 今天真是干了一件惊天动地的任务...",
 				"::endGame",
 				""];
 			foreground.add(this.character_girl);


Fixed minor bug in babylatch

Fixed minor bug in babylatch

--- src/Modules/BabyLatch.as
+++ src/Modules/BabyLatch.as
@@ -39,7 +39,7 @@
 		}

 		override public function getConfiguration():Configuration {
-			if (U.state.level.configurableLatchesEnabled)
+			if (U.state && U.state.level.configurableLatchesEnabled)
 				return configuration;
 			return null;
 		}


Fix reading of 0-payload-length backend messages; additional debugging.

--- driver/src/main/flex/org/postgresql/febe/MessageStream.as
+++ driver/src/main/flex/org/postgresql/febe/MessageStream.as
@@ -25,6 +25,7 @@
     import org.postgresql.io.IDataStream;
     import org.postgresql.log.ILogger;
     import org.postgresql.log.Log;
+    import org.postgresql.util.assert;
     import org.postgresql.util.format;

     public class MessageStream extends EventDispatcher implements IMessageStream {
@@ -85,12 +86,18 @@
                     // our purposes (it would make a number of things more confusing
                     // than necessary), so we subtract the size of the length field.
                     _nextMessageLen = _dataStream.readInt() - 4;
+                    LOGGER.debug("Waiting for {0} more bytes ({1} available)", _nextMessageLen, _dataStream.bytesAvailable);
                 } else {
+                    LOGGER.debug("Reading message of {0} bytes ({1} available)", _nextMessageLen, _dataStream.bytesAvailable);
                     // TODO: We should not have to copy the message to its own array: we
                     // should wrap the stream in something that sets an arbitrary hard limit
                     // to the number of bytes this particular message can read.
                     var messageBytes:ByteDataStream = new ByteDataStream();
-                    _dataStream.readBytes(messageBytes, 0, _nextMessageLen);
+                    if (_nextMessageLen > 0) {
+                        // N.B.: If
+                        _dataStream.readBytes(messageBytes, 0, _nextMessageLen);
+                    }
+                    assert("Unexpected amount of data was read off the stream", messageBytes.length == _nextMessageLen);
                     var nextTypeCode:String = String.fromCharCode(_nextMessageType);
                     var nextMessageClass:Class = backendMessageTypes[nextTypeCode];
                     if (!nextMessageClass) {


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

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


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

--- frameworks/projects/mx/src/mx/controls/ToggleButtonBar.as
+++ frameworks/projects/mx/src/mx/controls/ToggleButtonBar.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2005-2007 Adobe Systems Incorporated
-//  All Rights Reserved.
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
 //
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////


Transferred from the Adobe Open Source Subversion Repository

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

--- frameworks/projects/framework/src/mx/core/IToolTip.as
+++ frameworks/projects/framework/src/mx/core/IToolTip.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: 14608
Author:   jszeto@adobe.com
Date:     2010-03-05T20:06:31.473500Z

Log Message:
-----------
Merge revision 14607 from 4.x to trunk

http://bugs.adobe.com/jira/browse/SDK-25723 - The gripper in a Spark Window (with Flex chrome) should be flipped when layoutDirection="rtl"

Cleared out the layoutDirection property for the BitmapImage containing the gripper skin

http://bugs.adobe.com/jira/browse/SDK-25698 - Popup doesn't inherit rtl layoutDierction from its parent PopupButton

Fixed PopupButton, ColorPicker and DateField to open the dropDown from right to left. For PopUpButton and ColorPicker, this means that the right edge of the dropdown should align with the right edge of the anchor button. For DateField, this means the right edge of the dropdown should align with the right edge of the calendar icon.

In ColorPicker, I had to validate the dropDown in order to get its width. ComboBox, PopupButton and DateField create their dropdowns early or perform the validation when it is first opened.

QE notes: n/a
Doc notes: n/a
Bugs: SDK-25723, SDK-25698
Reviewer: Kevin
Tests run: checkintests, ColorPicker, PopUpButton, DateField
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airspark/src/spark/skins/spark/windowChrome/GripperSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ColorPicker.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateField.as</path>

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

--- frameworks/projects/mx/src/mx/controls/PopUpButton.as
+++ frameworks/projects/mx/src/mx/controls/PopUpButton.as
@@ -862,8 +862,11 @@
         // before the popUp is displayed
         // or override to implement special display behavior

+        if (getPopUp() == null)
+            return;
+
         var popUpGap:Number = getStyle("popUpGap");
-        var point:Point = new Point(layoutDirection == "rtl" ? unscaledWidth : 0, unscaledHeight + popUpGap);
+        var point:Point = new Point(layoutDirection == "rtl" ? _popUp.width : 0, unscaledHeight + popUpGap);
         point = localToGlobal(point);

         //Show or hide the popup
@@ -875,10 +878,7 @@
         var screen:Rectangle = sm.getVisibleApplicationRect();

         if (show)
-        {
-            if (getPopUp() == null)
-                return;
-
+        {
             if (_popUp.parent == null)
             {
                 PopUpManager.addPopUp(_popUp, this, false);


Transferred from the Adobe Open Source Subversion Repository

Revision: 10766
Author:   gruehle@adobe.com
Date:     2009-09-30T22:55:55.205927Z

Log Message:
-----------
Re-commit compiler errors for other theme's styles feature. If Style metadata has a "themes" attribute, the style is only valid if that theme is applied.

The Spark theme is applied by default. The halo theme can be specified as a compiler argument or by selecting the "MX Only" component set in Builder.

All other themes need to be applied using theme+= instead of theme=. If you use theme= you will get warnings about styles used in CSS selectors, and errors if you use any theme-specific style as an attribute on an MXML tag.

By default, styles that aren't valid for the current theme are errors. These can be changed to warnings with the report-invalid-styles-as-warnings compiler option.

QE notes: Expect test breakage
Doc notes: The new policy for themes needs to be documented.
Bugs: none yet, but I'm sure there will be some...
Reviewer: Ryan
Tests run: checkintests, cyclone
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ToolTip.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/ComponentBuilder.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StylesContainer.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/VideoDisplay.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/MxmlDocument.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/common/DefaultsConfigurator.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateChooser.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/sparkskins/src/mx/skins/spark/ApplicationBackground.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/CursorManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/halo/defaults.css</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/themes/Spark/spark.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ControlBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/CalendarLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/SkinStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/common/CompilerConfiguration.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/InterfaceCompiler.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ApplicationControlBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/basicTests/BasicTests.css</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/DeclarationHandler.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Tree.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ToolTipBorder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/Type.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/MxmlConfiguration.java</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/colorPickerClasses/SwatchPanel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/TypeTable.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/tools/PreLink.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/sparkskins/src/SparkSkinsClasses.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/ImplementationCompiler.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/common/MxmlConfiguration.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler_en.properties</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/AttributeHandler.java</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/core/ScrollControlBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/fxg/FXGCompiler.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/SkinnableDataContainerSkin.mxml</path>

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

--- frameworks/projects/mx/src/mx/controls/RadioButton.as
+++ frameworks/projects/mx/src/mx/controls/RadioButton.as
@@ -25,6 +25,8 @@
 import mx.managers.IFocusManager;
 import mx.managers.IFocusManagerGroup;
 import mx.core.UITextField;
+import mx.styles.CSSStyleDeclaration;
+import mx.styles.StyleManager;
 import flash.text.TextLineMetrics;
 import flash.utils.getQualifiedClassName;

@@ -172,6 +174,18 @@
         // Old padding logic variables
         centerContent = false;
         extraSpacing = 8;
+
+        if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_4_0)
+        {
+            var typeSelector:CSSStyleDeclaration =
+                StyleManager.getStyleDeclaration("mx.controls.RadioButton");
+
+            if (typeSelector)
+            {
+                if (typeSelector.getStyle("cornerRadius") === undefined)
+                    typeSelector.setStyle("cornerRadius", 7);
+            }
+        }
     }

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


- added better timing for adding of event listeners, so no exception is thrown

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

--- src/reprise/controls/Slider.as
+++ src/reprise/controls/Slider.as
@@ -150,6 +150,13 @@
 		//*****************************************************************************************
 		//*                                   Protected Methods                                   *
 		//*****************************************************************************************
+		override protected function initialize():void
+		{
+			super.initialize();
+			addEventListener(Event.ADDED_TO_STAGE, self_addedToStage);
+			addEventListener(Event.REMOVED_FROM_STAGE, self_removedFromStage);
+		}
+
 		override protected function createChildren():void
 		{
 			createTrack();
@@ -183,7 +190,6 @@
 		{
 			m_thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumb_click);
 			m_track.addEventListener(MouseEvent.MOUSE_DOWN, track_mouseDown);
-			stage.addEventListener(MouseEvent.MOUSE_UP, stage_mouseUp);
 		}

 		protected function applyValue():void
@@ -252,6 +258,16 @@
 		//*****************************************************************************************
 		//*                                         Events                                        *
 		//*****************************************************************************************
+		protected function self_addedToStage(e:Event):void
+		{
+			stage.addEventListener(MouseEvent.MOUSE_UP, stage_mouseUp);
+		}
+
+		protected function self_removedFromStage(e:Event):void
+		{
+			stage.removeEventListener(MouseEvent.MOUSE_UP, stage_mouseUp);
+		}
+
 		protected function thumb_click(e:MouseEvent):void
 		{
 			m_dragStartThumbPosition = m_thumb.left;


Fixed sysclk text wandering off

Fixed sysclk text wandering off

--- src/Displays/DModule.as
+++ src/Displays/DModule.as
@@ -41,7 +41,7 @@
 						0xffffffff, true);

 			detailsText = new FlxText( -1, -1, width + U.GRID_DIM / 2, getDetails());
-			font.configureFlxText(detailsText, 0x0, 'center');
+			U.MODULE_FONT_CLOSE.configureFlxText(detailsText, 0x0, 'center');
 			detailsText.scrollFactor = scrollFactor; //object

 			if (module.abbrev) {
@@ -98,10 +98,6 @@
 				return;

 			getColor();
-
-			var font:FontTuple = this.font;
-			if (detailsText.font != font.id || detailsText.size != font.size)
-				font.configureFlxText(detailsText = new FlxText(-1, -1, width + U.GRID_DIM / 2, getDetails()), 0x0, 'center');

 			for each (var displayNode:DNode in displayNodes)
 				displayNode.node.update();
@@ -195,10 +191,6 @@
 			for each (var displayPort:DPort in displayPorts)
 				displayPort.draw();
 		}
-
-		protected function get font():FontTuple {
-			return U.zoom >= 0.5 ? U.MODULE_FONT_CLOSE : U.MODULE_FONT_FAR;
-		}
 	}

 }


Add help text to MT

Add help text to MT

--- Arguments/src/Controller/logic/ModusTollens.as
+++ Arguments/src/Controller/logic/ModusTollens.as
@@ -69,7 +69,7 @@
 					//if many reasons
 					var params:AGORAParameters = AGORAParameters.getInstance();
 					if(argumentTypeModel.reasonModels.length > 1 && argumentTypeModel.lSubOption == null){
-						output = "Select how you want to connect the reasons"; //TODO: Translate
+						output = Language.lookup("SelectLanguageType");
 						argSelector.andor.x = argSelector.typeSelector.x + argSelector.typeSelector.width;
 						argSelector.andor.dataProvider = [params.AND, params.OR];
 						argSelector.andor.visible = argSelector.typeSelector.visible;


fixed Mesh ASDoc to make sure doc can be compiled

--- src/aerys/minko/scene/node/mesh/Mesh.as
+++ src/aerys/minko/scene/node/mesh/Mesh.as
@@ -56,13 +56,16 @@
 		 * A DataProvider object already bound to the Mesh bindings.
 		 *
 		 * <pre>
+		 * // set the "diffuseColor" property to 0x0000ffff
+		 * mesh.properties.diffuseColor = 0x0000ffff;
+		 *
 		 * // animate the "diffuseColor" property
 		 * mesh.addController(
 		 *   new AnimationController(
-		 * 	  new <ITimeline>[new ColorTimeline(
+		 * 	  new <ITimeline>[new ColorTimeline(
 		 * 	    "dataProvider.diffuseColor",
 		 * 	    5000,
-		 * 	    new <uint>[0xffffffff, 0xffffff00, 0xffffffff]
+		 * 	    new <uint>[0xffffffff, 0xffffff00, 0xffffffff]
 		 *    )]
 		 *   )
 		 * );


Added utility methods: findInHierarchy and dumpHierarchy.

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

--- src/as/com/threerings/flash/DisplayUtil.as
+++ src/as/com/threerings/flash/DisplayUtil.as
@@ -28,6 +28,8 @@
 import flash.geom.Rectangle;

 import mx.core.IRawChildrenContainer;
+
+import com.threerings.util.ClassUtil;

 public class DisplayUtil
 {
@@ -179,5 +181,114 @@
             return (dist1 > dist2) ? 1 : ((dist1 < dist2) ? -1 : 0); // signum
         };
     }
+
+    /**
+     * Find a component with the specified name in the specified display hierarchy.
+     * Whether finding deeply or shallowly, if two components have the target name and are
+     * at the same depth, the first one found will be returned.
+     *
+     * Note: This method will not find rawChildren of flex componenets.
+     */
+    public static function findInHierarchy (
+        top :DisplayObject, name :String, findShallow :Boolean = true,
+        maxDepth :int = int.MAX_VALUE) :DisplayObject
+    {
+        var result :Array = findInHierarchy0(top, name, findShallow, maxDepth);
+        return (result != null) ? DisplayObject(result[0]) : null;
+    }
+
+    /**
+     * Dump the display hierarchy to a String, each component on a newline, children indented
+     * two spaces:
+     * "instance0"  flash.display.Sprite
+     *   "instance1"  flash.display.Sprite
+     *   "entry_box"  flash.text.TextField
+     *
+     * Note: This method will not dump rawChildren of flex componenets.
+     */
+    public static function dumpHierarchy (top :DisplayObject) :String
+    {
+        return dumpHierarchy0(top);
+    }
+
+    /**
+     * Internal worker method for findInHierarchy.
+     */
+    private static function findInHierarchy0 (
+        obj :DisplayObject, name :String, shallow :Boolean, maxDepth :int, curDepth :int = 0) :Array
+    {
+        var bestResult :Array;
+        if (obj.name == name) {
+            if (shallow) {
+                return [ obj, curDepth ];
+
+            } else {
+                bestResult = [ obj, curDepth ];
+            }
+
+        } else {
+            bestResult = null;
+        }
+
+        if (curDepth < maxDepth && (obj is DisplayObjectContainer)) {
+            var cont :DisplayObjectContainer = obj as DisplayObjectContainer;
+            var nextDepth :int = curDepth + 1;
+            for (var ii :int = 0; ii < cont.numChildren; ii++) {
+                try {
+                    var result :Array = findInHierarchy0(
+                        cont.getChildAt(ii), name, shallow, maxDepth, nextDepth);
+                    if (result != null) {
+                        if (shallow) {
+                            // we update maxDepth for every hit, so result is always
+                            // shallower than any current bestResult
+                            bestResult = result;
+                            maxDepth = int(result[1]) - 1;
+                            if (maxDepth == curDepth) {
+                                break; // stop looking
+                            }
+
+                        } else {
+                            // only replace if it's deeper
+                            if (bestResult == null || int(result[1]) > int(bestResult[1])) {
+                                bestResult = result;
+                            }
+                        }
+                    }
+                } catch (err :SecurityError) {
+                    // skip this child
+                }
+            }
+        }
+
+        return bestResult;
+    }
+
+    /**
+     * Internal worker method for dumpHierarchy.
+     */
+    private static function dumpHierarchy0 (
+        obj :DisplayObject, spaces :String = "", inStr :String = "") :String
+    {
+        if (obj != null) {
+            if (inStr != "") {
+                inStr += "\n";
+            }
+            inStr += spaces + "\"" + obj.name + "\"  " + ClassUtil.getClassName(obj);
+
+            if (obj is DisplayObjectContainer) {
+                spaces += "  ";
+                var container :DisplayObjectContainer = obj as DisplayObjectContainer;
+                for (var ii :int = 0; ii < container.numChildren; ii++) {
+                    try {
+                        var child :DisplayObject = container.getChildAt(ii);
+                        inStr = dumpHierarchy0(container.getChildAt(ii), spaces, inStr);
+                    } catch (err :SecurityError) {
+                        inStr += "\n" + spaces + "SECURITY-BLOCKED";
+                    }
+                }
+            }
+        }
+        return inStr;
+    }
 }
 }


Улучшение логера

Улучшение логера

--- src/main/org/shypl/common/logging/TimedFormattedOutput.as
+++ src/main/org/shypl/common/logging/TimedFormattedOutput.as
@@ -1,24 +1,24 @@
 package org.shypl.common.logging {
 	import flash.utils.getTimer;
-
+
 	import org.shypl.common.lang.AbstractMethodException;
 	import org.shypl.common.util.StringUtils;
-
+
 	[Abstract]
 	public class TimedFormattedOutput implements Output {
 		public function write(level:Level, logger:String, message:String):void {
 			writeRecord(createRecord(getTimer(), level, logger, message));
 		}
-
+
 		[Abstract]
 		protected function writeRecord(record:String):void {
 			throw new AbstractMethodException();
 		}
-
+
 		protected function createRecord(time:int, level:Level, logger:String, message:String):String {
-			return "[" + formatTime(time) + " " + formatLevel(level) + "] " + formatLogger(logger) + ": " + formatMessage(message);
+			return formatRecord(formatTime(time), formatLevel(level), formatLogger(logger), formatMessage(message));
 		}
-
+
 		protected function formatTime(ms:int):String {
 			var h:int = ms / 3600000;
 			ms -= h * 3600000;
@@ -26,23 +26,27 @@
 			ms -= m * 60000;
 			var s:int = ms / 1000;
 			ms -= s * 1000;
-
+
 			return StringUtils.padLeft(h.toString(), "0", 2)
 				+ ":" + StringUtils.padLeft(m.toString(), "0", 2)
 				+ ":" + StringUtils.padLeft(s.toString(), "0", 2)
 				+ "." + StringUtils.padLeft(ms.toString(), "0", 3);
 		}
-
+
 		protected function formatLevel(level:Level):String {
 			return StringUtils.padRight(level.name, " ", 5);
 		}
-
+
 		protected function formatLogger(logger:String):String {
 			return logger;
 		}
-
+
 		protected function formatMessage(message:String):String {
 			return message;
 		}
+
+		protected function formatRecord(time:String, level:String, logger:String, message:String):String {
+			return "[" + time + " " + level + "] " + logger + ": " + message;
+		}
 	}
 }


Wait until stream metadata has been recieved before processing commands.

--- src/goplayer/Player.as
+++ src/goplayer/Player.as
@@ -67,8 +67,6 @@
         volume = sharedVolumeVariable.value
       else
         volume = DEFAULT_VOLUME
-
-      processCommands()
     }

     public function get movie() : Movie
@@ -207,6 +205,8 @@

       if (!usingRTMP)
         debug("Video file size: " + stream.httpFileSize)
+
+      maybeProcessCommands()
     }

     public function handleStreamingStarted() : void
@@ -441,7 +441,13 @@
     // -----------------------------------------------------

     public function handleCommandEnqueued() : void
-    { processCommands() }
+    { maybeProcessCommands() }
+
+    private function maybeProcessCommands() : void
+    {
+      if (metadata != null)
+        processCommands()
+    }

     private function processCommands() : void
     {


Added support for debug forced load level

--- src/Menu/MenuState.as
+++ src/Menu/MenuState.as
@@ -66,12 +66,21 @@
 				return false;
 			U.checkedURL = true;

-			var path:QueryString = new QueryString;
-			if (!path.parameters.lvl)
+			var lvl:String, code:String;
+			if (DEBUG.FORCE_LOAD_LEVEL) {
+				lvl = DEBUG.FORCE_LEVEL;
+				code = DEBUG.FORCE_CODE;
+			} else {
+				var path:QueryString = new QueryString;
+				lvl = path.parameters.lvl;
+				code = path.parameters.code;
+			}
+
+			if (!lvl)
 				return false;

 			try {
-				var levelIndex:int = C.safeInt(path.parameters.lvl);
+				var levelIndex:int = C.safeInt(lvl);
 			} catch (error:Error) {
 				addErrorText("Bad level index!");
 				return false;
@@ -88,12 +97,12 @@
 				return false;
 			}

-			if (!path.parameters.code) {
+			if (!code) {
 				FlxG.switchState(new LevelState(level));
 				return true;
 			}

-			var loader:URLLoader = C.sendRequest(U.LOOKUP_URL, { 'hash' : path.parameters.code }, function onLoad(e : Event):void {
+			var loader:URLLoader = C.sendRequest(U.LOOKUP_URL, { 'hash' : code }, function onLoad(e : Event):void {
 				var response:String = loader.data;
 				if (response.indexOf("ERROR") == 0) {
 					addErrorText(response);


added an optional parameter to Geometry.cast(), the normal of the hit test.

--- src/aerys/minko/render/geometry/Geometry.as
+++ src/aerys/minko/render/geometry/Geometry.as
@@ -965,6 +965,8 @@
 		 * of the actual ray/geometry hit point.
 		 * @param hitUV An optional reference to a Point object to fill with the (u, v) texture coordinates
 		 * of the actual ray/geometry hit point.
+		 * @param hitNormal An optional reference to a Vector4 object to fill the normal of the intersection
+		 * point if any.
 		 *
 		 * @return The triangle ID (the ID of the first index of the triangle in the IndexStream) that was
 		 * hit by the specified ray, -1 otherwise.
@@ -973,7 +975,8 @@
 		public function cast(ray 		: Ray,
 							 transform 	: Matrix4x4 = null,
 							 hitXYZ 	: Vector4 	= null,
-							 hitUV		: Point		= null) : int
+							 hitUV		: Point		= null,
+							 hitNormal	: Vector4	= null) : int
 		{
 			var numVertices : uint 	= indexStream._data.length / 2;

@@ -1017,33 +1020,57 @@

 			var lambda			: Vector4		= new Vector4();

+			//vertex 1
+			var v0X 			: Number 		= .0;
+			var v0Y 			: Number 		= .0;
+			var v0Z 			: Number 		= .0;
+
+			//vertex2
+			var v1X 			: Number 		= .0;
+			var v1Y 			: Number 		= .0;
+			var v1Z 			: Number 		= .0;
+
+			//vertex3
+			var v2X 			: Number 		= .0;
+			var v2Y 			: Number 		= .0;
+			var v2Z 			: Number 		= .0;
+
+			//edge 1
+			var edge1X 			: Number 		= .0;
+			var edge1Y 			: Number 		= .0;
+			var edge1Z 			: Number 		= .0;
+
+			//edge 2
+			var edge2X 			: Number 		= .0;
+			var edge2Y 			: Number 		= .0;
+			var edge2Z 			: Number 		= .0;
+
 			for (var verticeIndex : uint = 0; verticeIndex < numVertices; verticeIndex += 3)
 			{
 				indicesData.position = verticeIndex * 2;

 				xyzData.position = indicesData.readUnsignedShort() * xyzVertexSize + offset
-				var v0X : Number = xyzData.readFloat();
-				var v0Y : Number = xyzData.readFloat();
-				var v0Z : Number = xyzData.readFloat();
+				v0X = xyzData.readFloat();
+				v0Y = xyzData.readFloat();
+				v0Z = xyzData.readFloat();

 				xyzData.position = indicesData.readUnsignedShort() * xyzVertexSize + offset;
-				var v1X : Number = xyzData.readFloat();
-				var v1Y : Number = xyzData.readFloat();
-				var v1Z : Number = xyzData.readFloat();
+				v1X = xyzData.readFloat();
+				v1Y = xyzData.readFloat();
+				v1Z = xyzData.readFloat();

 				xyzData.position = indicesData.readUnsignedShort() * xyzVertexSize + offset;
-				var v2X : Number = xyzData.readFloat();
-				var v2Y : Number = xyzData.readFloat();
-				var v2Z : Number = xyzData.readFloat();
+				v2X = xyzData.readFloat();
+				v2Y = xyzData.readFloat();
+				v2Z = xyzData.readFloat();

-
-				var edge1X : Number = v1X - v0X;
-				var edge1Y : Number = v1Y - v0Y;
-				var edge1Z : Number = v1Z - v0Z;
-
-				var edge2X : Number = v2X - v0X;
-				var edge2Y : Number = v2Y - v0Y;
-				var edge2Z : Number = v2Z - v0Z;
+				edge1X = v1X - v0X;
+				edge1Y = v1Y - v0Y;
+				edge1Z = v1Z - v0Z;
+
+				edge2X = v2X - v0X;
+				edge2Y = v2Y - v0Y;
+				edge2Z = v2Z - v0Z;

 				// cross product
 				var pvecX : Number = localDirectionY * edge2Z - edge2Y * localDirectionZ;
@@ -1136,6 +1163,26 @@
 					if (uvStream != xyzStream)
 						uvStream.unlock(false);
 				}
+
+				if (hitNormal)
+				{
+					// length
+					var edge1Length		: Number	= Math.sqrt(edge1X * edge1X + edge1Y * edge1Y + edge1Z * edge1Z);
+					var edge2Length		: Number	= Math.sqrt(edge2X * edge2X + edge2Y * edge2Y + edge2Z * edge2Z);
+
+					// normalize
+					edge1X /= edge1Length;
+					edge1Y /= edge1Length;
+					edge1Z /= edge1Length;
+					edge2X /= edge2Length;
+					edge2Y /= edge2Length;
+					edge2Z /= edge2Length;
+
+					// cross product
+					hitNormal.x = edge1Y * edge2Z - edge1Z * edge2Y;
+					hitNormal.y = edge1Z * edge2X - edge1X * edge2Z;
+					hitNormal.z = edge1X * edge2Y - edge1Y * edge2X;
+				}
 			}

 			_indexStream.unlock(false);


Transferred from the Adobe Open Source Subversion Repository

Revision: 18006
Author:   dloverin@adobe.com
Date:     2010-10-04T21:04:40.944454Z

Log Message:
-----------
DataGrid editor api changes, clean up, and bug fixes.

QE notes: Not ready for testing.
Doc notes: None.
Bugs:
Reviewer: Hans
Tests run: checkintests
Is noteworthy for integration: No.

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/IGridItemEditor.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/DataGridEditor.as" copyfrom-rev="17973" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/DataGridEditor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/TextGridItemEditor.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridColumn.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.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="D">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/DataGridEditor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/ComboBoxGridItemEditor.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/DataGrid.as
+++ frameworks/projects/spark/src/spark/components/DataGrid.as
@@ -21,6 +21,7 @@

 import mx.collections.IList;
 import mx.core.IFactory;
+import mx.core.IIMESupport;
 import mx.core.IToolTip;
 import mx.core.IVisualElement;
 import mx.core.IVisualElementContainer;
@@ -31,9 +32,9 @@
 import mx.managers.CursorManagerPriority;
 import mx.managers.IFocusManagerComponent;

+import spark.components.gridClasses.DataGridEditor;
 import spark.components.supportClasses.CellPosition;
 import spark.components.supportClasses.CellRegion;
-import spark.components.supportClasses.DataGridEditor;
 import spark.components.supportClasses.GridColumn;
 import spark.components.supportClasses.GridDimensions;
 import spark.components.supportClasses.GridLayout;
@@ -284,7 +285,8 @@
 /**
  *  TBD(hmuller)
  */
-public class DataGrid extends SkinnableContainerBase implements IFocusManagerComponent, IGridItemRendererOwner
+public class DataGrid extends SkinnableContainerBase implements IFocusManagerComponent,
+                              IGridItemRendererOwner, IIMESupport
 {
     include "../core/Version.as";

@@ -849,22 +851,20 @@

     /**
      *  @private
-     *  Storage for the draggableColumns property.
+     *  Storage for the editable property.
      */
     private var _editable:Boolean = false;

     [Inspectable(category="General")]

     /**
-     *  A flag that indicates whether or not the user can edit
-     *  items in the data provider.
-     *  If true, the item renderers in the control are editable.
-     *  The user can click on an item renderer to open an editor.
-     *
-     *
You can turn off editing for individual columns of the
-     *  DataGrid control using the DataGridColumn.editable property,
-     *  or by handling the startItemEditorSession event

-     *
+     * The default value for the GridColumn editable property, which
+     * indicates if a corresponding cell's dataProvider item can be edited.
+     * If true, clicking on a selected cell opens an item editor, see
+     * startItemEditorSession.  Developers can enable/disable
+     * editing on a per cell (rather than per column) basis by handling
+     * the startItemEditorSession event.
+     *
      *  @default false
      *
      *  @langversion 3.0
@@ -883,6 +883,52 @@
     public function set editable(value:Boolean):void
     {
         _editable = value;
+    }
+
+    //----------------------------------
+    //  editorColumnIndex
+    //----------------------------------
+
+    /**
+     *  The zero-based column index of the cell that is being edited. The
+     *  value is -1 if no cell is being edited.
+     *
+     *  @default -1
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public function get editorColumnIndex():int
+    {
+        if (editor)
+            return editor.editorColumnIndex;
+
+        return -1;
+    }
+
+    //----------------------------------
+    //  editorRowIndex
+    //----------------------------------
+
+    /**
+     *  The zero-based row index of the cell that is being edited. The
+     *  value is -1 if no cell is being edited.
+     *
+     *  @default -1
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public function get editorRowIndex():int
+    {
+        if (editor)
+            return editor.editorRowIndex;
+
+        return -1;
     }

     //----------------------------------
@@ -902,6 +948,27 @@
     }

     //----------------------------------
+    //  enableIME
+    //----------------------------------
+
+    /**
+     *  A flag that indicates whether the IME should
+     *  be enabled when the component receives focus.
+     *
+     *  If the editor is up, it will set enableIME
+     *  accordingly.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public function get enableIME():Boolean
+    {
+        return false;
+    }
+
+    //----------------------------------
     //  gridSelection (private)
     //----------------------------------

@@ -920,6 +987,50 @@
     }

     //----------------------------------
+    //  imeMode
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _imeMode:String = null;
+
+    [Inspectable(environment="none")]
+
+    /**
+     *  The default value for the GridColumn imeMode property, which specifies
+     *  specifies the IME (input method editor) mode.
+     *  The IME enables users to enter text in Chinese, Japanese, and Korean.
+     *  Flex sets the specified IME mode when the control gets the focus,
+     *  and sets it back to the previous value when the control loses the focus.
+     *
+     *
The flash.system.IMEConversionMode class defines constants for the
+     *  valid values for this property.
+     *  You can also specify null to specify no IME.

+     *
+     *  @see flash.system.IMEConversionMode
+     *
+     *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public function get imeMode():String
+    {
+        return _imeMode;
+    }
+
+    /**
+     *  @private
+     */
+    public function set imeMode(value:String):void
+    {
+        _imeMode = value;
+    }
+
+    //----------------------------------
     //  itemEditor
     //----------------------------------

@@ -928,12 +1039,8 @@
     private var _itemEditor:IFactory = null;

     /**
-     *  A factory for IGridItemEditors used to edit individual grid cells.
-     *  This property can provide a default value for grid columns that do
-     *  not specify an item editor.
-     *
-     *  If not specified the itemEditor property on the grid
-     *  column being edited will be used.
+     *  The default value for the GridColumn itemEditor property, which specifies
+     *  the IGridItemEditor class used to create item editor instances.
      *
      *  @default null.
      *
@@ -1588,10 +1695,6 @@
             grid.gridSelection = gridSelection;
             grid.gridOwner = this;

-            // TODO (dloverin): only create the editor if one of the grid or one of the columns is editable.
-            editor = createEditor();
-            editor.initialize();
-
             // Grid cover Properties

             const modifiedGridProperties:Object = gridProperties;  // explicitly set properties
@@ -1628,6 +1731,10 @@
             for each (var deferredGridOperation:Function in deferredGridOperations)
                 deferredGridOperation(grid);
             deferredGridOperations.length = 0;
+
+            // Data grid editor
+            editor = createEditor();
+            editor.initialize();
         }

         if (instance == alternatingRowColorsBackground)
@@ -1718,6 +1825,10 @@
             grid.hoverIndicator = null;
             grid.caretIndicator = null;
             grid.selectionIndicator = null;
+
+            // Data grid editor
+            if (editor)
+                editor.uninitialize();
         }

         if (grid)


use getTimer() to avoid object creation

use getTimer() to avoid object creation

--- src/org/mangui/hls/loader/FragmentLoader.as
+++ src/org/mangui/hls/loader/FragmentLoader.as
@@ -2,6 +2,7 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  package org.mangui.hls.loader {
+    import flash.utils.getTimer;
     import org.mangui.hls.controller.AudioTrackController;
     import org.mangui.hls.controller.AutoLevelController;
     import org.mangui.hls.HLSSettings;
@@ -218,7 +219,7 @@
                 // if key loading failed
                 case  LOADING_KEY_IO_ERROR:
                     // compare current date and next retry date.
-                    if (new Date().valueOf() >= _key_load_error_date) {
+                    if (getTimer() >= _key_load_error_date) {
                         /* try to reload the key ...
                         calling _loadfragment will also reload key */
                         _loadfragment(_frag_current);
@@ -228,7 +229,7 @@
                 // if fragment loading failed
                 case LOADING_FRAGMENT_IO_ERROR:
                     // compare current date and next retry date.
-                    if (new Date().valueOf() >= _frag_load_error_date) {
+                    if (getTimer() >= _frag_load_error_date) {
                         /* try to reload the key ...
                         calling _loadfragment will also reload key */
                         _loadfragment(_frag_current);
@@ -294,7 +295,7 @@
             }
             if (HLSSettings.keyLoadMaxRetry == -1 || _key_retry_count < HLSSettings.keyLoadMaxRetry) {
                 _loading_state = LOADING_KEY_IO_ERROR;
-                _key_load_error_date = new Date().valueOf() + _key_retry_timeout;
+                _key_load_error_date = getTimer() + _key_retry_timeout;
                 CONFIG::LOGGING {
                     Log.warn("retry key load in " + _key_retry_timeout + " ms, count=" + _key_retry_count);
                 }
@@ -325,7 +326,7 @@
             }
             if (HLSSettings.fragmentLoadMaxRetry == -1 || _frag_retry_count < HLSSettings.fragmentLoadMaxRetry) {
                 _loading_state = LOADING_FRAGMENT_IO_ERROR;
-                _frag_load_error_date = new Date().valueOf() + _frag_retry_timeout;
+                _frag_load_error_date = getTimer() + _frag_retry_timeout;
                 CONFIG::LOGGING {
                     Log.warn("retry fragment load in " + _frag_retry_timeout + " ms, count=" + _frag_retry_count);
                 }
@@ -352,11 +353,11 @@
                 fragData.pts_min_audio = fragData.pts_min_video = fragData.tags_pts_min_audio = fragData.tags_pts_min_video = Number.POSITIVE_INFINITY;
                 fragData.pts_max_audio = fragData.pts_max_video = fragData.tags_pts_max_audio = fragData.tags_pts_max_video = Number.NEGATIVE_INFINITY;
                 var fragMetrics : FragmentMetrics = _frag_current.metrics;
-                fragMetrics.loading_begin_time = new Date().valueOf();
+                fragMetrics.loading_begin_time = getTimer();

                 // decrypt data if needed
                 if (_frag_current.decrypt_url != null) {
-                    fragMetrics.decryption_begin_time = new Date().valueOf();
+                    fragMetrics.decryption_begin_time = getTimer();
                     fragData.decryptAES = new AES(_hls.stage, _keymap[_frag_current.decrypt_url], _frag_current.decrypt_iv, _fragDecryptProgressHandler, _fragDecryptCompleteHandler);
                     CONFIG::LOGGING {
                         Log.debug("init AES context:" + fragData.decryptAES);
@@ -398,7 +399,7 @@
                 Log.debug("loading completed");
             }
             var fragMetrics : FragmentMetrics = _frag_current.metrics;
-            fragMetrics.loading_end_time = new Date().valueOf();
+            fragMetrics.loading_end_time = getTimer();
             fragMetrics.size = fragData.bytesLoaded;

             var _loading_duration : uint = fragMetrics.loading_end_time - fragMetrics.loading_request_time;
@@ -417,7 +418,7 @@
             var fragData : FragmentData = _frag_current.data;
             var fragMetrics : FragmentMetrics = _frag_current.metrics;
             if (isNaN(fragMetrics.parsing_begin_time)) {
-                fragMetrics.parsing_begin_time = new Date().valueOf();
+                fragMetrics.parsing_begin_time = getTimer();
             }
             var bytes : ByteArray = fragData.bytes;
             if (_frag_current.byterange_start_offset != -1) {
@@ -453,7 +454,7 @@

             if (fragData.decryptAES) {
                 var fragMetrics : FragmentMetrics = _frag_current.metrics;
-                fragMetrics.decryption_end_time = new Date().valueOf();
+                fragMetrics.decryption_end_time = getTimer();
                 var decrypt_duration : Number = fragMetrics.decryption_end_time - fragMetrics.decryption_begin_time;
                 CONFIG::LOGGING {
                     Log.debug("Decrypted     duration/length/speed:" + decrypt_duration + "/" + fragData.bytesLoaded + "/" + ((8000 * fragData.bytesLoaded / decrypt_duration) / 1024).toFixed(0) + " kb/s");
@@ -705,7 +706,7 @@
             if (_hasDiscontinuity || _switchlevel) {
                 _demux = null;
             }
-            frag.metrics.loading_request_time = new Date().valueOf();
+            frag.metrics.loading_request_time = getTimer();
             _frag_current = frag;
             if (frag.decrypt_url != null) {
                 if (_keymap[frag.decrypt_url] == undefined) {
@@ -874,7 +875,7 @@
                     }
                     // provide tags to HLSNetStream
                     _tags_callback(_level, _frag_current.continuity, _frag_current.seqnum, !fragData.video_found, fragData.video_width, fragData.video_height, _frag_current.tag_list, fragData.tags, fragData.tag_pts_min, fragData.tag_pts_max, _hasDiscontinuity, min_offset, _frag_current.program_date + fragData.tag_pts_start_offset);
-                    var processing_duration : Number = (new Date().valueOf() - _frag_current.metrics.loading_request_time);
+                    var processing_duration : Number = (getTimer() - _frag_current.metrics.loading_request_time);
                     var bandwidth : Number = Math.round(fragData.bytesLoaded * 8000 / processing_duration);
                     var tagsMetrics : HLSLoadMetrics = new HLSLoadMetrics(_level, bandwidth, fragData.tag_pts_end_offset, processing_duration);
                     _hls.dispatchEvent(new HLSEvent(HLSEvent.TAGS_LOADED, tagsMetrics));
@@ -926,7 +927,7 @@

             // Calculate bandwidth
             var fragMetrics : FragmentMetrics = _frag_current.metrics;
-            fragMetrics.parsing_end_time = new Date().valueOf();
+            fragMetrics.parsing_end_time = getTimer();
             CONFIG::LOGGING {
                 Log.debug("Total Process duration/length/bw:" + fragMetrics.processing_duration + "/" + fragMetrics.size + "/" + (fragMetrics.bandwidth / 1024).toFixed(0) + " kb/s");
             }