Added support for for-in and for-each.
Improved code and fixed bugs for recent functionality.

Change-Id: I750e49bc5d84ee20b3a04d11ffbc0c3322fd4801

--- WeaveCore/src/weave/compiler/Compiler.as
+++ WeaveCore/src/weave/compiler/Compiler.as
@@ -52,6 +52,9 @@
 		private static const INDEX_CONDITION:int = 0;
 		private static const INDEX_TRUE:int = 1;
 		private static const INDEX_FALSE:int = 2;
+
+		private static const INDEX_FOR_LIST:int = 0;
+		private static const INDEX_FOR_ITEM:int = 1;

 		private static const ST_IF:String = 'if';
 		private static const ST_ELSE:String = 'else';
@@ -85,13 +88,11 @@
 			ST_IF, ST_FOR, ST_FOR_EACH, ST_WHILE, ST_SWITCH, ST_CATCH
 		];

+		/**
+		 * Used during compiling only.
+		 */
 		private static const _jumpStatements:Array = [ST_BREAK, ST_CONTINUE, ST_RETURN];

-		/**
-		 * Used during evaluation.
-		 */
-		private static const _loopStatements:Array = [ST_DO, ST_WHILE, ST_FOR_DO, ST_FOR_IN, ST_FOR_EACH];
-
 		/**
 		 * Only used during evaluation and decompiling.
 		 */
@@ -286,7 +287,9 @@
 			return libraries.concat(); // make a copy
 		}

-		private const BRANCH_LOOKUP:Dictionary = new Dictionary(); // Function -> true
+		private const JUMP_LOOKUP:Dictionary = new Dictionary(); // Function -> true
+		private const LOOP_LOOKUP:Dictionary = new Dictionary(); // Function -> true or ST_BREAK or ST_CONTINUE
+		private const BRANCH_LOOKUP:Dictionary = new Dictionary(); // Function -> Boolean
 		private const ASSIGN_OP_LOOKUP:Object = new Dictionary(); // Function -> true
 		private const MAX_OPERATOR_LENGTH:int = 4;

@@ -430,7 +433,16 @@
 			operators['void'] = function(..._):void { };
 			operators['typeof'] = function(value:*):* { return typeof(value); };
 			operators['as'] = function(a:*, b:*):Object { return a as b; };
-			operators['in'] = function(a:*, b:*):Boolean { return a in b; };
+			operators['in'] = function(...args):* {
+				// dual purpose for infix operator and for..in loop initialization
+				if (args.length == 2)
+					return args[0] in args[1];
+
+				var a:Array = [];
+				for (var k:* in args[0])
+					a.push(k);
+				return a;
+			};
 			operators['is'] = operators['instanceof'] = function(a:*, b:*):Boolean { return a is b; };
 			operators[OPERATOR_NEW] = function(classOrQName:Object, ...params):Object
 			{
@@ -453,10 +465,17 @@
 					default: throw new Error("Too many constructor parameters (maximum 10)");
 				}
 			};
+			// special case operators for loop statements
+			operators[ST_DO] = function(x:*, y:*):* { return x && y; };
+			operators[ST_WHILE] = function(x:*, y:*):* { return x && y; };
+			operators[ST_FOR] = function(x:*, y:*):* { return x && y; };
+			operators[ST_FOR_DO] = function(x:*, y:*):* { return x && y; };
+			operators[ST_FOR_IN] = function(..._):*{};
+			operators[ST_FOR_EACH] = function(..._):*{};
 			// special case operators for jump statements
-			operators[ST_BREAK] = function():*{};
-			operators[ST_CONTINUE] = function():*{};
-			operators[ST_RETURN] = function():*{};
+			operators[ST_BREAK] = function(..._):*{};
+			operators[ST_CONTINUE] = function(..._):*{};
+			operators[ST_RETURN] = function(..._):*{};
 			// assignment operators -- first arg is host object, last arg is new value, remaining args are a chain of property names
 			assignmentOperators['=']    = function(o:*, ...a):* { for (var i:int = 0; i < a.length - 2; i++) o = o[a[i]]; return o[a[i]] =    a[i + 1]; };
 			assignmentOperators['+=']   = function(o:*, ...a):* { for (var i:int = 0; i < a.length - 2; i++) o = o[a[i]]; return o[a[i]] +=   a[i + 1]; };
@@ -502,10 +521,25 @@
 				if (operators[op] is Function)
 					constants[OPERATOR_ESCAPE + op] = operators[op];

-			// fill branch reverse-lookup dictionary
-			BRANCH_LOOKUP[constants[OPERATOR_ESCAPE + '?:']] = true;
-			BRANCH_LOOKUP[constants[OPERATOR_ESCAPE + '&&']] = true;
-			BRANCH_LOOKUP[constants[OPERATOR_ESCAPE + '||']] = false;
+			// fill reverse-lookup dictionaries
+			BRANCH_LOOKUP[operators[ST_DO]] = true;
+			BRANCH_LOOKUP[operators[ST_WHILE]] = true;
+			BRANCH_LOOKUP[operators[ST_FOR]] = true;
+			BRANCH_LOOKUP[operators[ST_FOR_DO]] = true;
+			BRANCH_LOOKUP[operators['?:']] = true;
+			BRANCH_LOOKUP[operators['&&']] = true;
+			BRANCH_LOOKUP[operators['||']] = false;
+
+			LOOP_LOOKUP[operators[ST_DO]] = true;
+			LOOP_LOOKUP[operators[ST_WHILE]] = true;
+			LOOP_LOOKUP[operators[ST_FOR]] = ST_BREAK; // break target only
+			LOOP_LOOKUP[operators[ST_FOR_DO]] = ST_CONTINUE; // continue target only
+			LOOP_LOOKUP[operators[ST_FOR_IN]] = true;
+			LOOP_LOOKUP[operators[ST_FOR_EACH]] = true;
+
+			JUMP_LOOKUP[operators[ST_BREAK]] = true;
+			JUMP_LOOKUP[operators[ST_CONTINUE]] = true;
+			JUMP_LOOKUP[operators[ST_RETURN]] = true;

 			// fill assignment operator reverse-lookup dictionary
 			for each (var assigOp:Function in assignmentOperators)
@@ -791,23 +825,7 @@
 					throw new Error("Misplaced '" + tokens[i] + "'");
 				var lhs:CompiledFunctionCall = tokens[i - 1] as CompiledFunctionCall;
 				var rhs:ICompiledObject = tokens[i + 1] as ICompiledObject;
-				if (!lhs || !rhs)
-					throw new Error("Invalid " + (!lhs ? 'left' : 'right') + "-hand-side of '" + tokens[i] + "'");
-
-				// lhs should either be a constant or a call to operator '.'
-
-				if (lhs.evaluatedMethod is String) // lhs is a variable lookup
-				{
-					tokens.splice(i - 1, 3, compileOperator(tokens[i], [lhs.compiledMethod, tokens[i + 1]]));
-				}
-				else if (lhs.evaluatedMethod == operators['.'])
-				{
-					// switch to the assignment operator
-					lhs.compiledParams.push(tokens[i + 1]);
-					tokens.splice(i - 1, 3, compileOperator(tokens[i], lhs.compiledParams));
-				}
-				else
-					throw new Error("Invalid left-hand-side of '" + tokens[i] + "'");
+				tokens.splice(i - 1, 3, compileVariableAssignment(tokens[i], lhs, rhs));
 			}

 			// next step: commas
@@ -1084,7 +1102,9 @@
 				var subArray:Array = tokens.splice(open + 1, close - open - 1);
 				if (debug)
 					trace("compiling tokens", leftBracket, subArray.join(' '), rightBracket);
-				var separator:String = (leftBracket == '{' || statements.hasOwnProperty(token)) ? ';' : ',';
+				var separator:String = ',';
+				if (leftBracket == '{' || (leftBracket == '(' && statements.hasOwnProperty(token) && statements[token]))
+					separator = ';';
 				compiledParams = compileArray(subArray, separator);

 				if (leftBracket == '[') // this is either an array or a property access
@@ -1141,7 +1161,7 @@
 				else
 				{
 					// cannot be simplified at the moment -- multiple commands or statement params
-					if (statements.hasOwnProperty(token) && statements[token])
+					if (leftBracket == '(' && statements.hasOwnProperty(token) && statements[token])
 						separator = '('; // statement params
 					tokens.splice(open, 2, compileOperator(separator, compiledParams));
 				}
@@ -1405,6 +1425,26 @@
 			return compileFunctionCall(new CompiledConstant(operatorName, constants[operatorName]), compiledParams);
 		}

