only 2 buttons

only 2 buttons

git-svn-id: f772d44cbf86d9968f12179c1556189f5afcea6e@691 e0ac87d7-b42b-0410-9034-8248a05cb448

--- braineditor/Scroll.as
+++ braineditor/Scroll.as
@@ -4,13 +4,14 @@
 import Point;
 import ScrollControl;

-class Scroll extends ScrollControl {
-    var push_up : ScrollControl;
-    var push_down : ScrollControl;
+class Scroll extends Sprite {
+    var push_up : AbstractButton;
+    var push_down : AbstractButton;
     function Scroll(parent:MovieClip, lowerLeft:Point, upperRight:Point) {
-        super(parent,lowerLeft,upperRight)
-    	push_up = new ScrollControl(mSurface,lowerLeft,upperRight);
-    	push_down = new ScrollControl(mSurface,lowerLeft.addVector(new Point(0,80)),upperRight.addVector(new Point(0,80)));
+        super(parent)
+    	push_up = new AbstractButton(mSurface,lowerLeft,upperRight,1,0x007f7f,0x7f7f00,"upArrow.png");
+    	push_down = new AbstractButton(mSurface,lowerLeft.addVector(new Point(0,80)),upperRight.addVector(new Point(0,80)),1,0x007f7f,0x7f7f00,"downArrow.png");
+
     }

 }


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/RemarksPopUpPresenter.as
+++ collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/presenter/RemarksPopUpPresenter.as
@@ -87,7 +87,7 @@
 			if(firstOpen) {
 				view = new RemarksPopUp();
 			}
-			view.editable = Application.activeRecord.step != CollectRecord$Step.ANALYSIS;
+			view.editable = Application.activeRecordEditable;
 			_inputField = inputField;

 			if(! popUpOpened) {


Transferred from the Adobe Open Source Subversion Repository

Revision: 6599
Author:   gosmith@adobe.com
Date:     2009-05-04T20:27:40.909741Z

Log Message:
-----------
RichEditableText and RichEditableText2 are now in the spark.primitives package rather than in spark.components, and RichEditableTextContainerManager is now in spark.primitives.supportClasses rather than in spark.components.supportClasses. This change means that SimpleText, RichText, and RichEditableText are now all together in spark.primitives. They are "primitives" because they aren't skinnable components, even though some extend GraphicElement and some extend UIComponent.

QE Notes: None
Doc Notes: None
Bugs: None
Reviewer: Carol

Modified Paths:
--------------
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/RichEditableText.png</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/RichEditableText2.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/RichEditableText.as" copyfrom-rev="6590" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/spark-manifest.xml</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/RichEditableText.png" copyfrom-rev="6589" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichEditableText.png</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/RichEditableTextContainerManager.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/RichEditableText2.as" copyfrom-rev="6589" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichEditableText2.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/RichEditableTextContainerManager.as" copyfrom-rev="6589" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/RichEditableTextContainerManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextInput.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/RichEditableText.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
@@ -26,8 +26,8 @@

 import spark.components.supportClasses.SkinnableComponent;
 import spark.components.TextSelectionVisibility;
-import spark.components.RichEditableText;
 import spark.events.TextOperationEvent;
+import spark.primitives.RichEditableText;
 import spark.utils.MouseShieldUtil;

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 17366
Author:   rfrishbe@adobe.com
Date:     2010-08-18T20:55:44.548390Z

Log Message:
-----------
Adding touchDelay and minimumDownState styles to Button.

In addition, there are some other PARB changes (touchScroll is renamed to more generic gestureCapture).  This means TouchScrollEvent has been renamed to GestureCaptureEvent as well.

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

Modified Paths:
--------------
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/TouchScrollEvent.as" copyfrom-rev="17335" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/GestureCaptureEvent.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/styles/metadata/MobileTextFieldTextStyles.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/tools/dependencychecker/flex/tools/dependencychecker/FrameworkSwcDependencyRules.java</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/FrameworkClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileIconItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/TouchScrollEvent.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
@@ -27,8 +27,8 @@
 import mx.core.IVisualElement;
 import mx.core.mx_internal;
 import mx.events.FlexEvent;
+import mx.events.GestureCaptureEvent;
 import mx.events.SandboxMouseEvent;
-import mx.events.TouchScrollEvent;
 import mx.managers.IFocusManagerComponent;
 import mx.utils.BitFlagUtil;

@@ -1173,7 +1173,7 @@
      */
     private function addHandlers():void
     {
-        addEventListener(TouchScrollEvent.TOUCH_SCROLL_STARTING, touchScrollStartingHandler);
+        addEventListener(GestureCaptureEvent.GESTURE_CAPTURE_STARTING, gestureCaptureStartingHandler);
     }

     /**
@@ -1730,7 +1730,7 @@
     /**
      *  @private
      */
-    private function touchScrollStartingHandler(event:TouchScrollEvent):void
+    private function gestureCaptureStartingHandler(event:GestureCaptureEvent):void
     {
         // This implementation prevents the scroll from happening, which means
         // the gesture will be interpreted by the text (ie selection).


Moved while loop into iterative task function.

--- WeaveUI/src/weave/utils/SpatialIndex.as
+++ WeaveUI/src/weave/utils/SpatialIndex.as
@@ -60,6 +60,8 @@

 		private var _queryMissingBounds:Boolean; // used by _insertNext
 		private var _keysArrayIndex:int; // used by _insertNext
+		private var _keysIndex:int; // used by _insertNext
+		private var _plotter:IPlotter;//used by _insertNext
 		private var _boundsArrayIndex:int; // used by _insertNext
 		private var _boundsArray:Array; // used by _insertNext

@@ -142,27 +144,14 @@

 			_keysArray.length = 0; // hack to prevent callbacks
 			clear();
-
+			_plotter = plotter;
+
 			if (plotter != null)
 			{
 				collectiveBounds.copyFrom(plotter.getBackgroundDataBounds());

 				// make a copy of the keys vector
-				VectorUtils.copy(plotter.keySet.keys, _keysArray);
-
-				// save dataBounds for each key
-				i = _keysArray.length;
-				while (--i > -1)
-				{
-					key = _keysArray[i] as IQualifiedKey;
-					_keyToBoundsMap[key] = plotter.getDataBoundsFromRecordKey(key);
-
-					if (_keyToGeometriesMap != null)
-					{
-						var geoms:Array = ((plotter as DynamicPlotter).internalObject as IPlotterWithGeometries).getGeometriesFromRecordKey(key);
-						_keyToGeometriesMap[key] = geoms;
-					}
-				}
+				VectorUtils.copy(plotter.keySet.keys, _keysArray);
 			}

 			// if auto-balance is disabled, randomize insertion order
@@ -179,13 +168,29 @@

 		private function _insertNext():Number
 		{
-			if (_keysArrayIndex >= _keysArray.length) // in case length is zero
+			if (_keysArrayIndex  >= _keysArray.length && _keysIndex >= _keysArray.length) // in case length is zero
 			{
 				triggerCallbacks();
 				return 1; // done
 			}

-			var key:IQualifiedKey = _keysArray[_keysArrayIndex] as IQualifiedKey;
+			var key:IQualifiedKey;
+
+			if (_keysIndex < _keysArray.length)
+			{
+				key = _keysArray[_keysIndex] as IQualifiedKey;
+				_keyToBoundsMap[key] = _plotter.getDataBoundsFromRecordKey(key);
+
+				if (_keyToGeometriesMap != null)
+				{
+					var geoms:Array = ((_plotter as DynamicPlotter).internalObject as IPlotterWithGeometries).getGeometriesFromRecordKey(key);
+					_keyToGeometriesMap[key] = geoms;
+				}
+				_keysIndex++;
+				return 0;
+			}
+
+			key = _keysArray[_keysArrayIndex] as IQualifiedKey;
 			if (!_boundsArray) // is there an existing nested array?
 			{
 				//trace(key.keyType,key.localName,'(',_keysArrayIndex,'/',_keysArray.length,')');
@@ -232,7 +237,8 @@
 				triggerCallbacks();

 			_boundsArray = null;
-			_keysArrayIndex = 0;
+			_keysArrayIndex = 0;
+			_keysIndex = 0;
 			_keysArray.length = 0;
 			_kdTree.clear();
 			collectiveBounds.reset();


fix get TextureAtlas width bug

fix get TextureAtlas width bug

--- src/utils/TextureUtil.as
+++ src/utils/TextureUtil.as
@@ -24,11 +24,14 @@
 			}

 			var dimensions:uint = 0;
+			var maxWidth:Number = 0;
 			var rectList:Vector.<Rectangle> = new Vector.<Rectangle>;
 			for each(rect in rectMap)
 			{
 				dimensions += rect.width * rect.height;
 				rectList.push(rect);
+
+				maxWidth = Math.max(rect.width, maxWidth);
 			}
 			//sort texture by size
 			rectList.sort(sortRectList);
@@ -39,7 +42,7 @@
 				widthDefault = Math.sqrt(dimensions);
 			}

-			widthDefault = getNearest2N(Math.max(int(rectList[0].width) + padding, widthDefault));
+			widthDefault = getNearest2N(Math.max(maxWidth + padding, widthDefault));

 			var heightMax:uint = HIGHEST;
 			var remainAreaList:Vector.<Rectangle> = new Vector.<Rectangle>;


display list compare should ignore line endings

git-svn-id: f8d5f742b420a6a114b58659a4f85f335318e53c@1435020 13f79535-47bb-0310-9956-ffa450edef68

--- mustella/as3/src/mustella/CompareBitmap.as
+++ mustella/as3/src/mustella/CompareBitmap.as
@@ -18,17 +18,29 @@
 ////////////////////////////////////////////////////////////////////////////////
 package  {

+import flash.display.BitmapData;
+import flash.display.DisplayObject;
+import flash.display.DisplayObjectContainer;
 import flash.display.IBitmapDrawable;
-import flash.utils.*;
-import flash.net.*;
-import flash.events.*;
-import flash.display.*;
-import flash.text.*;
-import flash.text.engine.*;
+import flash.display.Loader;
+import flash.events.Event;
+import flash.events.IOErrorEvent;
+import flash.events.SecurityErrorEvent;
+import flash.events.StatusEvent;
 import flash.geom.ColorTransform;
 import flash.geom.Matrix;
 import flash.geom.Point;
 import flash.geom.Rectangle;
+import flash.net.LocalConnection;
+import flash.net.URLLoader;
+import flash.net.URLRequest;
+import flash.text.TextField;
+import flash.text.engine.ContentElement;
+import flash.text.engine.TextBlock;
+import flash.text.engine.TextLine;
+import flash.utils.ByteArray;
+import flash.utils.getQualifiedClassName;
+
 import mx.core.IChildList;
 import mx.core.IRawChildrenContainer;
 import mx.core.mx_internal;
@@ -440,8 +452,13 @@
 	{
 		var actualTarget:DisplayObject = DisplayObject(context.stringToObject(target));
 		var s:String = getDisplayListXML(actualTarget).toXMLString();
-		if (s !== xmlreader.data)
-		{
+		var t:String = xmlreader.data;
+		s = s.replace(/\r/g, "");
+		t = t.replace(/\r/g, "");
+		if (s !== t)
+		{
+			differ(s, t);
+
 			testResult.doFail ("compare returned" + compareVal, absolutePathResult(url) + ".bad.png");

 			if (useRemoteDiffer)
@@ -1179,8 +1196,8 @@
 	// scan entire display list, but only dump objects intersecting target
 	protected function getDisplayListXML(target:DisplayObject):XML
 	{
+		var i:int;
 		var n:int;
-		var i:int;
 		var child:DisplayObject;
 		var childXML:XML;

@@ -1215,6 +1232,34 @@
 		}
 		return xml;
 	}
+
+	private function differ(s:String, t:String):void
+	{
+		var sl:Array = s.split("\n");
+		var tl:Array = t.split("\n");
+		trace(sl.length, tl.length);
+		var n:int = Math.max(sl.length, tl.length);
+		for (var i:int = 0; i < n; i++)
+		{
+			var a:String = (i < sl.length) ? sl[i] : "";
+			var b:String = (i < tl.length) ? tl[i] : "";
+			if (a != b)
+			{
+				var c:String = "";
+				var d:String = "";
+				trace(i, "cur: ", a);
+				trace(i, "xml: ", b);
+				var m:int = Math.max(a.length, b.length);
+				for (var j:int = 0; j < m; j++)
+				{
+					c += a.charCodeAt(j) + " ";
+					d += b.charCodeAt(j) + " ";
+				}
+				trace(i, "cur: ", c);
+				trace(i, "xml: ", d);
+			}
+		}
+	}
 }

 }


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

--- frameworks/projects/automation/src/mx/automation/codec/ScrollDetailPropertyCodec.as
+++ frameworks/projects/automation/src/mx/automation/codec/ScrollDetailPropertyCodec.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.
 //
 ////////////////////////////////////////////////////////////////////////////////


FLEX-34088 The fix for this bug became superfluous when the fix for FLEX-34078 was implemented, which also catered to this bug. So it can be safely removed (and should, because it causes other bugs - see the ticket).

--- frameworks/projects/spark/src/spark/components/supportClasses/DropDownController.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/DropDownController.as
@@ -607,14 +607,6 @@
             if (openButton && target && openButton.contains(target))
                 return;

-			// don't close if something just been selected in a DropDownList
-			if (target is IUIComponent)
-			{
-                var document:Object = (target as IUIComponent).document;
-                if (("hostComponent" in document) && document.hostComponent is DropDownList)
-			        return;
-            }
-
             if (hitAreaAdditions != null)
             {
 				var length:int = hitAreaAdditions.length;


Transferred from the Adobe Open Source Subversion Repository

Revision: 7967
Author:   gosmith@adobe.com
Date:     2009-06-18T19:44:16.674676Z

Log Message:
-----------
PARB changes to TextGraphicElement/SimpleText/RichText and to text styles in general.

TextGraphicElement:

The 'truncation' property has been renamed to 'maxDisplayedLines'.

The isTruncated() method has become an 'isTruncated' read-only property.

RichText:

Since a TextFlow object is the fundamental representation for rich test in TLF, the RichText component now has a public textFlow:TextFlow property which you can get or set. To turn TLF markup -- in either String or XML form -- into a TextFlow, use the static importFromString() and importFromXML() methods in the TextFlowUtil class. These are bindable methods so that if the markup parameter changes they will re-evaluate. To turn the TextFlow back into markup, use TextFLowUtil.export(...) to produce XML.

The 'content' property is now intended only for use by the MXML compiler. It is set-only and only supports being set to what MXML markup produces: a String (which will be treated as the text of an implicit span in an implicit paragraph), a FlowElement, or an Array of Strings and FlowElements.

The 'text', 'textFlow', and 'content' properties are interacting properties. For example, you can set 'textFlow' and then get the 'text', and vice versa. In fact, you can now do this immediately, without waiting for the component to undergo a LayoutManager pass. Of these three properties, the last one set in ActionScript wins; if more than one is set in MXML the results are undefined since MXML does not guarantee the order in which properties are set. Setting any of them to null is equivalent to setting the 'text' to the empty String, which is the initial state of the component.

Styles:

The 'lineBreak' style is now non-inheriting, since in TLF it doesn't inherit from FlowElement to FlowElement.

The text styles are now divided into five buckets:

BasicInheritingTextStyles.as
BasicNonInheritingTextStyles.as
AdvancedInheritingTextStyles.as
AdvancedNonInheritingTextStyles.as
SelectionFormatTextStyles.as

Skinnable components like TextInput and TextArea no longer declare any on the noninheriting text styles, because the RichTextElement in the skin doesn't inherit them. You must set them directly on the RichTextElement in the component's skin, either with ActionScript or by reskinning.

The styleInitialized() method has been added to the IAdvancedStyleClient interface.

QE Notes: None
Doc Notes: None
Bugs: None
Reviewer: Carol

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/ButtonBarFirstButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/ButtonBarFirstButtonSkin.mxml</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/BasicTextLayoutFormatStyles.as" copyfrom-rev="7910" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/BasicInheritingTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/spark/skins/spark/SparkChromeWindowedApplicationSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/TextGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/spark/skins/spark/WindowedApplicationSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/DefaultButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/ButtonBarLastButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/ButtonBarLastButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/DefaultButtonSkin.mxml</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/AdvancedTextLayoutFormatStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProxy.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/BasicTextLayoutFormatStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VideoPlayer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/utils/TextFlowUtil.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/AdvancedNonInheritingTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/ButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/ButtonBarMiddleButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/ButtonBarMiddleButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/ButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/ToggleButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/ToggleButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/SkinnableTextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableDataContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/spark/skins/spark/windowChrome/TitleBarSkin.mxml</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/NonInheritingTextLayoutFormatStyles.as" copyfrom-rev="7910" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/BasicNonInheritingTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/SimpleText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/CheckBoxSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/CheckBoxSkin.mxml</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/NonInheritingTextLayoutFormatStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/RadioButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/IAdvancedStyleClient.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/RadioButtonSkin.mxml</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/AdvancedTextLayoutFormatStyles.as" copyfrom-rev="7910" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/AdvancedInheritingTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/spark/skins/spark/windowChrome/MacTitleBarSkin.mxml</path>

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

--- frameworks/projects/spark/src/spark/styles/metadata/BasicNonInheritingTextStyles.as
+++ frameworks/projects/spark/src/spark/styles/metadata/BasicNonInheritingTextStyles.as
@@ -8,6 +8,16 @@
 //  in accordance with the terms of the license agreement accompanying it.
 //
 ////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  @copy flashx.textLayout.formats.ITextLayoutFormat#lineBreak
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[Style(name="lineBreak", type="String", enumeration="toFit,explicit", inherit="yes")]

 /**
  *  @copy flashx.textLayout.formats.ITextLayoutFormat#paddingBottom


updateStage was undefined

updateStage was undefined

--- src/flash/display/Stage.as
+++ src/flash/display/Stage.as
@@ -319,7 +319,7 @@
 			}

 			//http://codetheory.in/controlling-the-frame-rate-with-requestanimationframe/
-			/*requestAnimationFrameHander = */SpriteFlexjs.requestAnimationFrame.call(window, updateStage);
+			/*requestAnimationFrameHander = */SpriteFlexjs.requestAnimationFrame.call(window, _updateStage);
 			//var now:Number = getTimer();
 			//var interval:Number = Math.ceil(1000/frameRate);
 			//var delta:Number = now - lastUpdateTime;


fix Matrix4x4.interpolateTo() to interpolate w

--- src/aerys/minko/type/math/Matrix4x4.as
+++ src/aerys/minko/type/math/Matrix4x4.as
@@ -538,19 +538,22 @@
 			{
 				_invalidComponents |= COMPONENT_SCALE;

-				var scale	: Vector4	= getScale(TMP_VECTOR4);
+				var scale	: Vector4	= getColumn(3, TMP_VECTOR4);
 				var sx		: Number	= scale.x;
 				var sy		: Number	= scale.y;
 				var sz		: Number	= scale.z;
+                var sw      : Number    = scale.w;

-				scale = target.getScale(TMP_VECTOR4);
-
+				scale = target.getColumn(3, TMP_VECTOR4);
+                scale.set(
+                    sx + (scale.x - sx) * ratio,
+                    sy + (scale.y - sy) * ratio,
+                    sz + (scale.z - sz) * ratio,
+                    sw + (scale.w - sw) * ratio
+                );
+
 				_matrix.interpolateTo(target._matrix, ratio);
-				_matrix.prependScale(
-					sx + (scale.x - sx) * ratio,
-					sy + (scale.y - sy) * ratio,
-					sz + (scale.z - sz) * ratio
-				);
+                setColumn(3, scale);
 			}
 			else
 			{


support for additional tracking events for Google Analytics (time/pct watched)

--- com/definition/Player.as
+++ com/definition/Player.as
@@ -79,6 +79,9 @@
 		private var trackedEvents:Array = new Array();		// analytics tracking (one-time events)
 		private var GoogleTracker:AnalyticsTracker;

+		private var videoViewTime:uint = 0;					// ms
+		private var videoViewTimeStart:uint = 0;
+
 		private var config:Object = new Object();
 		private var configUrl:String = null;
 		private var configLoader:URLLoader;
@@ -535,14 +538,16 @@
 		private function videoAPIStateChangeHandler(evt:CustomEvent):void {
             trace('videoAPIStateChangeHandler dispatched');
 			trace('state:', evt.data.state);
+			stopVideoViewTimeTracker();
 			switch(evt.data.state) {
 				case video.STATE_PLAYING:
+					startVideoViewTimeTracker();
 					controls.updatePlayState(true);			// update controls
 					playOverlay.visible = false;			// hide overlay icon
 					posterImgContainer.visible = false;		// hide poster img
 					hideLoading();							// hide loader
 					hideHeader();							// hide header overlay
-					trackPlayEvent();						// analytics
+					trackEvent('Play');						// analytics
 					break;
 				case video.STATE_PAUSED:
 					controls.updatePlayState(false);		// update controls
@@ -920,28 +925,34 @@
 		/* = ANALYTICS = */
 		/* ============= */

-		public function trackPlayEvent():void {
-
-			var eventName:String = "Play";
+		public function trackEvent(eventName:String, eventValue:uint = 0):void {
+
+			var actionEvents:Array = ["Play"];
+			var valueEvents:Array = ["Time Watched", "Percent Watched"];
+			var validEvents:Array = actionEvents.concat(valueEvents);
+			if(validEvents.indexOf(eventName) == -1) return;

 			if(trackedEvents.indexOf(eventName) == -1) {

-				trace("track play event");
+				trace("tracking event: " + eventName);
+				trace("eventValue", eventValue);

 				// google analytics
-
-				var category:String = (embeddedMode) ? "Embedded Videos" : "Videos";
-
-				trace('Google Analytics', category, eventName, videoPermalinkId);
-
+				var category:String = (embeddedMode) ? "Embedded Videos" : "Videos";
 				try {
-					GoogleTracker.trackEvent(category, eventName, videoPermalinkId);
+					if(valueEvents.indexOf(eventName) != -1) {
+						trace('Google Analytics', category, eventName, videoPermalinkId, eventValue);
+						GoogleTracker.trackEvent(category, eventName, videoPermalinkId, eventValue);
+					} else {
+						trace('Google Analytics', category, eventName, videoPermalinkId);
+						GoogleTracker.trackEvent(category, eventName, videoPermalinkId);
+					}
 				} catch (error:Error) {
 					trace("Unable to track GoogleAnalytics event");
 				}

-				// app view count
-				if(config.trackPlayUrl) {
+				// app view count (Play event)
+				if(eventName == "Play" && config.trackPlayUrl) {
 					var loader:URLLoader = new URLLoader();
 					var request:URLRequest = new URLRequest(config.trackPlayUrl);
 					var variables:URLVariables = new URLVariables();
@@ -978,6 +989,22 @@
 		private function genericHTTPStatusHandler(event:HTTPStatusEvent):void {
             trace("genericHTTPStatusHandler: " + event);
         }
+
+		private function startVideoViewTimeTracker():void {
+			trace('startVideoViewTimeTracker');
+			var now:Date = new Date();
+			videoViewTimeStart = now.getTime();
+		}
+
+		private function stopVideoViewTimeTracker():uint {
+			trace('stopVideoViewTimeTracker');
+			if(!videoViewTimeStart) return videoViewTime;
+			var now:Date = new Date();
+			videoViewTime += (now.getTime() - videoViewTimeStart);	// ms
+			videoViewTimeStart = 0;	// reset
+			trace('videoViewTime', videoViewTime);
+			return videoViewTime;
+		}

 		/* ======================== */
@@ -1187,28 +1214,24 @@
 			if(ExternalInterface.available) {
 				ExternalInterface.addCallback("getCurrentTime", getCurrentTime);
 				ExternalInterface.addCallback("seekToSegment", seekToSegment);
+				ExternalInterface.addCallback("trackViewTime", trackViewTime);
 			}
 		}

 		// EXTERNAL METHOD
 		public function getCurrentTime():Number {
-
 			var currentTime:Number = 0
 			try {
 				currentTime = video.getCurrentTime();
 			} catch(e:Error) {
 				currentTime = 0;
 			}
-
 			return currentTime;
-
 		}

 		// EXTERNAL METHOD
 		public function seekToSegment(id:String):void {
-
 			trace("seekToSegment, id:" + id);
-
 			var seekTime:Number = 0;
 			for each(var segment:Object in videoSegments) {
 				if(segment.id == id) {
@@ -1216,7 +1239,6 @@
 					break;
 				}
 			}
-
 			try {
 				video.seekTo(seekTime);
 				video.play();
@@ -1225,6 +1247,19 @@
 			}
 		}

+		// EXTERNAL METHOD
+		public function trackViewTime():void {
+			trace("trackViewTime");
+			try {
+				var videoViewSecs:uint = Math.round(stopVideoViewTimeTracker()/1000);
+				if(!videoViewSecs) return;
+				trackEvent("Time Watched", videoViewSecs);
+				var viewPercent:uint = Math.round((videoViewSecs/videoDuration)*100);
+				trackEvent("Percent Watched", viewPercent);
+			} catch(e:Error) {
+				trace('trackViewTime error', e);
+			}
+		}

 	}


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

--- frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkPanelAutomationImpl.as
+++ frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkPanelAutomationImpl.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 spark.automation.delegates.components
 {


changed JavaScript call to work without knowing activity

--- common/actionscript/org/concord/sparks/circuit/multimeter/dmm_centech/DmmCentech2.as
+++ common/actionscript/org/concord/sparks/circuit/multimeter/dmm_centech/DmmCentech2.as
@@ -14,6 +14,7 @@
     import org.concord.sparks.util.Assert;
     import org.concord.sparks.util.Geom;
 	import ComponentMultimeter;
+	import org.concord.sparks.JavaScript;

     /*
      * Intended to be flexible enough to be used from multiple activities.
@@ -72,7 +73,7 @@

             imagePath = '../../../common/images/multimeter/dmm_centech'

-            dial = container.dial
+            //dial = container.dial
             container.dial.addEventListener(MouseEvent.MOUSE_DOWN, handleDialMouseDown);
             container.addEventListener(MouseEvent.MOUSE_MOVE, handleDialMouseMove);
             container.addEventListener(MouseEvent.MOUSE_UP, handleDialMouseUp);
@@ -199,7 +200,8 @@
                 dialSetting = label;
                 container.dial.rotation = rotationMap[label];
                 if (sendEvent) {
-                    activity.getJavaScript().sendEvent("multimeter_dial", dialSetting);
+					JavaScript.instance().sendEvent("multimeter_dial", dialSetting);
+                   //activity.getJavaScript().sendEvent("multimeter_dial", dialSetting);
                 }
             }
         }


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

--- frameworks/projects/mobilecomponents/src/spark/preloaders/SplashScreenImageSource.as
+++ frameworks/projects/mobilecomponents/src/spark/preloaders/SplashScreenImageSource.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2011 Adobe Systems Incorporated
-//  All Rights Reserved.
-//
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
+//  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
+//
+//      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: 19337
Author:   mhorn@adobe.com
Date:     2010-12-13T22:01:27.841985Z

Log Message:
-----------
ASDoc updates

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/MobileSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ActionBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TextInputSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/SkinnableContainerSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ActionButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/VScrollBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/VScrollBarThumbSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorApplicationSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/TextSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ListSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorApplicationSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderDataTip.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TextAreaSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderTrackSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ActionBarButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/SelectableButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/CheckBoxSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderThumbSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/RadioButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarThumbSkin.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/TextSkinBase.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/TextSkinBase.as
@@ -21,7 +21,7 @@
 use namespace mx_internal;

 /**
- *  Actionscript based skin for mobile text input.
+ *  ActionScript-based skin for text input controls in mobile applications.
  *
  *  @langversion 3.0
  *  @playerversion Flash 10


Added more code for compiling statements

--- WeaveCore/src/weave/compiler/Compiler.as
+++ WeaveCore/src/weave/compiler/Compiler.as
@@ -70,7 +70,6 @@
 		private static const STATEMENT_SWITCH:String = 'switch';
 		private static const STATEMENT_CASE:String = 'case';
 		private static const STATEMENT_DEFAULT:String = 'default';
-		private static const STATEMENT_IN:String = 'in';
 		private static const STATEMENT_THROW:String = 'throw';
 		private static const STATEMENT_TRY:String = 'try';
 		private static const STATEMENT_CATCH:String = 'catch';
@@ -78,7 +77,7 @@

 		private static const _statementsWithoutParams:Array = [
 			STATEMENT_ELSE, STATEMENT_DO, STATEMENT_RETURN, STATEMENT_BREAK, STATEMENT_CONTINUE,
-			STATEMENT_CASE, STATEMENT_DEFAULT, STATEMENT_IN, STATEMENT_THROW, STATEMENT_TRY, STATEMENT_FINALLY
+			STATEMENT_CASE, STATEMENT_DEFAULT, STATEMENT_THROW, STATEMENT_TRY, STATEMENT_FINALLY
 		];
 		private static const _statementsWithParams:Array = [
 			STATEMENT_IF, STATEMENT_FOR, STATEMENT_EACH, STATEMENT_WHILE, STATEMENT_SWITCH, STATEMENT_CATCH
@@ -645,9 +644,6 @@
 			if (operators.hasOwnProperty('#'))
 				compileUnaryOperators(tokens, ['#']);

-			// next step: compile statements
-			//compileStatements(tokens);
-
 			compilePostfixOperators(tokens, ['--', '++']);

 			// next step: compile infix '**' operators
@@ -727,25 +723,20 @@
 				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 (.)
+				// 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]]));
-					continue;
-				}
-
-				// verify that lhs.compiledMethod.name is \.
-				var lhsMethod:CompiledConstant = lhs.compiledMethod as CompiledConstant;
-				if (lhsMethod && lhsMethod.name == OPERATOR_ESCAPE + '.')
+				}
+				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));
-					continue;
-				}
-
-				throw new Error("Invalid left-hand-side of '" + tokens[i] + "'");
+				}
+				else
+					throw new Error("Invalid left-hand-side of '" + tokens[i] + "'");
 			}

 			// next step: handle multiple comma- or semicolon-separated expressions
@@ -755,6 +746,9 @@
 			if (tokens.indexOf(';') >= 0)
 				return compileOperator(';', compileArray(tokens, ';'));

+			// next step: compile statements
+			compileStatements(tokens);
+
 			// last step: verify there is only one token left
 			if (tokens.length == 1)
 				return tokens[0];
@@ -1087,7 +1081,7 @@
 			if (!enableOptimizations
 				|| !constantMethod
 				|| !operators.hasOwnProperty(constantMethod.name)
-				|| constantMethod.name == OPERATOR_ESCAPE + '['
+				|| constantMethod.value == operators['[']
 				|| assignmentOperators.hasOwnProperty(constantMethod.value))
 			{
 				return compiledFunctionCall;
@@ -1103,44 +1097,88 @@

 		/**
 		 * @param tokens
-		 * @param start
+		 * @param start first index to check
 		 * @return index of next statement
 		 */
 		private function findNextStatement(tokens:Array, start:int):int
 		{
-			while (++start < tokens.length)
+			for (; start < tokens.length; start++)
+			{
 				if (statements.hasOwnProperty(tokens[start]))
 					break;
+			}
 			return start;
 		}

 		/**
-		 * This function assumes that bracket operators have already been compiled.
+		 * This function assumes that every token except statements have already been compiled.
+		 * @param tokens
+		 * @param startIndex The index of the first token to compile
 		 */
-		private function compileStatements(tokens:Array):void
-		{
-			var i:int = -1;
+		private function compileStatements(tokens:Array, startIndex:int = 0):void
+		{
+			var i:int;
 			var j:int;
-			while (true)
-			{
-				switch (tokens[i = findNextStatement(tokens, i)])
-				{
-					case STATEMENT_IF:
+			var stmt:String;
+
+			if (startIndex == 0)
+			{
+				// verify that everything except statements have been compiled and that statements have the correct number of parameters
+				for (i = 0; i < tokens.length; i++)
+				{
+					if (tokens[i] is ICompiledObject)
+					{
+						// ok
+					}
+					else if (statements.hasOwnProperty(tokens[i]))
+					{
 						assertValidStatementParams(tokens, i);
-						switch (tokens[j = findNextStatement(tokens, i)])
-						{
-							case STATEMENT_ELSE:
-							default:
-						}
-						break;
-					default:
-						return;
-				}
-			}
-
-
-
-
+					}
+					else
+						throw new Error("Unexpected token: " + tokens[i]);
+				}
+			}
+
+			i = findNextStatement(tokens, startIndex);
+
+			// stop when there are no statements
+			if (i >= tokens.length)
+				return;
+
+			if (statements[tokens[i]]) // requires params.  Example:  if () {}
+			{
+				compileStatements(tokens, i + 2);
+			}
+			else // no params.  Example:  else {}
+			{
+				compileStatements(tokens, i + 1);
+			}
+
+			// now everything to the right of the current statement and its params have been taken care of.
+
+
+
+			switch (tokens[i])
+			{
+				case STATEMENT_FOR: // for () {}
+				case STATEMENT_WHILE: // while () {}
+				case STATEMENT_IF: // if () {} else {}
+				case STATEMENT_ELSE: // else {}
+				case STATEMENT_EACH: // for each () {}
+				case STATEMENT_DO: // do {} while ()
+				case STATEMENT_RETURN: // return EXPR
+				case STATEMENT_BREAK: // break
+				case STATEMENT_CONTINUE: // continue
+				case STATEMENT_SWITCH: // switch () {}
+				case STATEMENT_CASE: // case EXPR :
+				case STATEMENT_DEFAULT: // default :
+				case STATEMENT_THROW: // throw EXPR
+				case STATEMENT_TRY: // try {} catch () {} finally {}
+				case STATEMENT_CATCH: // catch () {}
+				case STATEMENT_FINALLY: // finally {}
+				default:
+					return;
+			}
 		}
 		private function compileStatements1(tokens:Array):void
 		{
@@ -1189,11 +1227,25 @@
 				var separator:String = statement == STATEMENT_FOR ? ';' : ',';
 				if (params.evaluatedMethod == operators[separator])
 				{
-					var paramCount:int = statement == STATEMENT_FOR ? 3 : 1;
-					if (params.compiledParams.length != paramCount)
+					var cpl:int = params.compiledParams.length;
+					if (statement == STATEMENT_FOR)
+					{
+						if (cpl == 3)
+							return;
+						if (cpl == 1)
+						{
+							var cfc:CompiledFunctionCall = params.compiledParams[0] as CompiledFunctionCall;
+							if (cfc && cfc.evaluatedMethod == operators['in'])
+								return;
+						}
 						throwInvalidSyntax(statement);
-				}
-				else if (statement == STATEMENT_FOR && params.evaluatedMethod != STATEMENT_IN)
+					}
+					else if (cpl != 1)
+					{
+						throwInvalidSyntax(statement);
+					}
+				}
+				else
 				{
 					throwInvalidSyntax(statement);
 				}
@@ -1220,6 +1272,11 @@
 			return new CompiledFunctionCall(new CompiledConstant(variableName, variableName), null); // params are null as a special case
 		}

+		private function newUndefinedConstant():CompiledConstant
+		{
+			return new CompiledConstant('undefined', undefined);
+		}
+
 		private function compilePostfixOperators(compiledTokens:Array, operatorSymbols:Array):void
 		{
 			for (var i:int = 1; i < compiledTokens.length; i++)
@@ -1234,13 +1291,13 @@

 				if (cfc.evaluatedMethod is String) // variable lookup
 				{
-					compiledTokens.splice(--i, 2, compileOperator('#' + op, [cfc.compiledMethod, new CompiledConstant("1", 1)]));
+					compiledTokens.splice(--i, 2, compileOperator('#' + op, [cfc.compiledMethod, newUndefinedConstant()]));
 					continue;
 				}
 				else if (cfc.evaluatedMethod == operators['.'])
 				{
 					// switch to the postfix operator
-					cfc.compiledParams.push(new CompiledConstant("1", 1));
+					cfc.compiledParams.push(newUndefinedConstant());
 					compiledTokens.splice(--i, 2, compileOperator('#' + op, cfc.compiledParams));
 					continue;
 				}
@@ -1293,12 +1350,12 @@
 					var cfc:CompiledFunctionCall = nextToken as CompiledFunctionCall;
 					if (cfc && cfc.evaluatedMethod is String) // variable lookup
 					{
-						compiledTokens.splice(index, 2, compileOperator(token, [cfc.compiledMethod, new CompiledConstant("1", 1)]));
+						compiledTokens.splice(index, 2, compileOperator(token, [cfc.compiledMethod, newUndefinedConstant()]));
 					}
 					else if (cfc && cfc.evaluatedMethod == operators['.'])
 					{
-						// switch to the unary operator
-						cfc.compiledParams.push(new CompiledConstant("1", 1));
+						// switch '.' to the unary operator
+						cfc.compiledParams.push(newUndefinedConstant());
 						compiledTokens.splice(index, 2, compileOperator(token, cfc.compiledParams));
 					}
 					else


Fixed bug where joinColumns was getting Arrays of values from columns when no dataType was given.

--- WeaveData/src/weave/utils/ColumnUtils.as
+++ WeaveData/src/weave/utils/ColumnUtils.as
@@ -389,11 +389,12 @@
 			// get all the data values in the same order as the common keys
 			for (var cIndex:int = 0; cIndex < columns.length; cIndex++)
 			{
+				var dt:Class = dataType || DataType.getClass(column.getMetadata(ColumnMetadata.DATA_TYPE));
 				column = columns[cIndex];
 				var values:Array = [];
-				for (var kIndex:int = 0; kIndex < keys.length; kIndex++)
+				for (var kIndex:int = 0; kIndex < keys.length; kIndex++)
 				{
-					var value:* = column ? column.getValueFromKey(keys[kIndex] as IQualifiedKey, dataType) : undefined;
+					var value:* = column ? column.getValueFromKey(keys[kIndex] as IQualifiedKey, dt) : undefined;
 					var isUndef:Boolean = StandardLib.isUndefined(value);
 					if (!allowMissingData && isUndef)
 					{


documentation cleanup

documentation cleanup

--- WeaveData/src/weave/utils/VectorUtils.as
+++ WeaveData/src/weave/utils/VectorUtils.as
@@ -22,7 +22,6 @@
 	import mx.utils.ObjectUtil;

 	/**
-	 * VectorUtils
 	 * This class contains static functions that manipulate Vector objects.
 	 *
 	 * @author adufilie
@@ -30,9 +29,9 @@
 	 */
 	public class VectorUtils
 	{
-		// Vector.<*> causes compiler errors, so use *
-		/**
-		 * copyList
+		// Vector.<*> causes compiler errors, so use *
+
+		/**
 		 * This function copies the contents of the source to the destination.
 		 * Either parameter may be either an Array or a Vector.
 		 * @return A pointer to the destination Array (or Vector)
@@ -65,12 +64,12 @@
 		{
 			try
 			{
-				if(vector1.length != vector2.length)
+				if (vector1.length != vector2.length)
 					return false;

 				for (var i:int = 0; i < vector1.length; i++)
 				{
-					if(vector1[i] != vector2[i])
+					if (vector1[i] !== vector2[i])
 						return false;
 				}

@@ -89,7 +88,7 @@
 		 */
 		public static function copyXMLListToVector(xmlList:*, vector:*=null):*
 		{
-			if(vector == null)
+			if (vector == null)
 				vector = new Vector.<String>();

 			if (xmlList == null)
@@ -137,7 +136,6 @@
 			return 0;
 		}
 		/**
-		 * randomSort
 		 * randomizes the order of the elements in the vector in O(n) time by modifying the given array.
 		 * @param the vector to randomize
 		 * @return the input vector
@@ -161,7 +159,6 @@
 		}

 		/**
-		 * partition
 		 * See http://en.wikipedia.org/wiki/Quick_select#Partition-based_general_selection_algorithm
 		 * @param list An Array or Vector to be re-organized
 		 * @param firstIndex The index of the first element in the list to partition.
@@ -201,7 +198,6 @@
 		}

 		/**
-		 * getMedianIndex
 		 * See http://en.wikipedia.org/wiki/Quick_select#Partition-based_general_selection_algorithm
 		 * @param list An Array or Vector to be re-organized.
 		 * @param compareFunction A function that takes two array elements a,b and returns -1 if a<b, 1 if a>b, or 0 if a==b.
@@ -234,7 +230,6 @@
 		}

 		/**
-		 * mergeSorted
 		 * Merges two previously-sorted arrays or vectors.
 		 * @param sortedInputA The first sorted array or vector.
 		 * @param sortedInputB The second sorted array or vector.
@@ -264,7 +259,6 @@
 		}

 		/**
-		 * flatten
 		 * This will flatten an Array of Arrays into a flat Array.
 		 * Items will be appended to the destination Array.
 		 * @param source An Array to flatten.


loadUrl() now always reports errors

loadUrl() now always reports errors

--- WeaveJS/src/weavejs/core/WeaveArchive.as
+++ WeaveJS/src/weavejs/core/WeaveArchive.as
@@ -122,7 +122,7 @@
 			var promise:WeavePromise = new WeavePromise(weave.root);
 			promise.setResult(
 				WeaveAPI.URLRequestUtils.request(weave.root, URLRequestUtils.METHOD_GET, fileUrl, null, null, URLRequestUtils.RESPONSE_ARRAYBUFFER)
-					.then(loadFileContent.bind(WeaveArchive, weave))
+					.then(loadFileContent.bind(WeaveArchive, weave), JS.error)
 			);
 			return promise;
 		}


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

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


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

--- frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkTextInputAutomationImpl.as
+++ frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkTextInputAutomationImpl.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 spark.automation.delegates.components
 {


Make sure to clip undo / redo buffer bounds to the heightMap bounds in the TerrainEditor

--- bin/Data/Scripts/Editor/EditorTerrain.as
+++ bin/Data/Scripts/Editor/EditorTerrain.as
@@ -399,7 +399,13 @@
         uint brushImageHeight = scaledSelectedBrushImage.height;

         updateChanges.offset = IntVector2(position.x - (brushImageWidth / 2), position.y - (brushImageHeight / 2));
-        updateChanges.oldImage = terrainImage.GetSubimage(IntRect(updateChanges.offset.x, updateChanges.offset.y, updateChanges.offset.x + brushImageWidth, updateChanges.offset.y + brushImageHeight));
+        if (updateChanges.offset.x < 0) updateChanges.offset.x = 0;
+        if (updateChanges.offset.y < 0) updateChanges.offset.y = 0;
+
+        IntRect boundsRect = IntRect(updateChanges.offset.x, updateChanges.offset.y, updateChanges.offset.x + brushImageWidth, updateChanges.offset.y + brushImageHeight);
+        boundsRect = ClipIntRectToHeightmapBounds(terrainImage, boundsRect);
+
+        updateChanges.oldImage = terrainImage.GetSubimage(boundsRect);

         // lower or raise (respectively), multiply this by the brush opacity
         float opacity = brushOpacitySlider.value / 25;
@@ -435,7 +441,13 @@
         uint brushImageHeight = scaledSelectedBrushImage.height;

         updateChanges.offset = IntVector2(position.x - (brushImageWidth / 2), position.y - (brushImageHeight / 2));
-        updateChanges.oldImage = terrainImage.GetSubimage(IntRect(updateChanges.offset.x, updateChanges.offset.y, updateChanges.offset.x + brushImageWidth, updateChanges.offset.y + brushImageHeight));
+        if (updateChanges.offset.x < 0) updateChanges.offset.x = 0;
+        if (updateChanges.offset.y < 0) updateChanges.offset.y = 0;
+
+        IntRect boundsRect = IntRect(updateChanges.offset.x, updateChanges.offset.y, updateChanges.offset.x + brushImageWidth, updateChanges.offset.y + brushImageHeight);
+        boundsRect = ClipIntRectToHeightmapBounds(terrainImage, boundsRect);
+
+        updateChanges.oldImage = terrainImage.GetSubimage(boundsRect);

         // Iterate over the entire brush image
         for (int y = 0; y < brushImageHeight; ++y)
@@ -482,7 +494,7 @@
             }
         }

-        updateChanges.newImage = terrainImage.GetSubimage(IntRect(updateChanges.offset.x, updateChanges.offset.y, updateChanges.offset.x + brushImageWidth, updateChanges.offset.y + brushImageHeight));
+        updateChanges.newImage = terrainImage.GetSubimage(boundsRect);
     }

     private void UpdateTerrainSetHeight(Image@ terrainImage, IntVector2 position, TerrainEditorUpdateChanges@ updateChanges)
@@ -491,7 +503,13 @@
         uint brushImageHeight = scaledSelectedBrushImage.height;

         updateChanges.offset = IntVector2(position.x - (brushImageWidth / 2), position.y - (brushImageHeight / 2));
-        updateChanges.oldImage = terrainImage.GetSubimage(IntRect(updateChanges.offset.x, updateChanges.offset.y, updateChanges.offset.x + brushImageWidth, updateChanges.offset.y + brushImageHeight));
+        if (updateChanges.offset.x < 0) updateChanges.offset.x = 0;
+        if (updateChanges.offset.y < 0) updateChanges.offset.y = 0;
+
+        IntRect boundsRect = IntRect(updateChanges.offset.x, updateChanges.offset.y, updateChanges.offset.x + brushImageWidth, updateChanges.offset.y + brushImageHeight);
+        boundsRect = ClipIntRectToHeightmapBounds(terrainImage, boundsRect);
+
+        updateChanges.oldImage = terrainImage.GetSubimage(boundsRect);

         float targetHeight = brushHeightSlider.value / 25;

@@ -516,7 +534,7 @@
             }
         }

-        updateChanges.newImage = terrainImage.GetSubimage(IntRect(updateChanges.offset.x, updateChanges.offset.y, updateChanges.offset.x + brushImageWidth, updateChanges.offset.y + brushImageHeight));
+        updateChanges.newImage = terrainImage.GetSubimage(boundsRect);
     }

     private void UpdateTerrainSetConstantHeight(Image@ terrainImage, float height)
@@ -532,4 +550,20 @@
             }
         }
     }
+
+    private IntRect ClipIntRectToHeightmapBounds(Image@ terrainImage, IntRect intRect) {
+        if (intRect.left > terrainImage.width)
+            intRect.left = terrainImage.width;
+
+        if (intRect.right > terrainImage.width)
+            intRect.right = terrainImage.width;
+
+        if (intRect.top > terrainImage.height)
+            intRect.top = terrainImage.height;
+
+        if (intRect.bottom > terrainImage.height)
+            intRect.bottom = terrainImage.height;
+
+        return intRect;
+    }
 }


added ILoader signals ASDoc

added ILoader signals ASDoc

--- src/aerys/minko/type/loader/ILoader.as
+++ src/aerys/minko/type/loader/ILoader.as
@@ -7,8 +7,52 @@

 	public interface ILoader
 	{
+		/**
+		 * The signal executed when new data is received.
+		 *
+		 *

+		 * Callbacks for this signal must accept the following arguments:
+		 *

+		 *

+		 *
loader : ILoader, the ILoader that executed the signal

+		 *
percent : Number, the progress of the loading operation as a floatting
+		 * point value between 0.0 and 1.0

+		 *

+		 *
+		 * @return
+		 *
+		 */
 		function get progress()		: Signal;
+		/**
+		 * The signal executed when an error happens during loading.
+		 *
+		 *

+		 * Callbacks for this signal must accept the following arguments:
+		 *

+		 *

+		 *
loader : ILoader, the ILoader causing the error

+		 *
errorId : int, the ID of the error

+		 *
message : String, the error message

+		 *

+		 *
+		 * @return
+		 *
+		 */
 		function get error()		: Signal;
+		/**
+		 * The signal executed when the loading has been successfully completed.
+		 *
+		 *

+		 * Callbacks for this signal must accept the following arguments:
+		 *

+		 *

+		 *
loader : ILoader, the ILoader that executed the signal

+		 *
object : Object, the result of the loading operation

+		 *

+		 *
+		 * @return
+		 *
+		 */
 		function get complete()		: Signal;

 		function get isComplete()	: Boolean;


Helper to make a multiline text that fills the width of its parent.

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

--- src/as/com/threerings/flex/FlexUtil.as
+++ src/as/com/threerings/flex/FlexUtil.as
@@ -73,6 +73,19 @@
     }

     /**
+     * Create an uneditable/unselectable multiline Text widget with 100% width.
+     */
+    public static function createWideText (text :String, style :String = null) :Text
+    {
+        var t :Text = new Text();
+        t.styleName = style;
+        t.percentWidth = 100;
+        t.selectable = false;
+        t.text = text;
+        return t;
+    }
+
+    /**
      * How hard would it have been for them make Spacer accept two optional arguments?
      */
     public static function createSpacer (width :int = 0, height :int = 0) :Spacer


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

--- frameworks/projects/automation/src/mx/automation/delegates/TextFieldAutomationHelper.as
+++ frameworks/projects/automation/src/mx/automation/delegates/TextFieldAutomationHelper.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.automation.delegates
 {


StringUtil got moved to flash-utils.

StringUtil got moved to flash-utils.

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

--- src/as/com/threerings/util/StringUtil.as
+++ src/as/com/threerings/util/StringUtil.as
@@ -1,712 +0,0 @@
-//
-// $Id$
-//
-// Narya library - tools for developing networked games
-// Copyright (C) 2002-2009 Three Rings Design, Inc., All Rights Reserved
-// http://www.threerings.net/code/narya/
-//
-// This library is free software; you can redistribute it and/or modify it
-// under the terms of the GNU Lesser General Public License as published
-// by the Free Software Foundation; either version 2.1 of the License, or
-// (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-package com.threerings.util {
-
-import com.threerings.util.env.Environment;
-
-import flash.utils.ByteArray;
-import flash.utils.Dictionary;
-
-public class StringUtil
-{
-    /**
-     * Compares two String values, returning -1, 0, or 1. Case-sensitive.
-     */
-    public static function compare (s1 :String, s2 :String) :int
-    {
-        return (s1 > s2) ? 1 : (s1 == s2 ? 0 : -1);
-    }
-
-    /**
-     * Compares two String values, returning -1, 0, or 1. Not case-sensitive.
-     */
-    public static function compareIgnoreCase (s1 :String, s2 :String) :int
-    {
-        return compare(s1.toLowerCase(), s2.toLowerCase());
-    }
-
-    /**
-     * Get a reasonable hash code for the specified String.
-     */
-    public static function hashCode (str :String) :int
-    {
-        var code :int = 0;
-        if (str != null) {
-            // hash identically to Java's String.hashCode(), for various reasons
-            for (var ii :int = 0; ii < str.length; ii++) {
-                code = 31 * code + str.charCodeAt(ii);
-            }
-        }
-        return code;
-    }
-
-    /**
-     * Is the specified string null, empty, or does it contain only whitespace?
-     */
-    public static function isBlank (str :String) :Boolean
-    {
-        return (str == null) || (str.search("\\S") == -1);
-    }
-
-    /**
-     * Return the specified String, or "" if it is null.
-     */
-    public static function deNull (str :String) :String
-    {
-        return (str == null) ? "" : str;
-    }
-
-    /**
-     * Does the specified string end with the specified substring.
-     */
-    public static function endsWith (str :String, substr :String) :Boolean
-    {
-        var startDex :int = str.length - substr.length;
-        return (startDex >= 0) && (str.indexOf(substr, startDex) >= 0);
-    }
-
-    /**
-     * Does the specified string start with the specified substring.
-     */
-    public static function startsWith (str :String, substr :String) :Boolean
-    {
-        // just check once if it's at the beginning
-        return (str.lastIndexOf(substr, 0) == 0);
-    }
-
-    /**
-     * Return true iff the first character is a lower-case character.
-     */
-    public static function isLowerCase (str :String) :Boolean
-    {
-        var firstChar :String = str.charAt(0);
-        return (firstChar.toUpperCase() != firstChar) &&
-            (firstChar.toLowerCase() == firstChar);
-    }
-
-    /**
-     * Return true iff the first character is an upper-case character.
-     */
-    public static function isUpperCase (str :String) :Boolean
-    {
-        var firstChar :String = str.charAt(0);
-        return (firstChar.toUpperCase() == firstChar) &&
-            (firstChar.toLowerCase() != firstChar);
-    }
-
-    /**
-     * Parse an integer more anally than the built-in parseInt() function,
-     * throwing an ArgumentError if there are any invalid characters.
-     *
-     * The built-in parseInt() will ignore trailing non-integer characters.
-     *
-     * @param str The string to parse.
-     * @param radix The radix to use, from 2 to 16. If not specified the radix will be 10,
-     *        unless the String begins with "0x" in which case it will be 16,
-     *        or the String begins with "0" in which case it will be 8.
-     */
-    public static function parseInteger (str :String, radix :uint = 0) :int
-    {
-        return int(parseInt0(str, radix, true));
-    }
-
-    /**
-     * Parse an integer more anally than the built-in parseInt() function,
-     * throwing an ArgumentError if there are any invalid characters.
-     *
-     * The built-in parseInt() will ignore trailing non-integer characters.
-     *
-     * @param str The string to parse.
-     * @param radix The radix to use, from 2 to 16. If not specified the radix will be 10,
-     *        unless the String begins with "0x" in which case it will be 16,
-     *        or the String begins with "0" in which case it will be 8.
-     */
-    public static function parseUnsignedInteger (str :String, radix :uint = 0) :uint
-    {
-        var result :Number = parseInt0(str, radix, false);
-        if (result < 0) {
-            throw new ArgumentError("parseUnsignedInteger parsed negative value [value=" + str +
-                "].");
-        }
-        return uint(result);
-    }
-
-    /**
-     * Format the specified number, nicely, with commas.
-     * TODO: format specifyer, locale handling, etc. We'll probably move this into a
-     * NumberFormat-style class.
-     */
-    public static function formatNumber (n :Number) :String
-    {
-        var postfix :String = "";
-        var s :String = n.toString(); // use standard to-stringing
-
-        // move any fractional portion to the postfix
-        const dex :int = s.lastIndexOf(".");
-        if (dex != -1) {
-            postfix = s.substring(dex);
-            s = s.substring(0, dex);
-        }
-
-        // hackily add commas
-        var prefixLength :int = (n < 0) ? 1 : 0;
-        while (s.length - prefixLength > 3) {
-            postfix = "," + s.substring(s.length - 3) + postfix;
-            s = s.substring(0, s.length - 3);
-        }
-        return s + postfix;
-    }
-
-    /**
-     * Parse a Number from a String, throwing an ArgumentError if there are any
-     * invalid characters.
-     *
-     * 1.5, 2e-3, -Infinity, Infinity, and NaN are all valid Strings.
-     *
-     * @param str the String to parse.
-     */
-    public static function parseNumber (str :String) :Number
-    {
-        if (str == null) {
-            throw new ArgumentError("Cannot parseNumber(null)");
-        }
-
-        // deal with a few special cases
-        if (str == "Infinity") {
-            return Infinity;
-        } else if (str == "-Infinity") {
-            return -Infinity;
-        } else if (str == "NaN") {
-            return NaN;
-        }
-
-        const originalString :String = str;
-        str = str.replace(",", "");
-        const noCommas :String = str;
-
-        // validate all characters before the "e"
-        str = validateDecimal(str, true, true);
-
-        // validate all characters after the "e"
-        if (null != str && str.charAt(0) == "e") {
-            str = str.substring(1);
-            validateDecimal(str, false, false);
-        }
-
-        if (null == str) {
-            throw new ArgumentError("Could not convert '" + originalString + "' to Number");
-        }
-
-        // let Flash do the actual conversion
-        return parseFloat(noCommas);
-    }
-
-    /**
-     * Parse a Boolean from a String, throwing an ArgumentError if the String
-     * contains invalid characters.
-     *
-     * "1", "0", and any capitalization variation of "true" and "false" are
-     * the only valid input values.
-     *
-     * @param str the String to parse.
-     */
-    public static function parseBoolean (str :String) :Boolean
-    {
-        var originalString :String = str;
-
-        if (str != null) {
-            str = str.toLowerCase();
-            if (str == "true" || str == "1") {
-                return true;
-            } else if (str == "false" || str == "0") {
-                return false;
-            }
-        }
-
-        throw new ArgumentError("Could not convert '" + originalString + "' to Boolean");
-    }
-
-    /**
-     * Append 0 or more copies of the padChar String to the input String
-     * until it is at least the specified length.
-     */
-    public static function pad (
-        str :String, length :int, padChar :String = " ") :String
-    {
-        while (str.length < length) {
-            str += padChar;
-        }
-        return str;
-    }
-
-    /**
-     * Prepend 0 or more copies of the padChar String to the input String
-     * until it is at least the specified length.
-     */
-    public static function prepad (
-        str :String, length :int, padChar :String = " ") :String
-    {
-        while (str.length < length) {
-            str = padChar + str;
-        }
-        return str;
-    }
-
-    /**
-     * Substitute "{n}" tokens for the corresponding passed-in arguments.
-     */
-    public static function substitute (str :String, ... args) :String
-    {
-        // if someone passed an array as arg 1, fix it
-        args = Util.unfuckVarargs(args);
-        var len :int = args.length;
-        // TODO: FIXME: this might be wrong, if your {0} replacement has a {1} in it, then
-        // that'll get replaced next iteration.
-        for (var ii : int = 0; ii < len; ii++) {
-            str = str.replace(new RegExp("\\{" + ii + "\\}", "g"), args[ii]);
-        }
-        return str;
-    }
-
-    /**
-     * Utility function that strips whitespace from the beginning and end of a String.
-     */
-    public static function trim (str :String) :String
-    {
-        return trimEnd(trimBeginning(str));
-    }
-
-    /**
-     * Utility function that strips whitespace from the beginning of a String.
-     */
-    public static function trimBeginning (str :String) :String
-    {
-        if (str == null) {
-            return null;
-        }
-
-        var startIdx :int = 0;
-        // this works because charAt() with an invalid index returns "", which is not whitespace
-        while (isWhitespace(str.charAt(startIdx))) {
-            startIdx++;
-        }
-
-        // TODO: is this optimization necessary? It's possible that str.slice() does the same
-        // check and just returns 'str' if it's the full length
-        return (startIdx > 0) ? str.slice(startIdx, str.length) : str;
-    }
-
-    /**
-     * Utility function that strips whitespace from the end of a String.
-     */
-    public static function trimEnd (str :String) :String
-    {
-        if (str == null) {
-            return null;
-        }
-
-        var endIdx :int = str.length;
-        // this works because charAt() with an invalid index returns "", which is not whitespace
-        while (isWhitespace(str.charAt(endIdx - 1))) {
-            endIdx--;
-        }
-
-        // TODO: is this optimization necessary? It's possible that str.slice() does the same
-        // check and just returns 'str' if it's the full length
-        return (endIdx < str.length) ? str.slice(0, endIdx) : str;
-    }
-
-    /**
-     * @return true if the specified String is == to a single whitespace character.
-     */
-    public static function isWhitespace (character :String) :Boolean
-    {
-        switch (character) {
-        case " ":
-        case "\t":
-        case "\r":
-        case "\n":
-        case "\f":
-            return true;
-
-        default:
-            return false;
-        }
-    }
-
-    /**
-     * Nicely format the specified object into a String.
-     */
-    public static function toString (obj :*, refs :Dictionary = null) :String
-    {
-        if (obj == null) { // checks null or undefined
-            return String(obj);
-        }
-
-        var isDictionary :Boolean = obj is Dictionary;
-        if (obj is Array || isDictionary || Util.isPlainObject(obj)) {
-            if (refs == null) {
-                refs = new Dictionary();
-
-            } else if (refs[obj] !== undefined) {
-                return "[cyclic reference]";
-            }
-            refs[obj] = true;
-
-            var s :String;
-            if (obj is Array) {
-                var arr :Array = (obj as Array);
-                s = "";
-                for (var ii :int = 0; ii < arr.length; ii++) {
-                    if (ii > 0) {
-                        s += ", ";
-                    }
-                    s += (ii + ": " + toString(arr[ii], refs));
-                }
-                return "Array(" + s + ")";
-
-            } else {
-                // TODO: maybe do this for any dynamic object? (would have to use describeType)
-                s = "";
-                for (var prop :String in obj) {
-                    if (s.length > 0) {
-                        s += ", ";
-                    }
-                    s += prop + "=>" + toString(obj[prop], refs);
-                }
-                return (isDictionary ? "Dictionary" : "Object") + "(" + s + ")";
-            }
-
-        } else if (obj is XML) {
-            return Util.XMLtoXMLString(obj as XML);
-        }
-
-        return String(obj);
-    }
-
-    /**
-     * Return a string containing all the public fields of the object
-     *
-     * @param buf the StringBuilder to which to append
-     * @param obj the object to be inspected
-     * @param fieldNames the names of fields to print, or null to print all.
-     */
-    public static function fieldsToString (
-        buf :StringBuilder, obj :Object, fieldNames :Array = null) :void
-    {
-        if (fieldNames == null) {
-            fieldNames = Environment.enumerateFields(obj);
-        }
-        var appended :Boolean = false;
-        for each (var varName :String in fieldNames) {
-            if (appended) {
-                buf.append(", ");
-            }
-            buf.append(varName, "=");
-            try {
-                buf.append(obj[varName]);
-            } catch (re :ReferenceError) {
-                buf.append("<ReferenceError>");
-            }
-            appended = true;
-        }
-    }
-
-    /**
-     * Return a pretty basic toString of the supplied Object.
-     *
-     * @param obj the object to be string'd
-     * @param fieldNames the names of fields to print, or null to print all.
-     */
-    public static function simpleToString (obj :Object, fieldNames :Array = null) :String
-    {
-        var buf :StringBuilder = new StringBuilder("[");
-        buf.append(ClassUtil.tinyClassName(obj));
-        buf.append("(");
-        fieldsToString(buf, obj, fieldNames);
-        return buf.append(")]").toString();
-    }
-
-    /**
-     * Truncate the specified String if it is longer than maxLength.
-     * The string will be truncated at a position such that it is
-     * maxLength chars long after the addition of the 'append' String.
-     *
-     * @param append a String to add to the truncated String only after
-     * truncation.
-     */
-    public static function truncate (
-        s :String, maxLength :int, append :String = "") :String
-    {
-        if ((s == null) || (s.length <= maxLength)) {
-            return s;
-        } else {
-            return s.substring(0, maxLength - append.length) + append;
-        }
-    }
-
-    /**
-     * Locate URLs in a string, return an array in which even elements
-     * are plain text, odd elements are urls (as Strings). Any even element
-     * may be an empty string.
-     */
-    public static function parseURLs (s :String) :Array
-    {
-        var array :Array = [];
-        while (true) {
-            var result :Object = URL_REGEXP.exec(s);
-            if (result == null) {
-                break;
-            }
-
-            var index :int = int(result.index);
-            var url :String = String(result[0]);
-            array.push(s.substring(0, index), url);
-            s = s.substring(index + url.length);
-        }
-
-        if (s != "" || array.length == 0) { // avoid putting an empty string on the end
-            array.push(s);
-        }
-        return array;
-    }
-
-    /**
-     * Turn the specified byte array, containing only ascii characters, into a String.
-     */
-    public static function fromBytes (bytes :ByteArray) :String
-    {
-        var s :String = "";
-        if (bytes != null) {
-            for (var ii :int = 0; ii < bytes.length; ii++) {
-                s += String.fromCharCode(bytes[ii]);
-            }
-        }
-        return s;
-    }
-
-    /**
-     * Turn the specified String, containing only ascii characters, into a ByteArray.
-     */
-    public static function toBytes (s :String) :ByteArray
-    {
-        if (s == null) {
-            return null;
-        }
-        var ba :ByteArray = new ByteArray();
-//        if (true) {
-            for (var ii :int = 0; ii < s.length; ii++) {
-                ba[ii] = int(s.charCodeAt(ii)) & 0xFF;
-            }
-//        } else {
-//            ba.writeUTFBytes(s);
-//        }
-        return ba;
-    }
-
-    /**
-     * Generates a string from the supplied bytes that is the hex encoded
-     * representation of those byts. Returns the empty String for a
-     * null or empty byte array.
-     */
-    public static function hexlate (bytes :ByteArray) :String
-    {
-        var str :String = "";
-        if (bytes != null) {
-            for (var ii :int = 0; ii < bytes.length; ii++) {
-                var b :int = bytes[ii];
-                str += HEX[b >> 4] + HEX[b & 0xF];
-            }
-        }
-        return str;
-    }
-
-    /**
-     * Turn a hexlated String back into a ByteArray.
-     */
-    public static function unhexlate (hex :String) :ByteArray
-    {
-        if (hex == null || (hex.length % 2 != 0)) {
-            return null;
-        }
-
-        hex = hex.toLowerCase();
-        var data :ByteArray = new ByteArray();
-        for (var ii :int = 0; ii < hex.length; ii += 2) {
-            var value :int = HEX.indexOf(hex.charAt(ii)) << 4;
-            value += HEX.indexOf(hex.charAt(ii + 1));
-
-            // TODO: verify
-            // values over 127 are wrapped around, restoring negative bytes
-            data[ii / 2] = value;
-        }
-
-        return data;
-    }
-
-    /**
-     * Return a hexadecimal representation of an unsigned int, potentially left-padded with
-     * zeroes to arrive at of precisely the requested width, e.g.
-     *       toHex(131, 4) -> "0083"
-     */
-    public static function toHex (n :uint, width :uint) :String
-    {
-        return prepad(n.toString(16), width, "0");
-    }
-
-    /**
-     * Create line-by-line hexadecimal output with a counter, much like the
-     * 'hexdump' Unix utility. For debugging purposes.
-     */
-    public static function hexdump (bytes :ByteArray) :String
-    {
-        var str :String = "";
-        for (var lineIx :int = 0; lineIx < bytes.length; lineIx += 16) {
-            str += toHex(lineIx, 4);
-            for (var byteIx :int = 0; byteIx < 16 && lineIx + byteIx < bytes.length; byteIx ++) {
-                var b :uint = bytes[lineIx + byteIx];
-                str += " " + HEX[b >> 4] + HEX[b & 0x0f];
-            }
-            str += "\n";
-        }
-        return str;
-
-    }
-
-
-    /**
-     * Internal helper function for parseNumber.
-     */
-    protected static function validateDecimal (
-        str :String, allowDot :Boolean, allowTrailingE :Boolean) :String
-    {
-        // skip the leading minus
-        if (str.charAt(0) == "-") {
-            str = str.substring(1);
-        }
-
-        // validate that the characters in the string are all integers,
-        // with at most one '.'
-        var seenDot :Boolean;
-        var seenDigit :Boolean;
-        while (str.length > 0) {
-            var char :String = str.charAt(0);
-            if (char == ".") {
-                if (!allowDot || seenDot) {
-                    return null;
-                }
-                seenDot = true;
-            } else if (char == "e") {
-                if (!allowTrailingE) {
-                    return null;
-                }
-                break;
-            } else if (DECIMAL.indexOf(char) >= 0) {
-                seenDigit = true;
-            } else {
-                return null;
-            }
-
-            str = str.substring(1);
-        }
-
-        // ensure we've seen at least one digit so far
-        if (!seenDigit) {
-            return null;
-        }
-
-        return str;
-    }
-
-    /**
-     * Internal helper function for parseInteger and parseUnsignedInteger.
-     */
-    protected static function parseInt0 (str :String, radix :uint, allowNegative :Boolean) :Number
-    {
-        if (str == null) {
-            throw new ArgumentError("Cannot parseInt(null)");
-        }
-
-        var negative :Boolean = (str.charAt(0) == "-");
-        if (negative) {
-            str = str.substring(1);
-        }
-
-        // handle this special case immediately, to prevent confusion about
-        // a leading 0 meaning "parse as octal"
-        if (str == "0") {
-            return 0;
-        }
-
-        if (radix == 0) {
-            if (startsWith(str, "0x")) {
-                str = str.substring(2);
-                radix = 16;
-
-            } else if (startsWith(str, "0")) {
-                str = str.substring(1);
-                radix = 8;
-
-            } else {
-                radix = 10;
-            }
-
-        } else if (radix == 16 && startsWith(str, "0x")) {
-            str = str.substring(2);
-
-        } else if (radix < 2 || radix > 16) {
-            throw new ArgumentError("Radix out of range: " + radix);
-        }
-
-        // now verify that str only contains valid chars for the radix
-        for (var ii :int = 0; ii < str.length; ii++) {
-            var dex :int = HEX.indexOf(str.charAt(ii).toLowerCase());
-            if (dex == -1 || dex >= radix) {
-                throw new ArgumentError("Invalid characters in String parseInt='" + arguments[0] +
-                    "', radix=" + radix);
-            }
-        }
-
-        var result :Number = parseInt(str, radix);
-        if (isNaN(result)) {
-            // this shouldn't happen..
-            throw new ArgumentError("Could not parseInt=" + arguments[0]);
-        }
-        if (negative) {
-            result *= -1;
-        }
-        return result;
-    }
-
-    /** Hexidecimal digits. */
-    protected static const HEX :Array = [ "0", "1", "2", "3", "4",
-        "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" ];
-
-    /** Decimal digits. */
-    protected static const DECIMAL :Array = [ "0", "1", "2", "3", "4",
-        "5", "6", "7", "8", "9" ];
-
-    /** A regular expression that finds URLs. */
-    protected static const URL_REGEXP :RegExp =
-        new RegExp("(http|https|ftp)://\\S+", "i");
-}
-}


StringUtil.parseNumber

StringUtil.parseNumber

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

--- src/as/com/threerings/util/StringUtil.as
+++ src/as/com/threerings/util/StringUtil.as
@@ -22,7 +22,6 @@
 package com.threerings.util {

 import flash.utils.ByteArray;
-
 import flash.utils.describeType; // function import

 public class StringUtil
@@ -124,6 +123,48 @@
                 "].");
         }
         return uint(result);
+    }
+
+    /**
+     * Parse a Number from a String, throwing an ArgumentError if there are any
+     * invalid characters.
+     *
+     * 1.5, 2e-3, -Infinity, Infinity, and NaN are all valid Strings.
+     *
+     * @param str the String to parse.
+     */
+    public static function parseNumber (str :String) :Number
+    {
+        var originalString :String = str;
+
+        if (str == null) {
+            throw new ArgumentError("Cannot parseNumber(null)");
+        }
+
+        // deal with a few special cases
+        if (str == "Infinity") {
+            return Infinity;
+        } else if (str == "-Infinity") {
+            return -Infinity;
+        } else if (str == "NaN") {
+            return NaN;
+        }
+
+        // validate all characters before the "e"
+        str = validateDecimal(str, true, true);
+
+        // validate all characters after the "e"
+        if (null != str && str.charAt(0) == "e") {
+            str = str.substring(1);
+            validateDecimal(str, false, false);
+        }
+
+        if (null == str) {
+            throw new ArgumentError("Could not convert '" + originalString + "' to Number");
+        }
+
+        // let Flash do the actual conversion
+        return parseFloat(originalString);
     }

     /**
@@ -389,6 +430,49 @@
     }

     /**
+     * Internal helper function for parseNumber.
+     */
+    protected static function validateDecimal (str :String, allowDot :Boolean, allowTrailingE :Boolean) :String
+    {
+        // skip the leading minus
+        if (str.charAt(0) == "-") {
+            str = str.substring(1);
+        }
+
+        // validate that the characters in the string are all integers,
+        // with at most one '.'
+        var seenDot :Boolean;
+        var seenDigit :Boolean;
+        while (str.length > 0) {
+            var char :String = str.charAt(0);
+            if (char == ".") {
+                if (!allowDot || seenDot) {
+                    return null;
+                }
+                seenDot = true;
+            } else if (char == "e") {
+                if (!allowTrailingE) {
+                    return null;
+                }
+                break;
+            } else if (DECIMAL.indexOf(char) >= 0) {
+                seenDigit = true;
+            } else {
+                return null;
+            }
+
+            str = str.substring(1);
+        }
+
+        // ensure we've seen at least one digit so far
+        if (!seenDigit) {
+            return null;
+        }
+
+        return str;
+    }
+
+    /**
      * Internal helper function for parseInteger and parseUnsignedInteger.
      */
     protected static function parseInt0 (str :String, radix :uint, allowNegative :Boolean) :Number
@@ -446,6 +530,10 @@
     protected static const HEX :Array = [ "0", "1", "2", "3", "4",
         "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" ];

+    /** Decimal digits. */
+    protected static const DECIMAL :Array = [ "0", "1", "2", "3", "4",
+        "5", "6", "7", "8", "9" ];
+
     /** A regular expression that finds URLs. */
     protected static const URL_REGEXP :RegExp =
         new RegExp("(http|https|ftp)://\\S+", "i");


made all URLs protocol relative

made all URLs protocol relative

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

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

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

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


Terrible bug wrt Arg Schemes fixed: only if appended to every scheme

--- Arguments/src/Model/ArgumentTypeModel.as
+++ Arguments/src/Model/ArgumentTypeModel.as
@@ -24,6 +24,7 @@
 	import mx.rpc.events.FaultEvent;
 	import mx.rpc.events.ResultEvent;
 	import mx.rpc.http.HTTPService;
+	import mx.rpc.xml.SchemaTypeRegistry;

 	[Bindable]
 	public class ArgumentTypeModel extends EventDispatcher
@@ -187,7 +188,7 @@
 			var  dbScheme:String = AGORAModel.getInstance().dbSchemeHashMap[logicClass];
 			var  dbLanguage:String = AGORAModel.getInstance().dbLanguageHashMap[language];
 			var  dbLanguageSubOption:String = "";
-			if(language == AGORAParameters.getInstance().ONLY_IF){
+			if((language == AGORAParameters.getInstance().ONLY_IF) && logicClass == AGORAParameters.getInstance().MOD_TOL){
 				if(reasonModels.length > 1){
 					if(lSubOption == AGORAParameters.getInstance().AND){
 						return dbScheme + "onlyifand";
@@ -196,10 +197,11 @@
 						return dbScheme + "onlyifor";
 					}
 				}
-			}
-			else{
-				return dbScheme + "onlyif";
-			}
+				else{
+					return dbScheme + "onlyif";
+				}
+			}
+
 			return dbScheme + (dbLanguage==null?"":dbLanguage) + dbLanguageSubOption;
 		}

@@ -337,7 +339,6 @@
 			var inputXML:XML = <map ID={AGORAModel.getInstance().agoraMapModel.ID}/>;
 			tid=1;
 			inputXML.appendChild(getXML());
-			//trace(inputXML.toXMLString());
 			//convert temporary boxes to proper ones
 			if(logicClass == AGORAParameters.getInstance().COND_SYLL){
 				inputXML = substituteTemporaryBoxes(claimModel, inputXML);


421 Minor documentation

421 Minor documentation

--- raw/src/org/yellcorp/lib/core/ArrayUtil.as
+++ raw/src/org/yellcorp/lib/core/ArrayUtil.as
@@ -489,8 +489,9 @@

     /**
-     * Returns a copy of an array with equal items removed.  Equality
-     * checking is strict (===).
+     * Returns a copy of an array containing one copy of each unique
+     * element.  Uniqueness is defined by strict equality
+     * (===).
      */
     public static function unique(array:*):Array
     {


Removing unecessary cast from untyped value

--- raw/src/org/yellcorp/lib/core/EmbedUtil.as
+++ raw/src/org/yellcorp/lib/core/EmbedUtil.as
@@ -7,7 +7,7 @@
 {
     public static function bytesToString(embedClass:Class):String
     {
-        var bytes:ByteArray = ByteArray(new embedClass());
+        var bytes:ByteArray = new embedClass();
         return bytes.readUTFBytes(bytes.bytesAvailable);
     }
 }


remove errant newline

remove errant newline

--- runtime/src/main/as/flump/display/Movie.as
+++ runtime/src/main/as/flump/display/Movie.as
@@ -208,7 +208,6 @@
      * for updates that are the result of a "goTo" call.
      */
     protected function updateFrame (newFrame :int, dt :Number) :void {
-
         if (newFrame < 0 || newFrame >= _numFrames) {
             throw new Error("Invalid frame [frame=" + newFrame,
                 " validRange=0-" + (_numFrames - 1) + "]");


Removed removeChildern() method as it is provided by flex 4.6

--- library/src/flexlib/controls/ImageMap.as
+++ library/src/flexlib/controls/ImageMap.as
@@ -357,19 +357,6 @@

     /**
      * @private
-     * I don't know why UIComponent doesn't have a removeAllChildren() method, but this
-     * method just does that, removes all children of the areaHolder.
-     */
-    private function removeChildren():void
-    {
-      while (areaHolder.numChildren > 0)
-      {
-        areaHolder.removeChildAt(0);
-      }
-    }
-
-    /**
-     * @private
      * We're basically re-creating the functionality of all the mouse events. But we need
      * to dispatch our custom ImageMapEvent so we can pass back the link information as well
      * as the basic mouse event info. So I've recreated the click, double-click, down, up, over,


Modify KrewActor.dispose

Modify KrewActor.dispose

--- krew-framework/krewfw/core/KrewActor.as
+++ krew-framework/krewfw/core/KrewActor.as
@@ -179,6 +179,7 @@
             _initFuncList      = null;
             _imageList         = null;
             _textList          = null;
+            _displayObjList    = null;
             _childActors       = null;
             _actionInstructors = null;
             _timeKeeper        = null;


Treat empty textedit as 0 value when editing material shader parameters.

--- Bin/Data/Scripts/Editor/EditorMaterial.as
+++ Bin/Data/Scripts/Editor/EditorMaterial.as
@@ -264,7 +264,7 @@

     Variant oldValue = editMaterial.shaderParameters[name];
     Array<String> coordValues = oldValue.ToString().Split(' ');
-    coordValues[coordinate] = attrEdit.text;
+    coordValues[coordinate] = String(attrEdit.text.ToFloat());

     String valueString;
     for (uint i = 0; i < coordValues.length; ++i)