+		private function compileVariableAssignment(assignmentOperator:String, lhs:CompiledFunctionCall, rhs:ICompiledObject):ICompiledObject
+		{
+			if (!lhs || !rhs)
+				throw new Error("Invalid " + (!lhs ? 'left' : 'right') + "-hand-side of '" + assignmentOperator + "'");
+
+			// lhs should either be a variable lookup or a call to operator '.'
+			if (lhs.evaluatedMethod is String) // lhs is a variable lookup
+			{
+				return compileOperator(assignmentOperator, [lhs.compiledMethod, rhs]);
+			}
+			else if (lhs.evaluatedMethod == operators['.'])
+			{
+				// switch to the assignment operator
+				lhs.compiledParams.push(rhs);
+				return compileOperator(assignmentOperator, lhs.compiledParams);
+			}
+			else
+				throw new Error("Invalid left-hand-side of '" + assignmentOperator + "'");
+		}
+
 		/**
 		 * This function assumes that every token except statements have already been compiled.
 		 * @param tokens
@@ -1489,13 +1529,13 @@
 				{
 					// implemented as "while (cond && (stmt, true))" with first evaluation of 'cond' skipped
 					params = [params[2], compileOperator(',', [params[0], newTrueConstant()])];
-					tokens[startIndex] = compileFunctionCall(new CompiledConstant(ST_DO, operators['&&']), params);
+					tokens[startIndex] = compileOperator(ST_DO, params);
 				}
 				else if (stmt == ST_WHILE) // while (cond) {stmt}
 				{
 					// implemented as "while (cond && (stmt, true));"
 					params[1] = compileOperator(',', [params[1], newTrueConstant()]);
-					tokens[startIndex] = compileFunctionCall(new CompiledConstant(ST_WHILE, operators['&&']), params);
+					tokens[startIndex] = compileOperator(ST_WHILE, params);
 				}
 				else if (stmt == ST_FOR || stmt == ST_FOR_EACH) // for (params) {stmt}
 				{
@@ -1504,7 +1544,6 @@
 					{
 						// implemented as "(init, cond) && while((inc, cond) && (stmt, true))" with first evaluation of "(inc, cond)" skipped

-						var _for:CompiledConstant = new CompiledConstant(ST_FOR, operators['&&']);
 						var _init:ICompiledObject = forParams.compiledParams[0];
 						var _cond:ICompiledObject = forParams.compiledParams[1];
 						var _inc:ICompiledObject = forParams.compiledParams[2];
@@ -1512,19 +1551,21 @@
 						var _init_cond:ICompiledObject = compileOperator(',', [_init, _cond]);
 						var _inc_cond:ICompiledObject = compileOperator(',', [_inc, _cond]);
 						var _stmt_true:ICompiledObject = compileOperator(',', [params[1], newTrueConstant()]);
-						var _forDo:ICompiledObject = compileFunctionCall(new CompiledConstant(ST_FOR_DO, operators['&&']), [_inc_cond, _stmt_true]);
+						var _forDo:ICompiledObject = compileOperator(ST_FOR_DO, [_inc_cond, _stmt_true]);

-						tokens[startIndex] = compileFunctionCall(_for, [_init_cond, _forDo]);
-					}
-					else // for [each] (x in y) {stmt}
-					{
-						var _in:CompiledFunctionCall = forParams.compiledParams[0] as CompiledFunctionCall;
-
+						tokens[startIndex] = compileOperator(ST_FOR, [_init_cond, _forDo]);
+					}
+					else // for [each] (item in list) {stmt}
+					{
 						// differentiate from 'for' with 3 statement params
 						if (stmt == ST_FOR)
 							stmt = ST_FOR_IN;

-						// TODO
+						// 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 _list:ICompiledObject = compileOperator('in', [_in.compiledParams[1]]);
+						tokens[startIndex] = compileOperator(stmt, [_list, _item, params[1]]);
 					}
 				}
 				else if (_jumpStatements.indexOf(stmt) >= 0)
@@ -1752,7 +1793,6 @@
 				const stack:Array = []; // used as a queue of function calls
 				var call:CompiledFunctionCall;
 				var subCall:CompiledFunctionCall;
-				var constant:CompiledConstant;
 				var compiledParams:Array;
 				var method:Object;
 				var result:*;
@@ -1789,25 +1829,22 @@

 					method = call.evaluatedMethod;
 					compiledParams = call.compiledParams;
+
 					if (compiledParams)
 					{
-						if (call.evalIndex == INDEX_METHOD)
+						if (LOOP_LOOKUP[method] && call.evalIndex == INDEX_METHOD)
 						{
-							constant = call.compiledMethod as CompiledConstant;
-							if (constant)
+							if (method == operators[ST_DO] || method == operators[ST_FOR_DO])
 							{
-								if (constant.name == ST_DO || constant.name == ST_FOR_DO)
-								{
-									// skip first evaluation of loop condition
-									call.evaluatedParams[INDEX_CONDITION] = true;
-									call.evalIndex = INDEX_TRUE;
-								}
+								// skip first evaluation of loop condition
+								call.evaluatedParams[INDEX_CONDITION] = true;
+								call.evalIndex = INDEX_TRUE;
 							}
 						}
-
+
 						// check which parameters should be evaluated
 						for (; call.evalIndex < compiledParams.length; call.evalIndex++)
-						{
+						{
 							//trace(StringLib.lpad('', stack.length, '\t') + "[" + call.evalIndex + "] " + compiledParams[call.evalIndex].name);

 							// handle branching and short-circuiting
@@ -1820,9 +1857,34 @@
 								subCall = call.compiledMethod as CompiledFunctionCall;
 							else
 								subCall = compiledParams[call.evalIndex] as CompiledFunctionCall;
-
+
 							if (subCall != null)
 							{
+								// special case for for-in and for-each
+								// implemented as "for (each|in)(\in(list), item=undefined, stmt)
+								if (LOOP_LOOKUP[method] && call.evalIndex == INDEX_FOR_ITEM && (method == operators[ST_FOR_IN] || method == operators[ST_FOR_EACH]))
+								{
+									if ((call.evaluatedParams[INDEX_FOR_LIST] as Array).length > 0)
+									{
+										// next item
+										result = (call.evaluatedParams[INDEX_FOR_LIST] as Array).shift(); // property name
+										if (method == operators[ST_FOR_EACH])
+										{
+											// get property value from property name
+											var _in:CompiledFunctionCall = call.compiledParams[INDEX_FOR_LIST] as CompiledFunctionCall;
+											result = _in.evaluatedParams[0][result]; // property value
+										}
+										// set item value
+										subCall.evaluatedParams[subCall.evaluatedParams.length - 1] = result;
+									}
+									else
+									{
+										// break out of loop
+										method = operators[ST_BREAK];
+										break;
+									}
+								}
+
 								// initialize subCall and push onto stack
 								subCall.evalIndex = INDEX_METHOD;
 								stack.push(subCall);
@@ -1833,85 +1895,7 @@
 					// no parameters need to be evaluated, so make the function call now
 					try
 					{
-						if (compiledParams) // function call
-						{
-							if (method == operators[ST_RETURN])
-							{
-								return compiledParams.length ? call.evaluatedParams[0] : undefined;
-							}
-							else if (method == operators[ST_CONTINUE])
-							{
-								while (stack.length > 0)
-								{
-									call = stack.pop() as CompiledFunctionCall;
-									constant = call.compiledMethod as CompiledConstant;
-									if (constant && _loopStatements.indexOf(constant.name) >= 0)
-									{
-										stack.push(call); // continue loop
-										call.evalIndex = INDEX_METHOD + 1;
-										continue stackLoop;
-									}
-								}
-								return result; // continue at top level
-							}
-							else if (method == operators[ST_BREAK])
-							{
-								while (stack.length > 0)
-								{
-									call = stack.pop() as CompiledFunctionCall;
-									constant = call.compiledMethod as CompiledConstant;
-									if (constant.name == ST_FOR)
-										continue stackLoop;
-									if (constant && _loopStatements.indexOf(constant.name) >= 0 && constant.name != ST_FOR_DO)
-										continue stackLoop;
-								}
-								return result; // break at top level
-							}
-							else if (ASSIGN_OP_LOOKUP[method] && compiledParams.length == 2) // two params means local assignment
-							{
-								// local assignment
-								symbolName = call.evaluatedParams[0];
-								if (builtInSymbolTable.hasOwnProperty(symbolName))
-									throw new Error("Cannot assign built-in symbol: " + symbolName);
-
-								// assignment operator expects parameters like (host, ...chain, value)
-								// if there is no matching local variable and 'this' has a matching one, assign the property of 'this'
-								if (useThisScope && this && this.hasOwnProperty(symbolName) && !localSymbolTable.hasOwnProperty(symbolName))
-									result = method(this, symbolName, call.evaluatedParams[1]);
-								else // otherwise, assign local variable
-									result = method(localSymbolTable, symbolName, call.evaluatedParams[1]);
-							}
-							else if (method is Class)
-							{
-								// type casting
-								if (method == Array) // special case for Array
-									result = call.evaluatedParams.concat();
-								else if (call.evaluatedParams.length != 1)
-								{
-									// special case for Object('prop1', value1, ...)
-									if (method === Object)
-									{
-										var params:Array = call.evaluatedParams;
-										result = {}
-										for (i = 0; i < params.length - 1; i += 2)
-											result[params[i]] = params[i + 1];
-									}
-									else
-										throw new Error("Incorrect number of arguments for type casting.  Expected 1.");
-								}
-								// special case for Class('some.qualified.ClassName')
-								else if (method === Class && call.evaluatedParams[0] is String)
-									result = getDefinitionByName(call.evaluatedParams[0]);
-								else // all other single-parameter type casting operations
-									result = method(call.evaluatedParams[0]);
-							}
-							else
-							{
-								// function call
-								result = method.apply(null, call.evaluatedParams);
-							}
-						}
-						else // no compiled params means it's a variable lookup
+						if (!compiledParams) // no compiled params means it's a variable lookup
 						{
 							// call.compiledMethod is a constant and call.evaluatedMethod is the method name
 							symbolName = method as String;
@@ -1921,6 +1905,87 @@
 									break;
 							result = allSymbolTables[i][symbolName];
 						}
+						else if (JUMP_LOOKUP[method])
+						{
+							if (method == operators[ST_RETURN])
+							{
+								return compiledParams.length ? call.evaluatedParams[0] : undefined;
+							}
+							else if (method == operators[ST_CONTINUE])
+							{
+								stack.pop();
+								while (stack.length > 0)
+								{
+									call = stack[stack.length - 1] as CompiledFunctionCall;
+									method = call.evaluatedMethod;
+									if (LOOP_LOOKUP[method] && LOOP_LOOKUP[method] != ST_BREAK)
+									{
+										// continue loop
+										call.evalIndex = INDEX_METHOD + 1;
+										continue stackLoop;
+									}
+									stack.pop();
+								}
+								return result; // continue at top level
+							}
+							else if (method == operators[ST_BREAK])
+							{
+								while (stack.length > 1)
+								{
+									call = stack.pop() as CompiledFunctionCall;
+									method = call.evaluatedMethod;
+									if (LOOP_LOOKUP[method] && LOOP_LOOKUP[method] != ST_CONTINUE)
+									{
+										method = operators[ST_BREAK];
+										continue stackLoop;
+									}
+								}
+								return result; // break at top level
+							}
+						}
+						else if (ASSIGN_OP_LOOKUP[method] && compiledParams.length == 2) // two params means local assignment
+						{
+							// local assignment
+							symbolName = call.evaluatedParams[0];
+							if (builtInSymbolTable.hasOwnProperty(symbolName))
+								throw new Error("Cannot assign built-in symbol: " + symbolName);
+
+							// assignment operator expects parameters like (host, ...chain, value)
+							// if there is no matching local variable and 'this' has a matching one, assign the property of 'this'
+							if (useThisScope && this && this.hasOwnProperty(symbolName) && !localSymbolTable.hasOwnProperty(symbolName))
+								result = method(this, symbolName, call.evaluatedParams[1]);
+							else // otherwise, assign local variable
+								result = method(localSymbolTable, symbolName, call.evaluatedParams[1]);
+						}
+						else if (method is Class)
+						{
+							// type casting
+							if (method == Array) // special case for Array
+								result = call.evaluatedParams.concat();
+							else if (call.evaluatedParams.length != 1)
+							{
+								// special case for Object('prop1', value1, ...)
+								if (method === Object)
+								{
+									var params:Array = call.evaluatedParams;
+									result = {}
+									for (i = 0; i < params.length - 1; i += 2)
+										result[params[i]] = params[i + 1];
+								}
+								else
+									throw new Error("Incorrect number of arguments for type casting.  Expected 1.");
+							}
+							// special case for Class('some.qualified.ClassName')
+							else if (method === Class && call.evaluatedParams[0] is String)
+								result = getDefinitionByName(call.evaluatedParams[0]);
+							else // all other single-parameter type casting operations
+								result = method(call.evaluatedParams[0]);
+						}
+						else
+						{
+							// function call
+							result = method.apply(null, call.evaluatedParams);
+						}
 					}
 					catch (e:Error)
 					{
@@ -1931,11 +1996,15 @@
 					}

 					// handle while and for loops
-					constant = call.compiledMethod as CompiledConstant;
-					if (constant && _loopStatements.indexOf(constant.name) >= 0)
-					{
-						// loop
-						if (result)
+					if (LOOP_LOOKUP[method])
+					{
+						if (method == operators[ST_FOR_IN] || method == operators[ST_FOR_EACH])
+						{
+							// skip evaluation of list to avoid infinite loop
+							call.evalIndex = INDEX_FOR_ITEM;
+							continue;
+						}
+						else if (result)
 						{
 							// skip evaluation of method to avoid infinite 'do' loop
 							call.evalIndex = INDEX_METHOD + 1;
@@ -1963,7 +2032,7 @@
 			return wrapperFunction;
 		}

-		public static const _do_test:String = <![CDATA[
+		public static const _do_continue_test:String = <![CDATA[
 			var test = true;
 			do
 			{
@@ -2013,11 +2082,14 @@
 				"x = 10; while (x--) trace('x =',x);",
 				"for (y = 0; y < 10; y++) trace('y =',y);",
 				"x = 0; do { trace('do',x++); } while (trace('cond'), x < 10);",
-				_do_test,
+				_do_continue_test,
 				"for (trace('y =',0), y = 0; trace(y,'<',10), y < 10; trace('y++'), y++) { trace('loop y =',y); }",
 				"for (i = 0; i < 10; i++) if (i == 5) return ; else trace(i);",
 				"if (true) return ; else trace('test'); trace('BUG');",
-				"for (i = 0; i < 10; i++) { if (i == 3) continue; trace(i); if (i == 5) break; } trace('done');"
+				"for (i = 0; i < 10; i++) { if (i == 3) continue; trace(i); if (i == 5) break; } trace('done');",
+				"i = 0; do { if (i == 3) continue; trace(i); if (i == 5) break; } while (i >= 0 && ++i < 10) trace('done');",
+				"i = -1; while (++i < 10) { if (i == 3) continue; trace(i); if (i == 5) break; } trace('done');",
+				"a = []; o = Object('a',1,'b',2,'c',3,'d',4,'e',5); for (k in o) { a.push(`{k} = {o[k]}`); o['?'+k]=k+'!'; delete o[k]; } for each (p in o) a.push(p); return [a,o];"
 			];
 			var values:Array = [-2, -1, -0.5, 0, 0.5, 1, 2];
 			var vars:Object = {};
@@ -2060,4 +2132,4 @@
 			}
 		}
 	}
-}
+}


fix Matrix4x4 translation*, rotation* and scale* to preserve values consitency by storing them in separate components property and updating them only when required

--- src/aerys/minko/type/math/Matrix4x4.as
+++ src/aerys/minko/type/math/Matrix4x4.as
@@ -14,102 +14,138 @@

 	public class Matrix4x4 implements IWatchable
 	{
-		private static const FACTORY			: Factory			= Factory.getFactory(Matrix4x4);
-		private static const RAD2DEG			: Number			= 180. / Math.PI;
-		private static const DEG2RAD			: Number			= Math.PI / 180.;
-		private static const EPSILON			: Number			= 1e-100;
-
-		private static const TMP_VECTOR			: Vector.<Number>	= new <Number>[];
-		private static const TMP_VECTOR4		: Vector4			= new Vector4();
-		private static const TMP_MATRIX			: Matrix4x4			= new Matrix4x4();
-
-		private var _data		: Vector.<Number>		= new <Number>[];
-		private var _numPushes	: int					= 0;
-
-		private var _locked		: Boolean				= false;
-		private var _changed	: Signal				= new Signal('Matrix4x4.changed');
-
-		minko_math var _matrix	: flash.geom.Matrix3D	= new flash.geom.Matrix3D();
+		private static const FACTORY				: Factory			= Factory.getFactory(Matrix4x4);
+		private static const RAD2DEG				: Number			= 180. / Math.PI;
+		private static const DEG2RAD				: Number			= Math.PI / 180.;
+		private static const EPSILON				: Number			= 1e-100;
+
+		private static const TMP_VECTOR				: Vector.<Number>	= new <Number>[];
+		private static const TMP_VECTOR4			: Vector4			= new Vector4();
+		private static const TMP_MATRIX				: Matrix4x4			= new Matrix4x4();
+
+		private static const COMPONENT_TRANSLATION	: uint				= 1;
+		private static const COMPONENT_ROTATION		: uint				= 2;
+		private static const COMPONENT_SCALE		: uint				= 4;
+		private static const COMPONENT_ALL			: uint				= 7;
+
+		private var _data				: Vector.<Number>	= new <Number>[];
+		private var _rotation			: Vector4			= new Vector4();
+		private var _scale				: Vector4			= new Vector4();
+		private var _translation		: Vector4			= new Vector4();
+		private var _invalidComponents	: uint				= 7;
+		private var _numPushes			: uint				= 0;
+
+		private var _locked		: Boolean					= false;
+		private var _changed	: Signal					= new Signal('Matrix4x4.changed');
+
+		minko_math var _matrix	: flash.geom.Matrix3D		= new flash.geom.Matrix3D();

 		public function get translationX() : Number
 		{
-			return getTranslation(TMP_VECTOR4).x;
+			if (_invalidComponents)
+				updateComponents(COMPONENT_TRANSLATION);
+
+			return _translation.x;
 		}
 		public function set translationX(value : Number) : void
 		{
-			setTranslation(value, NaN, NaN);
+			setTranslation(value, _translation.y, _translation.z);
 		}

 		public function get translationY() : Number
 		{
-			return getTranslation(TMP_VECTOR4).y;
+			if (_invalidComponents)
+				updateComponents(COMPONENT_TRANSLATION);
+
+			return _translation.y;
 		}
 		public function set translationY(value : Number) : void
 		{
-			setTranslation(NaN, value, NaN);
+			setTranslation(_translation.x, value, _translation.z);
 		}

 		public function get translationZ() : Number
 		{
-			return getTranslation(TMP_VECTOR4).z;
+			if (_invalidComponents)
+				updateComponents(COMPONENT_TRANSLATION);
+
+			return _translation.z;
 		}
 		public function set translationZ(value : Number) : void
 		{
-			setTranslation(NaN, NaN, value);
+			setTranslation(_translation.x, _translation.y, value);
 		}

 		public function get rotationX() : Number
 		{
-			return getRotation(TMP_VECTOR4).x;
+			if (_invalidComponents)
+				updateComponents(COMPONENT_ROTATION);
+
+			return _rotation.x;
 		}
 		public function set rotationX(value : Number) : void
 		{
-			setRotation(value, NaN, NaN);
+			setRotation(value, _rotation.y, _rotation.z);
 		}

 		public function get rotationY() : Number
 		{
-			return getRotation(TMP_VECTOR4).y;
+			if (_invalidComponents)
+				updateComponents(COMPONENT_ROTATION);
+
+			return _rotation.y;
 		}
 		public function set rotationY(value : Number) : void
 		{
-			setRotation(NaN, value, NaN);
+			setRotation(_rotation.x, value, _rotation.z);
 		}

 		public function get rotationZ() : Number
 		{
-			return getRotation(TMP_VECTOR4).z;
+			if (_invalidComponents)
+				updateComponents(COMPONENT_ROTATION);
+
+			return _rotation.z;
 		}
 		public function set rotationZ(value : Number) : void
 		{
-			setRotation(NaN, NaN, value);
+			setRotation(_rotation.x, _rotation.y, value);
 		}

 		public function get scaleX() : Number
 		{
-			return getScale(TMP_VECTOR4).x;
+			if (_invalidComponents)
+				updateComponents(COMPONENT_SCALE);
+
+			return _scale.x;
 		}
 		public function set scaleX(value : Number) : void
 		{
-			setScale(value, NaN, NaN);
+			setScale(value, _scale.y, _scale.z);
 		}

 		public function get scaleY() : Number
 		{
-			return getScale(TMP_VECTOR4).y;
+			if (_invalidComponents)
+				updateComponents(COMPONENT_SCALE);
+
+			return _scale.y;
 		}
 		public function set scaleY(value : Number) : void
 		{
-			setScale(NaN, value, NaN);
+			setScale(_scale.x, value, _scale.z);
 		}

 		public function get scaleZ() : Number
 		{
-			return getScale(TMP_VECTOR4).z;
+			if (_invalidComponents)
+				updateComponents(COMPONENT_SCALE);
+
+			return _scale.z;
 		}
 		public function set scaleZ(value : Number) : void
 		{
-			setScale(NaN, NaN, value);
+			setScale(_scale.x, _scale.y, value);
 		}

 		public function get determinant(): Number
@@ -154,6 +190,7 @@
 			);

 			_matrix.copyRawDataFrom(TMP_VECTOR);
+			_invalidComponents = COMPONENT_ALL;

 			if (!_locked)
 				_changed.execute(this);
@@ -199,7 +236,10 @@

 			_numPushes--;
 			if (restore)
+			{
 				_matrix.copyRawDataFrom(_data, _numPushes * 16);
+				_invalidComponents = COMPONENT_ALL;
+			}

 			if (!_locked)
 				_changed.execute(this);
@@ -209,6 +249,7 @@

 		public function prepend(m : Matrix4x4) : Matrix4x4
 		{
+			_invalidComponents = COMPONENT_ALL;
 			_matrix.prepend(m._matrix);

 			if (!_locked)
@@ -219,6 +260,7 @@

 		public function append(m : Matrix4x4) : Matrix4x4
 		{
+			_invalidComponents = COMPONENT_ALL;
 			_matrix.append(m._matrix);

 			if (!_locked)
@@ -231,6 +273,7 @@
 									   axis			: Vector4,
 									   pivotPoint	: Vector4	= null) : Matrix4x4
 		{
+			_invalidComponents = COMPONENT_ALL;
 			_matrix.appendRotation(
 				radians * RAD2DEG,
 				axis._vector,
@@ -247,6 +290,7 @@
 									y	: Number	= 1.,
 									z	: Number	= 1.) : Matrix4x4
 		{
+			_invalidComponents = COMPONENT_ALL;
 			_matrix.appendScale(x, y, z);

 			if (!_locked)
@@ -257,6 +301,7 @@

 		public function appendUniformScale(scale : Number) : Matrix4x4
 		{
+			_invalidComponents = COMPONENT_ALL;
 			_matrix.appendScale(scale, scale, scale);

 			if (!_locked)
@@ -281,9 +326,12 @@
 										axis		: Vector4,
 										pivotPoint	: Vector4 = null) : Matrix4x4
 		{
-			_matrix.prependRotation(radians * RAD2DEG,
-									axis._vector,
-									pivotPoint ? pivotPoint._vector : null);
+			_invalidComponents = COMPONENT_ALL;
+			_matrix.prependRotation(
+				radians * RAD2DEG,
+				axis._vector,
+				pivotPoint ? pivotPoint._vector : null
+			);

 			if (!_locked)
 				_changed.execute(this);
@@ -295,6 +343,7 @@
 									 y	: Number = 1.,
 									 z	: Number = 1.) : Matrix4x4
 		{
+			_invalidComponents = COMPONENT_ALL;
 			_matrix.prependScale(x, y, z);

 			if (!_locked)
@@ -528,16 +577,14 @@

 		public function setTranslation(x : Number, y : Number, z : Number) : Matrix4x4
 		{
-			var position : Vector4	= getTranslation(TMP_VECTOR4);
-
-			if (!isNaN(x))
-				position.x = x;
-			if (!isNaN(y))
-				position.y = y;
-			if (!isNaN(z))
-				position.z = z;
-
-			_matrix.copyColumnFrom(3, position._vector);
+			if (_invalidComponents)
+				updateComponents(COMPONENT_TRANSLATION);
+
+			_translation.x = x;
+			_translation.y = y;
+			_translation.z = z;
+
+			_matrix.copyColumnFrom(3, _translation._vector);

 			if (!_locked)
 				_changed.execute(this);
@@ -558,17 +605,16 @@

 		public function setRotation(x : Number, y : Number, z : Number) : Matrix4x4
 		{
-			var components 	: Vector.<Vector3D>	= _matrix.decompose();
-			var rotation	: Vector3D			= components[1];
-
-			if (!isNaN(x))
-				rotation.x = x;
-			if (!isNaN(y))
-				rotation.y = y;
-			if (!isNaN(z))
-				rotation.z = z;
-
-			_matrix.recompose(components);
+			if (_invalidComponents)
+				updateComponents();
+
+			_rotation._vector.setTo(x, y, z);
+
+			_matrix.recompose(new <Vector3D>[
+				_translation._vector,
+				_rotation._vector,
+				_scale._vector
+			]);

 			if (!_locked)
 				_changed.execute(this);
@@ -582,8 +628,8 @@
 			var rotation	: Vector3D			= components[1];

 			output ||= new Vector4();
-			output.set(rotation.x, rotation.y, rotation.z, rotation.w);
-
+			output._vector = components[1];
+
 			return output;
 		}

@@ -601,17 +647,20 @@

 		public function setScale(x : Number, y : Number, z : Number) : Matrix4x4
 		{
-			var components 	: Vector.<Vector3D>	= _matrix.decompose();
-			var scale		: Vector3D			= components[2];
-
-			if (!isNaN(x))
-				scale.x = x;
-			if (!isNaN(y))
-				scale.y = y;
-			if (!isNaN(z))
-				scale.z = z;
-
-			_matrix.recompose(components);
+			if (_invalidComponents)
+				updateComponents();
+
+			_scale.x = x;
+			_scale.y = y;
+			_scale.z = z;
+
+			_scale._vector.setTo(x, y, z);
+
+			_matrix.recompose(new <Vector3D>[
+				_translation._vector,
+				_rotation._vector,
+				_scale._vector
+			]);

 			if (!_locked)
 				_changed.execute(this);
@@ -973,5 +1022,24 @@

 			return this;
 		}
+
+		private function updateComponents(components : uint = 7) : void
+		{
+			if (_invalidComponents & components & COMPONENT_TRANSLATION)
+			{
+				_invalidComponents &= ~COMPONENT_TRANSLATION;
+				getTranslation(_translation);
+			}
+			if (_invalidComponents & components & COMPONENT_ROTATION)
+			{
+				_invalidComponents &= ~COMPONENT_ROTATION;
+				getRotation(_rotation);
+			}
+			if (_invalidComponents & components & COMPONENT_SCALE)
+			{
+				_invalidComponents &= ~COMPONENT_SCALE;
+				getScale(_scale);
+			}
+		}
 	}
 }


fix Matrix4x4.interpolateTo() to scale the result properly (instead of using 1 - scale)

--- src/aerys/minko/type/math/Matrix4x4.as
+++ src/aerys/minko/type/math/Matrix4x4.as
@@ -469,18 +469,18 @@
 		{
 			if (withScale)
 			{
-				var scale	: Vector4	= target.getScale(TMP_VECTOR4);
-				var tx		: Number	= scale.x;
-				var ty		: Number	= scale.y;
-				var tz		: Number	= scale.z;
+				var scale	: Vector4	= getScale(TMP_VECTOR4);
+				var sx		: Number	= scale.x;
+				var sy		: Number	= scale.y;
+				var sz		: Number	= scale.z;

-				scale = getScale(TMP_VECTOR4);
+				scale = target.getScale(TMP_VECTOR4);

 				_matrix.interpolateTo(target._matrix, ratio);
 				_matrix.appendScale(
-					tx + (scale.x - tx) * ratio,
-					ty + (scale.y - ty) * ratio,
-					tz + (scale.z - tz) * ratio
+					sx + (scale.x - sx) * ratio,
+					sy + (scale.y - sy) * ratio,
+					sz + (scale.z - sz) * ratio
 				);
 			}
 			else


added stream time adjustments for better buffering

--- src/flash/htmlelements/VideoElement.as
+++ src/flash/htmlelements/VideoElement.as
@@ -289,7 +289,11 @@

 			// explicitly set the sound since it could have come before the connection was made
 			_soundTransform = new SoundTransform(_volume);
-			_stream.soundTransform = _soundTransform;
+			_stream.soundTransform = _soundTransform;
+
+			// set the buffer to ensure nice playback
+			_stream.bufferTime = 1;
+			_stream.bufferTimeMax = 3;

 			_stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); // same event as connection
 			_stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);


improved error msgs

improved error msgs

--- WeaveData/src/weave/data/AttributeColumns/StreamedGeometryColumn.as
+++ WeaveData/src/weave/data/AttributeColumns/StreamedGeometryColumn.as
@@ -24,6 +24,7 @@
 	import mx.rpc.AsyncToken;
 	import mx.rpc.events.FaultEvent;
 	import mx.rpc.events.ResultEvent;
+	import mx.utils.ObjectUtil;

 	import weave.api.WeaveAPI;
 	import weave.api.core.ICallbackCollection;
@@ -216,7 +217,7 @@
 		{
 			if (event.result == null)
 			{
-				reportNullResult();
+				reportNullResult(ObjectUtil.toString(token));
 				return;
 			}
 			try
@@ -243,9 +244,9 @@
 		}

-		private function reportNullResult():void
-		{
-			reportError("Did not receive any data from service for geometry column: " + ColumnUtils.getTitle(this));
+		private function reportNullResult(token:Object):void
+		{
+			reportError("Did not receive any data from service for geometry column. " + token);
 		}

 		private var _totalDownloadedSize:int = 0;
@@ -256,7 +257,7 @@

 			if (event.result == null)
 			{
-				reportNullResult();
+				reportNullResult(token);
 				return;
 			}

@@ -274,7 +275,7 @@

 			if (event.result == null)
 			{
-				reportNullResult();
+				reportNullResult(token);
 				return;
 			}


now removing hash map entry when column is disposed

Change-Id: I439523c566962097a8f3aee5114688d618b3b3dc

--- WeaveData/src/weave/data/AttributeColumnCache.as
+++ WeaveData/src/weave/data/AttributeColumnCache.as
@@ -24,7 +24,6 @@
 	import weave.api.data.IAttributeColumnCache;
 	import weave.api.data.IColumnReference;
 	import weave.api.data.IDataSource;
-	import weave.core.SessionManager;
 	import weave.data.DataSources.MultiDataSource;
 	import weave.utils.WeakReference;

@@ -53,10 +52,15 @@
 				return MultiDataSource.instance.getAttributeColumn(columnReference);
 			}

-			// Get the column pointer associated with the hash value.
-			var weakRef:WeakReference = _hashToWeakColumnRefMap[columnReference.getHashCode()] as WeakReference;
-			if (weakRef != null && weakRef.value != null && !(WeaveAPI.SessionManager as SessionManager).objectWasDisposed(weakRef.value))
-				return weakRef.value as IAttributeColumn;
+			// Get the column pointer associated with the hash value.
+			var hashCode:String = columnReference.getHashCode();
+			var weakRef:WeakReference = _hashToWeakColumnRefMap[hashCode] as WeakReference;
+			if (weakRef != null && weakRef.value != null)
+			{
+				if (WeaveAPI.SessionManager.objectWasDisposed(weakRef.value))
+					delete _hashToWeakColumnRefMap[hashCode];
+				return weakRef.value as IAttributeColumn;
+			}

 			// If no column is associated with this hash value, request the
 			// column from its data source and save the column pointer.


fix coding style

fix coding style

--- src/aerys/minko/render/shader/Shader.as
+++ src/aerys/minko/render/shader/Shader.as
@@ -192,7 +192,7 @@
 		 */
 		protected function initializeSettings(settings : ShaderSettings) : void
 		{
-//			throw new Error("The method 'initializeSettings' must be implemented.");
+			// nothing
 		}

 		/**


- bugfix: reverted last checkin. Turns out URL#scheme can't be changed that easily

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

--- src/reprise/data/URL.as
+++ src/reprise/data/URL.as
@@ -54,7 +54,7 @@

 		public function scheme() : String
 		{
-			return m_scheme ? m_scheme + '://' : '';
+			return m_scheme ? m_scheme + '://' : null;
 		}

 		public function setScheme(val:String) : void


expose SSSPartPlayer.cellName

expose SSSPartPlayer.cellName

--- src/sssplayer/display/SSSPartPlayer.as
+++ src/sssplayer/display/SSSPartPlayer.as
@@ -51,6 +51,10 @@
 			} else {
 				this.texture = null;
 			}
+		}
+
+		public function get cellName():String {
+			return this._cell ? this._cell.name : null;
 		}

 		private var _texture:Texture;


Bug 698365: uncomment testcase for float4(1,1,1,1) == true

--- test/acceptance/as3/Types/Float4/op_equals.as
+++ test/acceptance/as3/Types/Float4/op_equals.as
@@ -86,9 +86,7 @@
 AddStrictTestCase("2.125 == float4(2.125, 2.125, 2.125, 2.125)", true, 2.125 == float4(2.125, 2.125, 2.125, 2.125));
 AddStrictTestCase("2.125 == float4(2.125, 2.125, 2.125, 2.125) check()", true, check(2.125, float4(2.125, 2.125, 2.125, 2.125)));

-// FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=698365
-// Uncomment the following testcase once the above bug is fixed.
-// AddStrictTestCase("float4(1,1,1,1) == true", true, float4(1,1,1,1) == true);
+AddStrictTestCase("float4(1,1,1,1) == true", true, float4(1,1,1,1) == true);
 AddStrictTestCase("float4(1,1,1,1) == true check()", true, check(float4(1,1,1,1), true));
 var _true = true;
 AddStrictTestCase("float4(1,1,1,1) == _true", true, float4(1,1,1,1) == _true);


fix triangle iterator

fix triangle iterator

--- src/aerys/minko/render/geometry/stream/iterator/TriangleIterator.as
+++ src/aerys/minko/render/geometry/stream/iterator/TriangleIterator.as
@@ -71,9 +71,9 @@
 			if (_singleReference)
 			{
 				_triangle._index = _index;
-				_triangle.v0._index = _ib._data[int(_index * 3)];
-				_triangle.v1._index = _ib._data[int(_index * 3 + 1)];
-				_triangle.v2._index = _ib._data[int(_index * 3 + 2)];
+				_triangle.v0.index = _ib.get(_index * 3);
+				_triangle.v1.index = _ib.get(_index * 3 + 1);
+				_triangle.v2.index = _ib.get(_index * 3 + 2);
 				_triangle._update = TriangleReference.UPDATE_ALL;
 			}


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

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


Issue #89: Preserve image format for non-dynamic layers.

--- src/com/esri/builder/model/ConfigLayer.as
+++ src/com/esri/builder/model/ConfigLayer.as
@@ -277,10 +277,9 @@
         configLayer.autoRefresh = layerXML.@autorefresh || 0;
         var displayLevels:XMLList = layerXML.@displaylevels;
         // TODO - configLayer.displayLevels = displayLevels;
-        if (configLayer.type == DYNAMIC)
-        {
-            configLayer.imageFormat = parseImageFormat(layerXML.@imageformat[0]);
-        }
+        var imageFormat:String = layerXML.@imageformat[0];
+        var isDynamic:Boolean = (configLayer.type == DYNAMIC);
+        configLayer.imageFormat = isDynamic ? parseImageFormat(imageFormat) : imageFormat;
         configLayer.token = layerXML.@token;
         configLayer.url = layerXML.@url;
         const useproxy:String = layerXML.@useproxy;


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

--- frameworks/projects/advancedgrids/src/mx/controls/advancedDataGridClasses/AdvancedDataGridSortItemRenderer.as
+++ frameworks/projects/advancedgrids/src/mx/controls/advancedDataGridClasses/AdvancedDataGridSortItemRenderer.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.controls.advancedDataGridClasses
 {


Refactoring to accomodate the new player and weapon object implementation

--- DroneAnarchy/Resources/Scripts/DroneAnarchy.as
+++ DroneAnarchy/Resources/Scripts/DroneAnarchy.as
@@ -94,14 +94,11 @@
 	playerScoreMessageText_.text = "";
 	optionsInfoText_.text = "";
 	gamePhaseCounter_ = 0.0f;
+	droneSpawnCounter_ = 0.0f;
 	playerScore_ = 0;

-	CreatePlayer();
-
-	//The following two lines come into play when restarting the game
-	healthFillSprite_.imageRect = IntRect(0, 0, 512, 64);
-	UpdateHealthTexture(1);
-
+	SetSoundListener(cameraNode_);
+
 	PlayBackgroundMusic("Resources/Sounds/cyber_dance.ogg");
 	StartCounterToGame();
 }
@@ -136,21 +133,26 @@
 	renderer.viewports[0] = Viewport(scene_, cameraNode_.GetComponent("Camera"));
 }

+
 void SetViewportCamera(Node@ cameraNode)
 {
 	renderer.viewports[0].camera = cameraNode.GetComponent("Camera");
 }
+
 void CreatePlayer()
 {

 	playerNode_ = scene_.CreateChild("PlayerNode");
-	RigidBody@ playerBody  = playerNode_.CreateComponent("RigidBody");
-	playerBody.SetCollisionLayerAndMask(PLAYER_COLLISION_LAYER, DRONE_COLLISION_LAYER);
-	CollisionShape@ playerColShape = playerNode_.CreateComponent("CollisionShape");
-	playerColShape.SetSphere(2);
+	Node@ cameraNode = playerNode_.CreateChild("CameraNode");
+	cameraNode.CreateComponent("Camera");
+	cameraNode.Translate(Vector3(0,1.7,0));
+
+	Node@ lightNode = cameraNode.CreateChild("DirectionalLight");
+    lightNode.direction = Vector3(0.6f, -1.0f, 0.8f);
+    Light@ light = lightNode.CreateComponent("Light");
+    light.lightType = LIGHT_DIRECTIONAL;

 	playerNode_.CreateScriptObject(scriptFile,"PlayerObject");
-
 	playerDestroyed_ = false;

 }
@@ -314,6 +316,8 @@
 	backgroundMusicSource_ = backgroundMusicNode.CreateComponent("SoundSource");
     backgroundMusicSource_.soundType = SOUND_MUSIC;

+}
+
 void SetSoundListener(Node@ listenerNode)
 {
 	if(listenerNode.GetComponent("SoundListener") is null)
@@ -535,15 +539,9 @@
 		return;
 	}

-	int dx = eventData["DX"].GetInt();
-	int dy = eventData["DY"].GetInt();
-
-	float camYaw = cameraNode_.rotation.yaw + (dx * 0.25f);
-	float camPitch = cameraNode_.rotation.pitch + (dy * 0.25f);
-	camPitch = Clamp(camPitch, -20.0f, 70.0f);
-
-	cameraNode_.rotation = Quaternion(camPitch, camYaw, 0.0f);
-	radarScreenBase_.rotation = -cameraNode_.worldRotation.yaw;
+	SendEvent("PlayerMouseMove",eventData);
+
+	radarScreenBase_.rotation = -playerNode_.worldRotation.yaw;
 }

@@ -657,8 +655,30 @@
 	UpdateScoreDisplay();
 }

+void HandlePlayerDestroyed(StringHash eventType, VariantMap& eventData)
+{
+	Vector3 position = eventData["CamPosition"].GetVector3();
+	Quaternion rotation = eventData["CamRotation"].GetQuaternion();
+	cameraNode_.rotation = rotation;
+	cameraNode_.position = position;
+
+	SetViewportCamera(cameraNode_);
+	cameraNode_.GetChild("DirectionalLight").enabled = true;
+
+	SetSoundListener(cameraNode_);
+}
+
 void HandleCountFinished(StringHash eventType, VariantMap& eventData)
 {
+	CreatePlayer();
+	SetViewportCamera(playerNode_.GetChild("CameraNode"));
+
+	cameraNode_.GetChild("DirectionalLight").enabled = false;
+
+	//The following two lines come into play when restarting the game
+	healthFillSprite_.imageRect = IntRect(0, 0, 512, 64);
+	UpdateHealthTexture(1);
+
 	scene_.updateEnabled = true;
 	gameState_ = GS_INGAME;

@@ -672,10 +692,7 @@
 	playerScoreText_.text = playerScore_;
 }

-
-
-
-
+
 void SpawnDrone()
 {
 	Node@ droneNode = scene_.CreateChild();
@@ -745,6 +762,7 @@
 	}
 }

+
 void Fire()
 {
 	SendEvent("ActivateWeapon");


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

--- frameworks/projects/framework/src/mx/styles/metadata/BorderStyles.as
+++ frameworks/projects/framework/src/mx/styles/metadata/BorderStyles.as
@@ -0,0 +1,184 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  Alpha level of the color defined by the backgroundColor
+ *  property, of the image or SWF file defined by the backgroundImage
+ *  style.
+ *  Valid values range from 0.0 to 1.0. For most controls, the default value is 1.0,
+ *  but for ToolTip controls, the default value is 0.95 and for Alert controls, the default value is 0.9.
+ *
+ *  @default 1.0
+ */
+[Style(name="backgroundAlpha", type="Number", inherit="no")]
+
+/**
+ *  Background color of a component.
+ *  You can have both a backgroundColor and a
+ *  backgroundImage set.
+ *  Some components do not have a background.
+ *  The DataGrid control ignores this style.
+ *  The default value is undefined, which means it is not set.
+ *  If both this style and the backgroundImage style
+ *  are undefined, the component has a transparent background.
+ *
+ *
For the Application container, this style specifies the background color
+ *  while the application loads, and a background gradient while it is running.
+ *  Flex calculates the gradient pattern between a color slightly darker than
+ *  the specified color, and a color slightly lighter than the specified color.

+ *
+ *
The default skins of most Flex controls are partially transparent. As a result, the background color of
+ *  a container partially "bleeds through" to controls that are in that container. You can avoid this by setting the
+ *  alpha values of the control's fillAlphas property to 1, as the following example shows:
+ *

+ *  <mx:Container backgroundColor="0x66CC66"/>
+ *      <mx:ControlName ... fillAlphas="[1,1]"/>
+ *  </mx:Container>

+ *

+ */
+[Style(name="backgroundColor", type="uint", format="Color", inherit="no")]
+
+/**
+ *  Background color of the component when it is disabled.
+ *  The global default value is undefined.
+ *  The default value for List controls is 0xDDDDDD (light gray).
+ *  If a container is disabled, the background is dimmed, and the degree of
+ *  dimming is controlled by the disabledOverlayAlpha style.
+ */
+[Style(name="backgroundDisabledColor", type="uint", format="Color", inherit="yes")]
+
+/**
+ *  Background image of a component.  This can be an absolute or relative
+ *  URL or class.  You can either have both a backgroundColor and a
+ *  backgroundImage set at the same time. The background image is displayed
+ *  on top of the background color.
+ *  The default value is undefined, meaning "not set".
+ *  If this style and the backgroundColor style are undefined,
+ *  the component has a transparent background.
+ *
+ *
The default skins of most Flex controls are partially transparent. As a result, the background image of
+ *  a container partially "bleeds through" to controls that are in that container. You can avoid this by setting the
+ *  alpha values of the control's fillAlphas property to 1, as the following example shows:
+ *

+ *  <mx:Container backgroundColor="0x66CC66"/>
+ *      <mx:ControlName ... fillAlphas="[1,1]"/>
+ *  </mx:Container>

+ *

+ */
+[Style(name="backgroundImage", type="Object", format="File", inherit="no")]
+
+/**
+ *  Scales the image specified by backgroundImage
+ *  to different percentage sizes.
+ *  A value of "100%" stretches the image
+ *  to fit the entire component.
+ *  To specify a percentage value, you must include the percent sign (%).
+ *  The default for the Application container is 100%.
+ *  The default value for all other containers is auto, which maintains
+ *  the original size of the image.
+ */
+[Style(name="backgroundSize", type="String", inherit="no")]
+
+/**
+ *  Color of the border.
+ *  The default value depends on the component class;
+ *  if not overridden for the class, the default value is 0xB7BABC.
+ */
+[Style(name="borderColor", type="uint", format="Color", inherit="no")]
+
+/**
+ *  Bounding box sides.
+ *  A space-delimited String that specifies the sides of the border to show.
+ *  The String can contain "left", "top",
+ *  "right", and "bottom" in any order.
+ *  The default value is "left top right bottom",
+ *  which shows all four sides.
+ *
+ *  This style is only used when borderStyle is "solid".
+ */
+[Style(name="borderSides", type="String", inherit="no")]
+
+/**
+ *  The border skin class of the component.
+ *  The mx.skins.halo.HaloBorder class is the default value for all components
+ *  that do not explicitly set their own default.
+ *  The Panel container has a default value of mx.skins.halo.PanelSkin.
+ *  To determine the default value for a component, see the default.css file.
+ *
+ *  @default mx.skins.halo.HaloBorder
+ */
+[Style(name="borderSkin", type="Class", inherit="no")]
+
+/**
+ *  Bounding box style.
+ *  The possible values are "none", "solid",
+ *  "inset", and "outset".
+ *  The default value depends on the component class;
+ *  if not overridden for the class, the default value is "inset".
+ *  The default value for most Containers is "none".
+ */
+[Style(name="borderStyle", type="String", enumeration="inset,outset,solid,none", inherit="no")]
+
+/**
+ *  Bounding box thickness.
+ *  Only used when borderStyle is set to "solid".
+ *
+ *  @default 1
+ */
+[Style(name="borderThickness", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Radius of component corners.
+ *  The default value depends on the component class;
+ *  if not overriden for the class, the default value is 0.
+ *  The default value for ApplicationControlBar is 5.
+ */
+[Style(name="cornerRadius", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Boolean property that specifies whether the component has a visible
+ *  drop shadow.
+ *  This style is used with borderStyle="solid".
+ *  The default value is false.
+ *
+ *
Note: For drop shadows to appear on containers, set
+ *  backgroundColor or backgroundImage properties.
+ *  Otherwise, the shadow appears behind the container because
+ *  the default background of a container is transparent.

+ */
+[Style(name="dropShadowEnabled", type="Boolean", inherit="no")]
+
+/**
+ *  Color of the drop shadow.
+ *
+ *  @default 0x000000
+ */
+[Style(name="dropShadowColor", type="uint", format="Color", inherit="yes")]
+
+/**
+ *  Direction of the drop shadow.
+ *  Possible values are "left", "center",
+ *  and "right".
+ *
+ *  @default "center"
+ */
+[Style(name="shadowDirection", type="String", enumeration="left,center,right", inherit="no")]
+
+/**
+ *  Distance of the drop shadow.
+ *  If the property is set to a negative value, the shadow appears above the component.
+ *
+ *  @default 2
+ */
+[Style(name="shadowDistance", type="Number", format="Length", inherit="no")]
+
+
+


worked on fine-grained security concept

worked on fine-grained security concept

git-svn-id: 27326a786375daad9d33dc990c6f272e4c8f567c@1393 fda5f131-174c-0410-8613-e0905860106b

--- org.openwms/trunk/org.openwms.common/org.openwms.common.flex.lib/src/main/flex/org/openwms/web/flex/client/common/model/CommonModelLocator.as
+++ org.openwms/trunk/org.openwms.common/org.openwms.common.flex.lib/src/main/flex/org/openwms/web/flex/client/common/model/CommonModelLocator.as
@@ -38,64 +38,64 @@
      */
     public class CommonModelLocator {

-        private var registered : Boolean = false;
+        private var registered:Boolean = false;
         // --------------------------------------------------------------------
         // General stuff
         // --------------------------------------------------------------------
         /**
          * Date format including the time.
          */
-        public static const DT_FORMAT_STRING : String = "DD.MM.YYYY HH:NN:SS";
+        public static const DT_FORMAT_STRING:String = "DD.MM.YYYY HH:NN:SS";
         /**
          * Date format without timestamp.
          */
-        public static const SIMPLE_DT_FORMAT : String = "DD.MM.YYYY";
+        public static const SIMPLE_DT_FORMAT:String = "DD.MM.YYYY";
         /**
          * A DateFormatter that uses the DT_FORMAT_STRING.
          */
-        public const dateTimeFormatter : DateFormatter = new DateFormatter();
+        public const dateTimeFormatter:DateFormatter = new DateFormatter();
         /**
          * A DateFormatter that uses the SIMPLE_DT_FORMAT.
          */
-        public const dateFormatter : DateFormatter = new DateFormatter();
+        public const dateFormatter:DateFormatter = new DateFormatter();
         /**
          * Collection of all TransportUnitTypes.
          */
-        public var allTransportUnitTypes : ArrayCollection = new ArrayCollection();
+        public var allTransportUnitTypes:ArrayCollection = new ArrayCollection();
         /**
          * Collection of all TransportUnits.
          */
-        public var allTransportUnits : ArrayCollection = new ArrayCollection();
+        public var allTransportUnits:ArrayCollection = new ArrayCollection();
         /**
          * Collection of all Locations.
          */
-        public var allLocations : ArrayCollection = new ArrayCollection();
+        public var allLocations:ArrayCollection = new ArrayCollection();
         /**
          * Collection of all LocationTypes.
          */
-        public var allLocationTypes : ArrayCollection = new ArrayCollection();
+        public var allLocationTypes:ArrayCollection = new ArrayCollection();
         // --------------------------------------------------------------------
         // LocationGroupView
         // --------------------------------------------------------------------
         /**
          * Collection of all LocationGroups.
          */
-        public var allLocationGroups : ArrayCollection = new ArrayCollection();
+        public var allLocationGroups:ArrayCollection = new ArrayCollection();
         /**
          * Generated Tree of all groups.
          */
-        public var locationGroupTree : TreeNode;
-        public static const WIDTH_LOCATION_GROUP_NAME : Number = 60;
+        public var locationGroupTree:TreeNode;
+        public static const WIDTH_LOCATION_GROUP_NAME:Number = 60;

         // --------------------------------------------------------------------
         // LocationView
         // --------------------------------------------------------------------
-        public static const WIDTH_LOCATION : Number = 80;
+        public static const WIDTH_LOCATION:Number = 80;

         // --------------------------------------------------------------------
         // TransportUnitView
         // --------------------------------------------------------------------
-        public static const WIDTH_BARCODE : Number = 80;
+        public static const WIDTH_BARCODE:Number = 80;

         /**
          * Constructor.
@@ -120,7 +120,7 @@
             registered = true;
         }

-        private function fireEvent(e : Event) : void {
+        private function fireEvent(e:Event):void {
             trace("Fire coll changed event");
             dispatchEvent(new LocationGroupEvent(LocationGroupEvent.COLLECTION_REFRESHED));
         }


Transferred from the Adobe Open Source Subversion Repository

Revision: 9309
Author:   jimurphy@adobe.com
Date:     2009-08-14T12:57:06.648526Z

Log Message:
-----------
Merged 3.x revisions 8758,8762-8763,8765,8844-8845,8906,8970,9030,9049,9055,9096-9097,9191,9208,9221,9228,9242,9278 -> trunk

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/MenuBar.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/formatters/DateBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/ObjectUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/sliderClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/RSLEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Menu.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Text.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/formatters/DateFormatter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/resources/LocaleSorter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/HTTPService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/xml/IXMLSchemaInstance.as</path>

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

--- frameworks/projects/mx/src/mx/controls/Text.as
+++ frameworks/projects/mx/src/mx/controls/Text.as
@@ -39,8 +39,6 @@
 [DefaultBindingProperty(source="text",destination="text")]

 [IconFile("Text.png")]
-
-[Alternative(replacement="spark.primitives.SimpleText", since="4.0")]

 /**
  *  The Text control displays multiline, noneditable text.
@@ -96,7 +94,7 @@
  *           0 pixels.
  *

  *

- *           Maximum size
+ *           ChMaximum sizear03
  *           10000 by 10000 pixels
  *

  *

@@ -118,11 +116,6 @@
  *  @see mx.controls.TextInput
  *  @see mx.controls.TextArea
  *  @see mx.controls.RichTextEditor
- *
- *  @langversion 3.0
- *  @playerversion Flash 9
- *  @playerversion AIR 1.1
- *  @productversion Flex 3
  */
 public class Text extends Label
 {
@@ -169,11 +162,6 @@

     /**
      *  Constructor.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
      */
     public function Text()
     {
@@ -210,25 +198,25 @@
 	//----------------------------------
 	//  explicitWidth
 	//----------------------------------
-
+
     /**
      *  @private
      */
     override public function set explicitWidth(value:Number):void
     {
-        // Due to player bugs relating to scaling text, we
-        // have to be careful to set wordWrap appropriately
-        // (which we do in commitProperties).
-        // Also have to re-measure when width changes, because width
-        // can affect height.
-        if (value != explicitWidth)
-        {
-            widthChanged = true;
-            invalidateProperties();
-            invalidateSize();
-        }
-
-        super.explicitWidth = value;
+    	// Due to player bugs relating to scaling text, we
+    	// have to be careful to set wordWrap appropriately
+    	// (which we do in commitProperties).
+    	// Also have to re-measure when width changes, because width
+    	// can affect height.
+    	if (value != explicitWidth)
+    	{
+    		widthChanged = true;
+   			invalidateProperties();
+    		invalidateSize();
+    	}
+
+    	super.explicitWidth = value;
     }

 	//----------------------------------
@@ -264,19 +252,19 @@
      */
     override public function set percentWidth(value:Number):void
     {
-        // Due to player bugs relating to scaling text, we
-        // have to be careful to set wordWrap appropriately
-        // (which we do in commitProperties).
-        // Also have to re-measure when width changes, because width
-        // can affect height.
-        if (value != percentWidth)
-        {
-            widthChanged = true;
-            invalidateProperties();
-            invalidateSize();
-        }
-
-        super.percentWidth = value;
+    	// Due to player bugs relating to scaling text, we
+    	// have to be careful to set wordWrap appropriately
+    	// (which we do in commitProperties).
+    	// Also have to re-measure when width changes, because width
+    	// can affect height.
+    	if (value != percentWidth)
+    	{
+    		widthChanged = true;
+ 			invalidateProperties();
+    		invalidateSize();
+    	}
+
+    	super.percentWidth = value;
     }

     //--------------------------------------------------------------------------
@@ -373,7 +361,7 @@
             availableWidth = explicitWidth;
         else if (!isNaN(explicitMaxWidth))
             availableWidth = explicitMaxWidth;
-
+
         measureUsingWidth(availableWidth);
     }

@@ -411,7 +399,7 @@
         // Although we also set wordWrap in commitProperties(), we do
         // this here to handle width being set through setActualSize().
         if (Math.floor(width) < Math.floor(measuredWidth))
-            textField.wordWrap =  true;
+			textField.wordWrap = true;
     }

     //--------------------------------------------------------------------------
@@ -489,7 +477,7 @@
         // from the explicit line breaks such as "\n" and "
".
         else
         {
-            var oldWordWrap:Boolean = textField.wordWrap;
+        	var oldWordWrap:Boolean = textField.wordWrap;
             textField.wordWrap = false;

             measuredWidth = Math.ceil(textField.textWidth) +


Haha, there was already one in StringUtil. I was sure I'd checked...

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

--- src/as/com/threerings/util/Util.as
+++ src/as/com/threerings/util/Util.as
@@ -84,19 +84,6 @@
     }

     /**
-     * Compute a hash code for a string. This is pretty expensive, so only compute
-     * it once if that's at all an option. This is the JDK algorithm...
-     */
-    public static function hashCode (str :String) :int
-    {
-        var h :int = 0;
-        for (var i :int = str.length-1; i >= 0; i--) {
-            h = int(int(31*h) + str.charCodeAt(i));
-        }
-        return h;
-    }
-
-    /**
      * If you call a varargs method by passing it an array, the array
      * will end up being arg 1.
      */


Fixed uniqueTypes property to correspond to amount of unique types, not Entity count in total.

--- net/flashpunk/World.as
+++ net/flashpunk/World.as
@@ -660,7 +660,7 @@
 		public function get uniqueTypes():uint
 		{
 			var i:uint = 0;
-			for (var type:String in _typeCount) i += _typeCount[type] as uint;
+			for (var type:String in _typeCount) i ++;
 			return i;
 		}


Bugfix: return undefined, not null, to indicate absence in the map.

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

--- src/as/com/threerings/util/Hashtable.as
+++ src/as/com/threerings/util/Hashtable.as
@@ -78,7 +78,7 @@
         var e :Entry = (_entries[index] as Entry);
         while (true) {
             if (e == null) {
-                return null;
+                return undefined;
             }
             if (e.hash == hash && e.key.equals(hkey)) {
                 return e.value;


Fixed bug in Mediator eventMap lazy getter. Added unit test already.

--- src/org/robotlegs/mvcs/Mediator.as
+++ src/org/robotlegs/mvcs/Mediator.as
@@ -72,7 +72,7 @@

 		protected function get eventMap():IEventMap
 		{
-			return _eventMap || new EventMap(eventDispatcher);
+			return _eventMap || (_eventMap = new EventMap(eventDispatcher));
 		}
 	}
-}+}


kill old file

kill old file

--- src/org/mediabrainz/monkeyvision/ImageList.as
+++ src/org/mediabrainz/monkeyvision/ImageList.as
@@ -1,8 +0,0 @@
-package org.mediabrainz.monkeyvision {
-
-	public class ImageList {
-
-		public function ImageList() {
-		}
-	}
-}


Transferred from the Adobe Open Source Subversion Repository

Revision: 17353
Author:   gruehle@adobe.com
Date:     2010-08-17T18:32:15.840735Z

Log Message:
-----------
Make sure we don't pass null to TextField.text.

QE notes:  None
Doc notes: None
Bugs: SDK-27459
Reviewer: Evtim
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/MobileTextField.as

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

--- frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableTextField.as
+++ frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableTextField.as
@@ -124,6 +124,10 @@

     override public function set text(value:String):void
     {
+        // TextField's text property can't be set to null.
+        if (!value)
+            value = "";
+
         super.text = value;
         _isTruncated = false;
         dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));


Transferred from the Adobe Open Source Subversion Repository

Revision: 12850
Author:   jimurphy@adobe.com
Date:     2009-12-11T14:57:14.623098Z

Log Message:
-----------
add 6 new DMV projects to the SDK:
automation
automation_air
automation_dmv
automation_flashflexkit
automation_spark
datavisualization

These projects are setup to build in an ant main call.  There are currently several warnings in the datavisualization project that will be cleaned up.  No checkintests exist for these projects as of yet.

I also modified the exisitng projects build files for easier management of the localization targets, bundle and fat-swc. If the projects that I updated:airframework,airspark,framework,playerglobal,rpc,and spark.  All the new projects have been implemented this same way.

QE notes: DMV folks should run through their tests
Doc notes: probably
Bugs: nope
Reviewer:
Tests run: ran the following targets: compile,checkintests,other.locales and doc
Is noteworthy for integration: no

Modified Paths:
--------------
1404 paths were modified

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

--- frameworks/projects/automation/src/mx/automation/delegates/controls/ProgressBarAutomationImpl.as
+++ frameworks/projects/automation/src/mx/automation/delegates/controls/ProgressBarAutomationImpl.as
@@ -0,0 +1,115 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.automation.delegates.controls
+{
+	import flash.display.DisplayObject;
+
+	import mx.automation.Automation;
+	import mx.automation.IAutomationObject;
+	import mx.automation.delegates.core.UIComponentAutomationImpl;
+	import mx.controls.ProgressBar;
+	import mx.core.mx_internal;
+
+	use namespace mx_internal;
+
+	[Mixin]
+	/**
+	 *
+	 *  Defines methods and properties required to perform instrumentation for the
+	 *  ProgressBar control.
+	 *
+	 *  @see mx.controls.ProgressBar
+	 *
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public class ProgressBarAutomationImpl extends UIComponentAutomationImpl
+	{
+		include "../../../core/Version.as";
+
+		//--------------------------------------------------------------------------
+		//
+		//  Class methods
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Registers the delegate class for a component class with automation manager.
+		 *
+		 *  @param root The SystemManger of the application.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public static function init(root:DisplayObject):void
+		{
+			Automation.registerDelegateClass(ProgressBar, ProgressBarAutomationImpl);
+		}
+
+		//--------------------------------------------------------------------------
+		//
+		//  Constructor
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Constructor.
+		 * @param obj ProgressBar object to be automated.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public function ProgressBarAutomationImpl(obj:ProgressBar)
+		{
+			super(obj);
+			recordClick = true;
+		}
+
+		/**
+		 *  @private
+		 *  storage for the owner component
+		 */
+		protected function get  progressBar():ProgressBar
+		{
+			return uiComponent as ProgressBar;
+		}
+
+		//----------------------------------
+		//  automationName
+		//----------------------------------
+
+		/**
+		 *  @private
+		 */
+		override public function get automationName():String
+		{
+			return progressBar.label || progressBar.toolTip || super.automationName;
+		}
+
+		/**
+		 *  @private
+		 */
+		override public function get automationValue():Array
+		{
+			return [ progressBar.label || progressBar.toolTip ];
+		}
+
+	}
+
+}


Increase version

Increase version

--- src/org/openvv/OVVAsset.as
+++ src/org/openvv/OVVAsset.as
@@ -102,7 +102,7 @@
          * Hold OVV version. Will past to JavaScript as well $ovv.version
          */

-        public static const RELEASE_VERSION: String = "2.5.2";
+        public static const RELEASE_VERSION: String = "2.5.3";

         ////////////////////////////////////////////////////////////


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

--- frameworks/projects/framework/src/mx/graphics/RadialGradientStroke.as
+++ frameworks/projects/framework/src/mx/graphics/RadialGradientStroke.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2008 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: 4060
Author:   egeorgie@adobe.com
Date:     2008-11-10T20:04:18.301112Z

Log Message:
-----------
Fix bug http://bugs.adobe.com/jira/browse/SDK-17266 Scaling Gumbo Button causes corners to be rounded instead of sharp

The fix is to update the skin stroke to scale.

QE Notes: None
Doc Notes: None
Bugs: SDK-16487 FLEXDOCS-533
Reviewer: Glenn
tests: checkintests, Mustella (Button)

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxTextInputSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxScrollBarDownButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/SolidColorStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxVSliderThumbSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxSpinnerDecrButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/RadialGradientStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxVScrollBarThumbSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxListSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxScrollBarRightButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxTextAreaSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxToggleButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/Stroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxHScrollBarTrackSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxScrollBarUpButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxSpinnerIncrButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxCheckBoxSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/LinearGradientStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxScrollBarLeftButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxRadioButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxHSliderThumbSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxHScrollBarThumbSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/GradientStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxVScrollBarTrackSkin.mxml</path>

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

--- frameworks/projects/framework/src/mx/graphics/RadialGradientStroke.as
+++ frameworks/projects/framework/src/mx/graphics/RadialGradientStroke.as
@@ -43,7 +43,7 @@
      *  LineScaleMode.NONE, LineScaleMode.NORMAL,
      *  and LineScaleMode.VERTICAL.
      *  This parameter is optional,
-     *  with a default value of LineScaleMode.NONE.
+     *  with a default value of LineScaleMode.NORMAL.
      *
      *  @param caps A value from the CapsStyle class
      *  that specifies the type of caps at the end of lines.
@@ -77,7 +77,12 @@
      *  This parameter is optional,
      *  with a default value of 0.
      */
-    public function RadialGradientStroke(weight:Number=0, pixelHinting:Boolean=false, scaleMode:String="none", caps:String=null, joints:String=null, miterLimit:Number=0)
+    public function RadialGradientStroke(weight:Number = 0,
+                                         pixelHinting:Boolean = false,
+                                         scaleMode:String = "normal",
+                                         caps:String = null,
+                                         joints:String = null,
+                                         miterLimit:Number = 0)
     {
         super(weight, pixelHinting, scaleMode, caps, joints, miterLimit);
     }


FLEX-25045 getString now returns null as expected if supplied a valid locale but not a valid resourceName

--- frameworks/projects/framework/src/mx/resources/ResourceManagerImpl.as
+++ frameworks/projects/framework/src/mx/resources/ResourceManagerImpl.as
@@ -940,6 +940,9 @@
             findBundle(bundleName, resourceName, locale);
         if (!resourceBundle)
             return null;
+
+        if(!(resourceName in resourceBundle.content))
+            return null;

         var value:String = String(resourceBundle.content[resourceName]);


Transferred from the Adobe Open Source Subversion Repository

Revision: 22724
Author:   jasonsj@adobe.com
Date:     2011-09-23T22:50:49.329435Z

Log Message:
-----------
Fix CalloutSkin measuredMinWidth and measuredMinHeight.
Delay soft keyboard deactivate effect until timeout or mouseUp event.
Improve effect frame rate by using ViewTransition techniques. Delay animation by a frame, use Animation.pulse() before playing the effect.

QE notes: Manual tests may be required for SDK-31534. Need new mustella tests for minimum height w/ Callout (explicit or implicit from content) and SK effects. Frame rate tests for SK effects should be around 16-24fps on iPad and Xoom. Frame count at the default 150ms is around 4 total frames.
Doc notes:
Bugs:
SDK-31528 Callout minimum height is not respected, original height not correctly restored
SDK-31534 Android:SkinnablePopUpContainer does not close if Text is in focus
SDK-31461 SkinnablePopUpContainer "jumps up" several times during resize when softKeyboard is opened
Reviewer: tkraikit
Tests run: checkintests, mustella-mobile
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/SkinnablePopUpContainer.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutSkin.as
@@ -394,11 +394,6 @@
         var borderWeight:Number = isNaN(borderThickness) ? 0 : borderThickness;
         var frameAdjustment:Number = (frameThickness + borderWeight) * 2;

-        var backgroundWidth:Number = contentGroup.getPreferredBoundsWidth()
-            + frameAdjustment;
-        var backgroundHeight:Number = contentGroup.getPreferredBoundsHeight()
-            + frameAdjustment;
-
         var arrowMeasuredWidth:Number;
         var arrowMeasuredHeight:Number;

@@ -414,18 +409,27 @@
             arrowMeasuredHeight = arrowHeight;
         }

-        measuredMinWidth = Math.max(arrowMeasuredWidth, contentGroup.measuredMinWidth);
-        measuredMinHeight = Math.max(arrowMeasuredHeight, contentGroup.measuredMinHeight);
-        measuredWidth = backgroundWidth;
-        measuredHeight = backgroundHeight;
-
+        // count the contentGroup size and frame size
+        measuredMinWidth = contentGroup.measuredMinWidth + frameAdjustment;
+        measuredMinHeight = contentGroup.measuredMinHeight + frameAdjustment;
+
+        measuredWidth = contentGroup.getPreferredBoundsWidth() + frameAdjustment;
+        measuredHeight = contentGroup.getPreferredBoundsHeight() + frameAdjustment;
+
+        // add the arrow size based on the arrowDirection
         if (isArrowHorizontal)
         {
+            measuredMinWidth += arrowMeasuredWidth;
+            measuredMinHeight = Math.max(measuredMinHeight, arrowMeasuredHeight);
+
             measuredWidth += arrowMeasuredWidth;
             measuredHeight = Math.max(measuredHeight, arrowMeasuredHeight);
         }
         else if (isArrowVertical)
         {
+            measuredMinWidth += Math.max(measuredMinWidth, arrowMeasuredWidth);
+            measuredMinHeight += arrowMeasuredHeight;
+
             measuredWidth = Math.max(measuredWidth, arrowMeasuredWidth);
             measuredHeight += arrowMeasuredHeight;
         }


OFC-528 User with role DATA_ENTRY can edit records in phase 2 and 3. He can even reject the record\!\!\!

--- collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/presenter/MasterPresenter.as
+++ collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/presenter/MasterPresenter.as
@@ -13,6 +13,7 @@
 	import org.openforis.collect.event.ApplicationEvent;
 	import org.openforis.collect.event.UIEvent;
 	import org.openforis.collect.metamodel.proxy.EntityDefinitionProxy;
+	import org.openforis.collect.model.CollectRecord$Step;
 	import org.openforis.collect.model.proxy.RecordProxy;
 	import org.openforis.collect.model.proxy.UserProxy;
 	import org.openforis.collect.ui.view.MasterView;
@@ -78,6 +79,24 @@

 		protected function setActiveRecord(record:RecordProxy):void {
 			Application.activeRecord = record;
+			var user:UserProxy = Application.user;
+			var step:CollectRecord$Step = record.step;
+			var editable:Boolean = false;
+			switch ( step ) {
+				case CollectRecord$Step.ENTRY:
+					editable = user.hasRole(UserProxy.ROLE_ENTRY) ||
+						user.hasRole(UserProxy.ROLE_CLEANSING) ||
+						user.hasRole(UserProxy.ROLE_ADMIN);
+					break;
+				case CollectRecord$Step.CLEANSING:
+					editable = user.hasRole(UserProxy.ROLE_CLEANSING) ||
+						user.hasRole(UserProxy.ROLE_ADMIN);
+					break;
+				case CollectRecord$Step.ANALYSIS:
+					editable = false
+					break;
+			}
+			Application.activeRecordEditable = editable;
 			_view.currentState = MasterView.DETAIL_STATE;

 			var uiEvent:UIEvent = new UIEvent(UIEvent.ACTIVE_RECORD_CHANGED);


googleAnalytics: fix exception on adEnd adStart notifications

--- plugins/googleAnalyticsPlugin/src/com/kaltura/kdpfl/plugin/googleAnalytics/GAStatisticsMediator.as
+++ plugins/googleAnalyticsPlugin/src/com/kaltura/kdpfl/plugin/googleAnalytics/GAStatisticsMediator.as
@@ -294,12 +294,12 @@
 					break;
 				case "adStart":
 					_isInAd		= true;
-					if((viewComponent as googleAnalyticsPlugin).customEvents.indexOf("adStart") == -1)
+					if(!_plugin.customEvents || _plugin.customEvents.indexOf("adStart") == -1)
 						shouldPublish	= false;
 					break;
 				case "adEnd":
 					_isInAd		= false;
-					if((viewComponent as googleAnalyticsPlugin).customEvents.indexOf("adEnd") == -1)
+					if(!_plugin.customEvents || _plugin.customEvents.indexOf("adEnd") == -1)
 						shouldPublish	= false;
 					break;
 				case "playerSeekEnd":


Transferred from the Adobe Open Source Subversion Repository

Revision: 21263
Author:   eday@adobe.com
Date:     2011-05-16T18:10:55.738145Z

Log Message:
-----------
Adjust tight StyleableTextField layout bounds in order to avoid clipping.

(This is the second checkin with this fix.  The previous one was reverted)

QE notes: none
Doc notes: none
Bugs: SDK-30435
Reviewer: Glenn
Tests run: Cyclone, checkintests
Is noteworthy for integration: no

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

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

--- frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableTextField.as
+++ frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableTextField.as
@@ -1444,7 +1444,7 @@
         if (useTightTextBounds)
         {
             // return the text field width without the left and right gutters
-            return width - StyleableTextField.TEXT_WIDTH_PADDING;
+            return width - StyleableTextField.TEXT_GUTTER * 2;
         }
         else
         {
@@ -1561,7 +1561,7 @@
         if (useTightTextBounds)
         {
             // The measuredTextSize without the left and right gutters
-            return measuredTextSize.x - StyleableTextField.TEXT_WIDTH_PADDING;
+            return measuredTextSize.x - StyleableTextField.TEXT_GUTTER * 2;
         }
         else
         {


Transferred from the Adobe Open Source Subversion Repository

Revision: 21244
Author:   eday@adobe.com
Date:     2011-05-12T22:42:06.928809Z

Log Message:
-----------
Reverted change from 21242.  It was checked in prematurely due to a miscommunication.

QE notes: none
Doc notes: none
Bugs: SDK-30435
Reviewer:
Tests run:
Is noteworthy for integration: no

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

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

--- frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableTextField.as
+++ frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableTextField.as
@@ -1444,7 +1444,7 @@
         if (useTightTextBounds)
         {
             // return the text field width without the left and right gutters
-            return width - StyleableTextField.TEXT_GUTTER * 2;
+            return width - StyleableTextField.TEXT_WIDTH_PADDING;
         }
         else
         {
@@ -1561,7 +1561,7 @@
         if (useTightTextBounds)
         {
             // The measuredTextSize without the left and right gutters
-            return measuredTextSize.x - StyleableTextField.TEXT_GUTTER * 2;
+            return measuredTextSize.x - StyleableTextField.TEXT_WIDTH_PADDING;
         }
         else
         {