Cleaned up trace statements on component

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

--- src/laml/display/Component.as
+++ src/laml/display/Component.as
@@ -698,33 +698,24 @@

 		public function getBitmapByName(alias:String):DisplayObject {
 			var result:DisplayObject;
-
-			trace("1 >> getBitmapByName");
-
 			if(hasOwnProperty(alias)) {
-			trace("2 >> getBitmapByName");
 				return new this[alias]() as DisplayObject;
 			}

 			if(skin) {
-			trace("3 >> getBitmapByName");
 				result = skin.getBitmapByName(alias);
 				if(result) {
-			trace("4 >> getBitmapByName");
 					return result;
 				}
 			}

 			if(parent) {
-			trace("5 >> getBitmapByName");
 				result = parent.getBitmapByName(alias);
 				if(result) {
-			trace("6 >> getBitmapByName");
 					return result;
 				}
 			}

-			trace("7 >> getBitmapByName");
 			var bitmapData:BitmapData = new BitmapData(1, 1);
 			return new Bitmap(bitmapData);
 		}


Transferred from the Adobe Open Source Subversion Repository

Revision: 5101
Author:   gauravj@adobe.com
Date:     2009-02-27T05:22:45.887116Z

Log Message:
-----------
Update action script files with asdoc version tags.

QE Notes: None.
Doc Notes: Please review and update as necessary.
tests: checkintests

Modified Paths:
--------------
663 paths were modified

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

--- frameworks/projects/framework/src/mx/core/UIComponentGlobals.as
+++ frameworks/projects/framework/src/mx/core/UIComponentGlobals.as
@@ -91,6 +91,11 @@
      *  never need to check this flag, but if a component needs to
      *  have different behavior at design time than at runtime, then it
      *  can check this flag.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public static function get designMode():Boolean
     {
@@ -113,6 +118,11 @@
     /**
      *  A global flag that can is used to catch unhandled exceptions
      *  during execution of methods executed via callLater
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public static function get catchCallLaterExceptions():Boolean
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 23243
Author:   cframpto@adobe.com
Date:     2011-12-20T00:59:57.384047Z

Log Message:
-----------
In frameworks, remove Adobe headers from all files except xml/mxml file types.  There are also a few .txt files that are license files that I didn't touch yet.

Modified Paths:
--------------
2361 paths were modified

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

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

 package mx.managers
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 4885
Author:   jszeto@adobe.com
Date:     2009-02-07T00:12:32.609062Z

Log Message:
-----------
Flex SDK Framework - Update mx.filters API and class hierarchy

- Removed BaseFilter.as, BaseDimensionFilter.as, and GradientFilter.as
- Renamed IBitmapFilter.as to IFlexBitmapFilter.as
- Changed IBitmapFilter.clone to createBitmapFilter
- Moved properties and functions from base classes up to filter subclasses
- Changed ColorMatrixFilter constructor parameter from Array to Object
- Added Change metadata to all filter classes
- Changed notifyFilterChanged from public to private
- Added ASDoc comments
- Added copyright info
- Added a number of formatting and style fixes

QE Notes: Need to update tests based on API changes. Missing tests for DisplacementMapFilter.as.
Doc Notes: Need extensive ASDoc review. Consider using @copy for properties that match the flash.filters properties
Bugs: n/a
Reviewer: Gordon

Modified Paths:
--------------
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/filters/BaseDimensionFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/BevelFilter.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/GradientFilter.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/filters/IBitmapFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/ColorMatrixFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/BlurFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/DisplacementMapFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/ShaderFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/StrokedElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/GlowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/DropShadowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/GradientBevelFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/Parser.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/framework/src/mx/filters/IBitmapFilter.as" copyfrom-rev="4821" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/filters/IFlexBitmapFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/ConvolutionFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateFilterInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimateFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/FrameworkClasses.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/filters/BaseFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/filters/GradientGlowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>

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

--- frameworks/projects/spark/src/spark/filters/DropShadowFilter.as
+++ frameworks/projects/spark/src/spark/filters/DropShadowFilter.as
@@ -1,12 +1,53 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2003-2008 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
 package mx.filters
 {
+import flash.events.Event;
+import flash.events.EventDispatcher;
 import flash.filters.BitmapFilter;
+import flash.filters.BitmapFilterQuality;
 import flash.filters.DropShadowFilter;
-import mx.filters.BaseDimensionFilter;
-import mx.filters.IBitmapFilter;
-
-public class DropShadowFilter extends BaseDimensionFilter implements IBitmapFilter
+import mx.filters.IFlexBitmapFilter;
+
+/**
+ *  @review
+ *  Dispatched when a property value has changed.
+ */
+[Event(name="change", type="flash.events.Event")]
+
+/**
+ *  @review
+ *
+ * 	The mx.filters.DropShadowFilter class is based on flash.filters.DropShadowFilter
+ *  but adds support for dynamically updating property values.
+ *  When a property changes, it dispatches an event that tells the filter owner to
+ *  reapply the filter. Use this class instead of flash.filters.DropShadowFilter if
+ *  you plan to dynamically change the filter property values.
+ *
+ *  @see flash.filters.DropShadowFilter
+ */
+public class DropShadowFilter extends EventDispatcher implements IFlexBitmapFilter
 {
+	include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 * @copy flash.filters.DropShadowFilter
+	 */
 	public function DropShadowFilter(distance:Number = 4.0, angle:Number = 45,
 									 color:uint = 0, alpha:Number = 1.0,
 									 blurX:Number = 4.0, blurY:Number = 4.0,
@@ -15,6 +56,8 @@
 									 knockout:Boolean = false,
 									 hideObject:Boolean = false)
 	 {
+	 	super();
+
 	 	this.distance = distance;
 	 	this.angle = angle;
 	 	this.color = color;
@@ -27,6 +70,12 @@
 	 	this.knockout = knockout;
 	 	this.hideObject = hideObject;
 	 }
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties
+	//
+	//--------------------------------------------------------------------------

 	//----------------------------------
     //  alpha
@@ -82,7 +131,58 @@
 			notifyFilterChanged();
 		}
 	}
-
+
+	//----------------------------------
+    //  blurX
+    //----------------------------------
+
+	private var _blurX:Number = 4.0;
+
+	/**
+	 *  The amount of horizontal blur. Valid values are 0 to 255. A blur of 1
+	 *  or less means that the original image is copied as is. The default
+	 *  value is 4. Values that are a power of 2 (such as 2, 4, 8, 16, and 32)
+	 *  are optimized to render more quickly than other values.
+	 */
+	public function get blurX():Number
+	{
+		return _blurX;
+	}
+
+	public function set blurX(value:Number):void
+	{
+		if (value != _blurX)
+		{
+			_blurX = value;
+			notifyFilterChanged();
+		}
+	}
+
+	//----------------------------------
+    //  blurY
+    //----------------------------------
+
+	private var _blurY:Number = 4.0;
+
+	/**
+	 *  The amount of vertical blur. Valid values are 0 to 255. A blur of 1
+	 *  or less means that the original image is copied as is. The default
+	 *  value is 4. Values that are a power of 2 (such as 2, 4, 8, 16, and 32)
+	 *  are optimized to render more quickly than other values.
+	 */
+	public function get blurY():Number
+	{
+		return _blurY;
+	}
+
+	public function set blurY(value:Number):void
+	{
+		if (value != _blurY)
+		{
+			_blurY = value;
+			notifyFilterChanged();
+		}
+	}
 	//----------------------------------
     //  color
     //----------------------------------
@@ -180,8 +280,122 @@
 			notifyFilterChanged();
 		}
 	}
-
-	public function clone():BitmapFilter
+
+	//----------------------------------
+    //  knockout
+    //----------------------------------
+
+	private var _knockout:Boolean = false;
+
+	/**
+	 *  Specifies whether the object has a knockout effect. A knockout effect
+	 *  makes the object's fill transparent and reveals the background color
+	 *  of the document. The value true specifies a knockout effect; the
+	 *  default value is false (no knockout effect).
+	 */
+	public function get knockout():Boolean
+	{
+		return _knockout;
+	}
+
+	public function set knockout(value:Boolean):void
+	{
+		if (value != _knockout)
+		{
+			_knockout = value;
+			notifyFilterChanged();
+		}
+	}
+
+	//----------------------------------
+    //  quality
+    //----------------------------------
+
+	private var _quality:int = BitmapFilterQuality.LOW;
+
+	/**
+	 *  The number of times to apply the filter. The default value is
+	 *  BitmapFilterQuality.LOW, which is equivalent to applying the filter
+	 *  once. The value BitmapFilterQuality.MEDIUM  applies the filter twice;
+	 *  the value BitmapFilterQuality.HIGH applies it three times. Filters
+	 *  with lower values are rendered more quickly.
+	 *
+	 *  For most applications, a quality value of low, medium, or high is
+	 *  sufficient. Although you can use additional numeric values up to 15
+	 *  to achieve different effects, higher values are rendered more slowly.
+	 *  Instead of increasing the value of quality, you can often get a similar
+	 *  effect, and with faster rendering, by simply increasing the values of
+	 *  the blurX and blurY properties.
+	 */
+	public function get quality():int
+	{
+		return _quality;
+	}
+
+	public function set quality(value:int):void
+	{
+		if (value != _quality)
+		{
+			_quality = value;
+			notifyFilterChanged();
+		}
+	}
+
+	//----------------------------------
+    //  strength
+    //----------------------------------
+
+	private var _strength:Number = 1;
+
+	/**
+	 *  The strength of the imprint or spread. The higher the value, the more
+	 *  color is imprinted and the stronger the contrast between the glow and
+	 *  the background. Valid values are 0 to 255. A value of 0 means that the
+	 *  filter is not applied. The default value is 1.
+	 */
+	public function get strength():Number
+	{
+		return _strength;
+	}
+
+	public function set strength(value:Number):void
+	{
+		if (value != _strength)
+		{
+			_strength = value;
+			notifyFilterChanged();
+		}
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Methods
+	//
+	//--------------------------------------------------------------------------
+
+   	/**
+     * @private
+     * Notify of a change to our filter, so that filter stack is ultimately
+     * re-applied by the framework.
+     */
+	private function notifyFilterChanged():void
+	{
+		dispatchEvent(new Event(Event.CHANGE));
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  IFlexBitmapFilter
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Creates a flash.filters.DropShadowFilter instance using the current
+	 *  property values.
+	 *
+	 *  @return flash.filters.DropShadowFilter instance
+	 */
+	public function createBitmapFilter():BitmapFilter
 	{
 		return new flash.filters.DropShadowFilter(distance, angle, color, alpha, blurX,
 												  blurY, strength, quality, inner,


Transferred from the Adobe Open Source Subversion Repository

Revision: 22646
Author:   mhorn@adobe.com
Date:     2011-09-20T14:43:51.831864Z

Log Message:
-----------
asdoc updates

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/SpinnerListSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/DateSpinnerSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/DateSpinnerItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SpinnerList.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/DateSpinnerItemRenderer.as
+++ frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/DateSpinnerItemRenderer.as
@@ -23,6 +23,8 @@
  *  The DateSpinnerItemRenderer class defines the default item renderer
  *  for a DateSpinner control in the mobile theme.
  *  This is a simple item renderer with a single text component.
+ *
+ * @see spark.components.DateSpinner
  *
  *  @langversion 3.0
  *  @playerversion AIR 3
@@ -57,7 +59,7 @@
     //--------------------------------------------------------------------------

     /**
-     *  @inheritDoc
+     *  @private
      *
      *  @langversion 3.0
      *  @playerversion AIR 3
@@ -87,7 +89,7 @@
     //--------------------------------------------------------------------------

     /**
-     *  @inheritDoc
+     *  @private
      *
      *  @langversion 3.0
      *  @playerversion AIR 3
@@ -113,7 +115,7 @@
     }

     /**
-     *  @inheritDoc
+     *  @private
      *
      *  @langversion 3.0
      *  @playerversion AIR 3


Removed 'from' in hint if source is labeled carrier

--- src/Displays/DCurrent.as
+++ src/Displays/DCurrent.as
@@ -68,7 +68,7 @@
 			var source:Port = carrier.getSource();
 			if (source) {
 				displayText += source.getValue();
-				if (source.name)
+				if (source != carrier && source.name)
 					displayText += " from " + source.name;
 			} else
 				displayText += "No source";


Fix little bug

Fix little bug

--- krew-framework/krewfw/builtin_actor/KrewState.as
+++ krew-framework/krewfw/builtin_actor/KrewState.as
@@ -299,9 +299,9 @@
         public function dumpTree(level:int=0):void {
             var indent:String = krew.str.repeat(" ", level * 4);

-            var toList:Array  = [];
+            var toList:Array = [];
             if (listenList != null) {
-                listenList.map(function(elem:Object, index:int, array:Array):String {
+                toList = listenList.map(function(elem:Object, index:int, array:Array):String {
                     return elem.to;
                 });
             }


Added getContent() to get the top-level DisplayObject from a loaded SWF.

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

--- src/as/com/threerings/util/EmbeddedSwfLoader.as
+++ src/as/com/threerings/util/EmbeddedSwfLoader.as
@@ -1,12 +1,17 @@
 package com.threerings.util {

+import flash.display.DisplayObject;
 import flash.display.Loader;
 import flash.display.LoaderInfo;
+
 import flash.errors.IllegalOperationError;
+
 import flash.events.Event;
 import flash.events.EventDispatcher;
 import flash.events.IOErrorEvent;
+
 import flash.utils.ByteArray;
+
 import flash.system.ApplicationDomain;
 import flash.system.LoaderContext;

@@ -45,6 +50,15 @@
     }

     /**
+     * Get the top-level display object defined in the loaded SWF.
+     */
+    public function getContent () :DisplayObject
+    {
+        checkLoaded();
+        return _loader.content;
+    }
+
+    /**
      * Retrieves a class definition from the loaded swf.
      *
      * @throws IllegalOperationError when the swf has not completed loading or the class does
@@ -74,9 +88,7 @@
      */
     public function getSymbol (symbolName :String) :Object
     {
-        if (!checkLoaded()) {
-            throw new IllegalOperationError("SWF has not completed loading");
-        }
+        checkLoaded();
         try {
             return _loader.contentLoaderInfo.applicationDomain.getDefinition(symbolName);
         } catch (e: Error) {
@@ -92,19 +104,20 @@
      */
     public function isSymbol (className :String) :Boolean
     {
-        if (!checkLoaded()) {
-            throw new IllegalOperationError("SWF has not completed loading");
-        }
+        checkLoaded();
         return _loader.contentLoaderInfo.applicationDomain.hasDefinition(className);
     }

     /**
-     * Returns true if we've completed loaded the swf.
+     * Validate that the load operation is complete.
      */
-    protected function checkLoaded () :Boolean
+    protected function checkLoaded () :void
     {
         var loaderInfo :LoaderInfo = _loader.contentLoaderInfo;
-        return !(loaderInfo.bytesTotal == 0 || loaderInfo.bytesLoaded != loaderInfo.bytesTotal);
+        if (loaderInfo.bytesTotal == 0 || loaderInfo.bytesLoaded != loaderInfo.bytesTotal) {
+
+            throw new IllegalOperationError("SWF has not completed loading");
+        }
     }

     protected var _loader :Loader;


- bugfix: the Label component didn't position its content properly if the text didn't change during a validation and the textfield was shrunk before. (Shrinking is applied to decrease the hit target to the absolute minimum necessary to display the content)

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

--- src/reprise/controls/Label.as
+++ src/reprise/controls/Label.as
@@ -280,8 +280,6 @@
 			{
 				return;
 			}
-			m_labelDisplay.x = m_currentStyles.paddingLeft - 2;
-			m_labelDisplay.y = m_currentStyles.paddingTop - 2;

 			m_internalStyleIndex = 0;
 			m_textAlignment = null;
@@ -306,6 +304,23 @@

 			m_textSetExternally = false;
 			applyLabel(labelXML);
+
+			//apply final positioning
+			m_labelDisplay.y = m_currentStyles.paddingTop - 2;
+			if (m_textAlignment == 'left')
+			{
+				m_labelDisplay.x = m_currentStyles.paddingLeft - 2;
+			}
+			else if (m_textAlignment == 'right')
+			{
+				m_labelDisplay.x = m_currentStyles.paddingLeft +
+					m_currentStyles.width - m_labelDisplay.width + 2;
+			}
+			else if (m_textAlignment == 'center')
+			{
+				m_labelDisplay.x = m_currentStyles.paddingLeft + Math.round(
+					m_currentStyles.width / 2 - m_labelDisplay.width / 2);
+			}
 		}

 		protected function applyLabel(labelXML : XML) : void
@@ -347,40 +362,27 @@
 			}
 			m_labelDisplay.autoSize = 'none';

+			m_overflowIsInvalid = true;
+
 			//shrink the TextField to the smallest width possible
-			if (m_textAlignment != 'mixed' && !m_containsImages)
-			{
-				if (m_labelDisplay.textWidth < m_labelDisplay.width - 10)
-				{
-					var correctTextHeight : Number = m_labelDisplay.textHeight;
-					var correctTextWidth : Number = m_labelDisplay.textWidth;
-					var originalWidth : Number = m_labelDisplay.width;
-					m_labelDisplay.width = m_labelDisplay.textWidth + 10;
-					if (m_labelDisplay.textHeight != correctTextHeight ||
-						m_labelDisplay.textWidth != correctTextWidth)
-					{
-						/* in some cases, the TextField incorrectly wraps text to the next line
-						 * even though there's plenty enough room for it on the current line.
-						 * In case such an incorrect wrapping occurs after shrinking the TextField,
-						 * we have to roll it back.
-						 */
-						m_labelDisplay.width = originalWidth;
-					}
-					else if (m_textAlignment == 'right')
-					{
-						m_labelDisplay.x = m_currentStyles.paddingLeft +
-							m_currentStyles.width - m_labelDisplay.width + 2;
-					}
-					else if (m_textAlignment == 'center')
-					{
-						m_labelDisplay.x = m_currentStyles.paddingLeft + Math.round(
-							m_currentStyles.width / 2 -
-							m_labelDisplay.width / 2);
-					}
-				}
-			}
-
-			m_overflowIsInvalid = true;
+			if (m_textAlignment != 'mixed' && !m_containsImages &&
+				m_labelDisplay.textWidth < m_labelDisplay.width - 10)
+			{
+				var correctTextHeight : Number = m_labelDisplay.textHeight;
+				var correctTextWidth : Number = m_labelDisplay.textWidth;
+				var originalWidth : Number = m_labelDisplay.width;
+				m_labelDisplay.width = m_labelDisplay.textWidth + 10;
+				if (m_labelDisplay.textHeight != correctTextHeight ||
+					m_labelDisplay.textWidth != correctTextWidth)
+				{
+					/* in some cases, the TextField incorrectly wraps text to the next line
+					 * even though there's plenty enough room for it on the current line.
+					 * In case such an incorrect wrapping occurs after shrinking the TextField,
+					 * we have to roll it back.
+					 */
+					m_labelDisplay.width = originalWidth;
+				}
+			}
 		}

 		protected override function applyInFlowChildPositions() : void


view structure:
	- bugfix: re-enabled adding UIObjects to UIComponents

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

--- src/reprise/ui/UIComponent.as
+++ src/reprise/ui/UIComponent.as
@@ -1982,14 +1982,14 @@
 		protected function applyOutOfFlowChildPositions() : void
 		{
 			m_layoutManager.applyAbsolutePositions(this, m_children);
-			for each (var child : UIComponent in m_children)
-			{
-				if (!child || !child.isRendered())
-				{
-					//only deal with children that derive from UIComponent
+			for each (var child : UIObject in m_children)
+			{
+				//only deal with rendered children that derive from UIComponent
+				if (!(child is UIComponent) || !UIComponent(child).isRendered())
+				{
 					continue;
 				}
-				child.applyOutOfFlowChildPositions();
+				UIComponent(child).applyOutOfFlowChildPositions();
 			}
 			super.calculateKeyLoop();
 		}


ChromelessPlayer.as: add default play() position : set it to -1

--- src/org/mangui/chromeless/ChromelessPlayer.as
+++ src/org/mangui/chromeless/ChromelessPlayer.as
@@ -309,7 +309,7 @@
             _hls.load(url);
         };

-        protected function _play(position : Number) : void {
+        protected function _play(position : Number=-1) : void {
             _hls.stream.play(null, position);
         };


Finished off schema loading code

Finished off schema loading code

--- as3/xobjas3/src/com/rpath/xobj/XObjSchemaValidator.as
+++ as3/xobjas3/src/com/rpath/xobj/XObjSchemaValidator.as
@@ -37,7 +37,9 @@

     public var schemaLoaded:Boolean;

-    public var errorString:String;
+    public var message:String;
+
+    public var schemaXML:XML;

     public function XObjSchemaValidator(schemaUrl:String=null)
     {
@@ -62,34 +64,36 @@

     private function schemaLoader_loadHandler(event:SchemaLoadEvent):void
     {
-        trace("schemaLoader_loadHandler " + event.schema);
         setXMLSchema(event.schema);
-
     }

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

     private function schemaLoader_faultHandler(event:FaultEvent):void
     {
-        errorString = event.fault.toString();
+        message = event.fault.toString();
     }

     private function setXMLSchema(value:Schema):void
     {
         schema = value;

-        //Add the loaded schema to the SchemaManager
-        schemaManager.addSchema(schema);
-
-        //Map the XSD type "example" to the ActionScript class ExampleVO
-        var schemaTypeRegistry:SchemaTypeRegistry;
-        schemaTypeRegistry = SchemaTypeRegistry.getInstance();
-        //schemaTypeRegistry.registerClass(new QName(schema.targetNamespace.uri, "example"), ExampleVO);
+        if (schema)
+        {
+            schemaXML = schema.xml;
+
+            //Add the loaded schema to the SchemaManager
+            schemaManager.addSchema(schema);
+
+            var schemaTypeRegistry:SchemaTypeRegistry;
+            schemaTypeRegistry = SchemaTypeRegistry.getInstance();
+        }

         schemaLoaded = true;
+        message = null;
     }
 }
 }


85 Changed isClose to return false for a==null && b==null

--- raw/src/org/yellcorp/geom/Vector2.as
+++ raw/src/org/yellcorp/geom/Vector2.as
@@ -163,11 +163,10 @@
         var dx:Number;
         var dy:Number;

-        if (!a && !b)
-        {
-            return true;
-        }
-        else if (!a || !b)
+        // different semantics to isEqual: an absence of both
+        // vectors means equality, but is a null vector 'close' to
+        // another null vector? i dunno. i think no.
+        if (!a || !b)
         {
             return false;
         }


Added a second tier sort to the Metadata sorter. Now, if the numerical order values are equal, it defaults to sorting alphabetically

--- FlexUnit4/src/org/flexunit/runner/manipulation/MetadataSorter.as
+++ FlexUnit4/src/org/flexunit/runner/manipulation/MetadataSorter.as
@@ -85,9 +85,23 @@
 			return order;
 		}

+		private static function getClassName( description:IDescription ):String {
+			var methodName:String;
+
+			if ( description && description.displayName ) {
+				var namePieces:Array = description.displayName.split( '.' );
+				if ( namePieces && namePieces.length > 1 ) {
+					methodName = namePieces[namePieces.length-1];
+				}
+			}
+
+			return methodName;
+		}
+
 		/**
 		 * Compares its two arguments for order. Returns a negative integer, zero, or a positive integer
-		 * as the first argument is less than, equal to, or greater than the second.
+		 * as the first argument is less than, equal to, or greater than the second. If the two objects are
+		 * of equal order number, then we are simply going to return them in alphabetical order..
 		 *
 		 * @param o1 IDescription the first object to be compared.
 		 * @param o2 IDescription the second object to be compared.
@@ -119,6 +133,15 @@
 			if (a > b)
 				return 1;

+			var o1Name:String = getClassName( o1 );
+			var o2Name:String = getClassName( o2 );
+
+			//Determine the ordering of the two respected names
+			if (o1Name < o2Name)
+				return -1;
+			if (o1Name > o2Name)
+				return 1;
+
 			return 0;
 		}
 	}


Transferred from the Adobe Open Source Subversion Repository

Revision: 20099
Author:   rfrishbe@adobe.com
Date:     2011-02-03T19:19:30.277796Z

Log Message:
-----------
Making LabelItemRenderer's isLastItem property mx_internal

QE notes: -
Doc notes:
Bugs: SDK-29315
Reviewer: Jason SJ
Tests run: checkintests
Is noteworthy for integration: No

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

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

--- frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
+++ frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
@@ -337,7 +337,7 @@
 	 *  @private
 	 *  Whether or not we're the last element in the list
 	 */
-	private var isLastItem:Boolean = false;
+	mx_internal var isLastItem:Boolean = false;

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


Fix merge issue from last night

Fix merge issue from last night

--- Arguments/src/Controller/logic/ModusTollens.as
+++ Arguments/src/Controller/logic/ModusTollens.as
@@ -67,14 +67,9 @@
 					break;
 				case langTypes[3]:
 					//if many reasons
-<<<<<<< HEAD
-					if(argumentTypeModel.reasonModels.length > 1){
-						output = "Select how you want to connect the reasons"; //TODO: Translate
-=======
 					var params:AGORAParameters = AGORAParameters.getInstance();
 					if(argumentTypeModel.reasonModels.length > 1 && argumentTypeModel.lSubOption == null){
-						output = "Select how you want to connect the reasons";
->>>>>>> ab3ad67409fc862e89b120320e0ec04ce3153aee
+						output = "Select how you want to connect the reasons";
 						argSelector.andor.x = argSelector.typeSelector.x + argSelector.typeSelector.width;
 						argSelector.andor.dataProvider = [params.AND, params.OR];
 						argSelector.andor.visible = argSelector.typeSelector.visible;


Transferred from the Adobe Open Source Subversion Repository

Revision: 23243
Author:   cframpto@adobe.com
Date:     2011-12-20T00:59:57.384047Z

Log Message:
-----------
In frameworks, remove Adobe headers from all files except xml/mxml file types.  There are also a few .txt files that are license files that I didn't touch yet.

Modified Paths:
--------------
2361 paths were modified

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

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

 package mx.rpc.http
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 20217
Author:   klin@adobe.com
Date:     2011-02-09T00:00:08.304340Z

Log Message:
-----------
Fix dispatching grid mouseUp and click events from Grid. Click was sometimes not being dispatched because FP checks the target underneath the mouse. In some cases between the edge of the renderer and separator, the target would change between the background and the selection indicator causing a mouse click from the player not to be dispatched. Fix is to check for a mouse up in the same cell. Also, in some cases when dragging in and out of the grid, mouseUp would be dispatched twice. The roll out handler was setting the dragInProgress flag to false which falsely indicated that the drag had completed when in fact the drag was still in progress.

QE notes: No
Doc notes: No
Bugs: SDK-29385, SDK-29409
Reviewer: Hans, Carol
Tests run: cyclone server
Is noteworthy for integration: No

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

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

--- frameworks/projects/spark/src/spark/components/Grid.as
+++ frameworks/projects/spark/src/spark/components/Grid.as
@@ -291,7 +291,6 @@
         addEventListener(MouseEvent.MOUSE_UP, grid_mouseUpHandler);
         addEventListener(MouseEvent.MOUSE_MOVE, grid_mouseMoveHandler);
         addEventListener(MouseEvent.ROLL_OUT, grid_mouseRollOutHandler);
-        addEventListener(MouseEvent.CLICK, grid_clickHandler);
         addEventListener(MouseEvent.DOUBLE_CLICK, grid_doubleClickHandler);
     }

@@ -3808,23 +3807,35 @@
         const eventColumnIndex:int = gridDimensions.getColumnIndexAt(eventGridXY.x, eventGridXY.y);

         var gridEventType:String;
+        var dispatchGridClick:Boolean;
         switch(event.type)
         {
             case MouseEvent.MOUSE_MOVE:
+            {
                 gridEventType = GridEvent.GRID_MOUSE_DRAG;
                 break;
+            }
             case MouseEvent.MOUSE_UP:
+            {
                 gridEventType = GridEvent.GRID_MOUSE_UP;
+                dispatchGridClick = (eventRowIndex == mouseDownRowIndex &&
+                                     eventColumnIndex == mouseDownColumnIndex);
                 break;
-            case MouseEvent.MOUSE_DOWN:
+            }
+            case MouseEvent.MOUSE_DOWN:
+            {
                 gridEventType = GridEvent.GRID_MOUSE_DOWN;
                 mouseDownRowIndex = eventRowIndex;
                 mouseDownColumnIndex = eventColumnIndex;
                 dragInProgress = true;
                 break;
-        }
-
-        dispatchGridEvent(event, gridEventType, eventGridXY, eventRowIndex, eventColumnIndex);
+            }
+        }
+
+        dispatchGridEvent(event, gridEventType, eventGridXY, eventRowIndex, eventColumnIndex);
+
+        if (dispatchGridClick)
+            dispatchGridEvent(event, GridEvent.GRID_CLICK, eventGridXY, eventRowIndex, eventColumnIndex);
     }

     /**
@@ -3875,9 +3886,6 @@
      */
     protected function grid_mouseRollOutHandler(event:MouseEvent):void
     {
-        // Handle the case where the mouse up happens outside the data grid.
-        dragInProgress = false
-
         if ((rollRowIndex != -1) || (rollColumnIndex != -1))
         {
             const eventStageXY:Point = new Point(event.stageX, event.stageY);
@@ -3917,30 +3925,8 @@
         const eventColumnIndex:int = gridDimensions.getColumnIndexAt(eventGridXY.x, eventGridXY.y);

         dispatchGridEvent(event, GridEvent.GRID_MOUSE_UP, eventGridXY, eventRowIndex, eventColumnIndex);
-    }
-
-    /**
-     *  @private
-     *  This method is called whenever a CLICK MouseEvent occurs on the grid if both
-     *  the corresponding down and up events occur within the same grid cell.
-     *  By default it dispatches a GRID_CLICK event.
-     *
-     *  @param event A CLICK MouseEvent from the grid.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    protected function grid_clickHandler(event:MouseEvent):void
-    {
-        const eventStageXY:Point = new Point(event.stageX, event.stageY);
-        const eventGridXY:Point = globalToLocal(eventStageXY);
-        const gridDimensions:GridDimensions = this.gridDimensions;
-        const eventRowIndex:int = gridDimensions.getRowIndexAt(eventGridXY.x, eventGridXY.y);
-        const eventColumnIndex:int = gridDimensions.getColumnIndexAt(eventGridXY.x, eventGridXY.y);
-
-        if ((eventRowIndex == mouseDownRowIndex) && (eventColumnIndex == mouseDownColumnIndex))
+
+        if (eventRowIndex == mouseDownRowIndex && eventColumnIndex == mouseDownColumnIndex)
             dispatchGridEvent(event, GridEvent.GRID_CLICK, eventGridXY, eventRowIndex, eventColumnIndex);
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 18012
Author:   klin@adobe.com
Date:     2010-10-05T00:00:22.476120Z

Log Message:
-----------
First pass for implementing column visibility. GridColumn's visible property works now except when toggling at run time. I've also changed the way we determine a column's width. Now, we first look at the explicit width, then the typical width, and finally, the default width of 150.

Grid.as
-Added two internal methods that calculate the next and previous column.visible==true column index.

GridLayout.as
-Modified the loops to loop through column.visible==true columns instead of all the columns.

GridDimensions.as
-Fixed getColumnWidth() and other methods to fall back on the typical cell width.
-The methods will now skip columns with a typical cell width of 0 (meaning they are column.visible==false).

ColumnHeaderBarLayout.as
-Modified updateDisplayList to only create renderers for the column.visible==true columns.

QE notes: No
Doc notes: No
Bugs: No
Reviewer: Hans
Tests run: cyclone server
Is noteworthy for integration: No

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

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

--- frameworks/projects/spark/src/spark/components/Grid.as
+++ frameworks/projects/spark/src/spark/components/Grid.as
@@ -3773,6 +3773,54 @@
     }

     /**
+     *  Returns the index of the next GridColumn.visible==true column
+     *  after index.
+     *  Returns -1 if there are no more visible columns.
+     *  To find the first GridColumn.visible==true column index, use
+     *  getNextVisibleColumnIndex(-1).
+     */
+    mx_internal function getNextVisibleColumnIndex(index:int):int
+    {
+        if (index < -1)
+            return -1;
+
+        const columns:IList = this.columns;
+        const columnsLength:int = (columns) ? columns.length : 0;
+
+        for (var i:int = index + 1; i < columnsLength; i++)
+        {
+            var column:GridColumn = columns.getItemAt(i) as GridColumn;
+            if (column && column.visible)
+                return i;
+        }
+
+        return -1;
+    }
+
+    /**
+     *  Returns the index of the previous GridColumn.visible==true column
+     *  before index.
+     *  Returns -1 if there are no more visible columns.
+     *  To find the last GridColumn.visible==true column index, use
+     *  getPreviousVisibleColumnIndex(columns.length).
+     */
+    mx_internal function getPreviousVisibleColumnIndex(index:int):int
+    {
+        const columns:IList = this.columns;
+        if (!columns || index > columns.length)
+            return -1;
+
+        for (var i:int = index - 1; i >= 0; i--)
+        {
+            var column:GridColumn = columns.getItemAt(i) as GridColumn;
+            if (column && column.visible)
+                return i;
+        }
+
+        return -1;
+    }
+
+    /**
      *  @private
      */
     private function initializeAnchorPosition():void


updating xmpp connection

updating xmpp connection

git-svn-id: c197267f952b24206666de142881703007ca05d5@9513 b35dd754-fafc-0310-a699-88a17e54d16e

--- src/org/jivesoftware/xiff/core/XMPPConnection.as
+++ src/org/jivesoftware/xiff/core/XMPPConnection.as
@@ -32,7 +32,6 @@
 	import flash.xml.XMLDocument;
 	import flash.xml.XMLNode;

-	import mx.controls.Alert;
 	import mx.utils.StringUtil;

 	import org.jivesoftware.xiff.data.IExtension;
@@ -130,7 +129,7 @@
 		/**
 		 * @private
 		 */
-		protected var socket:XMLSocket;
+		protected var _socket:XMLSocket;

 		/**
 		 * @private
@@ -199,13 +198,6 @@

 		public function XMPPConnection()
 		{
-			// Create the socket
-			socket = new XMLSocket();
-			socket.addEventListener(Event.CONNECT,socketConnected);
-			socket.addEventListener(IOErrorEvent.IO_ERROR,onIOError);
-			socket.addEventListener(Event.CLOSE,socketClosed);
-			socket.addEventListener(DataEvent.DATA,socketReceivedData);
-			socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR,securityError);

 			// Hash to hold callbacks for IQs
 			pendingIQs = new Object();
@@ -233,6 +225,10 @@
 		 */
 		public function connect( streamType:String = "terminatedStandard" ):Boolean
 		{
+
+			// Create the socket
+			_socket = _createXmlSocket();
+
 			active = false;
 			loggedIn = false;

@@ -260,7 +256,7 @@
 					closingStreamTag = new String( "</stream:stream>" );
 					break;
 			}
-			socket.connect( server, port );
+			_socket.connect( server, port );
 			return true;
 		}

@@ -272,7 +268,7 @@
 		{
 			if( isActive() ) {
 				sendXML( closingStreamTag );
-				socket.close();
+				_socket.close();
 				active = false;
 				loggedIn = false;
 				var event:DisconnectionEvent = new DisconnectionEvent();
@@ -294,7 +290,7 @@
 			if( isActive() ) {
 				if( o is IQ ) {
 	                var iq:IQ = o as IQ;
-	                if (iq.callbackName != null && iq.callbackScope != null)
+	                if ((iq.callbackName != null && iq.callbackScope != null) || iq.callback != null)
 	                {
 	                	addIQCallbackToPending( iq.id, iq.callbackName, iq.callbackScope, iq.callback );
 	                }
@@ -594,7 +590,7 @@

 			// Cancel everything by closing connection
 			try {
-				socket.close();
+				_socket.close();
 			}
 			catch (error:Error){

@@ -620,7 +616,7 @@

 			// If it's an error, handle it

-			if( iq.type == IQ.ERROR_TYPE ) {
+			if( iq.type == IQ.ERROR_TYPE && !pendingIQs[iq.id]) {
 				dispatchError( iq.errorCondition, iq.errorMessage, iq.errorType, iq.errorCode );
 			}
 			else {
@@ -629,7 +625,9 @@
 				if( pendingIQs[iq.id] !== undefined ) {
 					var callbackInfo:* = pendingIQs[iq.id];

-					callbackInfo.methodScope[callbackInfo.methodName].apply( callbackInfo.methodScope, [iq] );
+					if(callbackInfo.methodScope && callbackInfo.methodName) {
+						callbackInfo.methodScope[callbackInfo.methodName].apply( callbackInfo.methodScope, [iq] );
+					}
 					if (callbackInfo.func != null) {
 						callbackInfo.func( iq );
 					}
@@ -710,7 +708,6 @@
 		 * @private
 		 */
 		protected function securityError(event:SecurityErrorEvent):void{
-			Alert.show("there was a security error of type: " + event.type + "\nError: " + event.text);
 			trace("there was a security error of type: " + event.type + "\nError: " + event.text);
 			dispatchError( "not-authorized", "Not Authorized", "auth", 401 );
 		}
@@ -737,7 +734,7 @@
 				trace(someData);
 			}
 			// Data is untyped because it could be a string or XML
-			socket.send( someData );
+			_socket.send( someData );
 			var event:OutgoingDataEvent = new OutgoingDataEvent();
 			event.data = someData;
 			dispatchEvent( event );
@@ -949,5 +946,15 @@
 		{
 			ignoreWhitespace = val;
 		}
+
+		private function _createXmlSocket():XMLSocket {
+			var socket:XMLSocket = new XMLSocket(server, port);
+			socket.addEventListener(Event.CONNECT,socketConnected);
+			socket.addEventListener(IOErrorEvent.IO_ERROR,onIOError);
+			socket.addEventListener(Event.CLOSE,socketClosed);
+			socket.addEventListener(DataEvent.DATA,socketReceivedData);
+			socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR,securityError);
+			return socket;
+		}
 	}
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 23243
Author:   cframpto@adobe.com
Date:     2011-12-20T00:59:57.384047Z

Log Message:
-----------
In frameworks, remove Adobe headers from all files except xml/mxml file types.  There are also a few .txt files that are license files that I didn't touch yet.

Modified Paths:
--------------
2361 paths were modified

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

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

 package mx.charts
 {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/framework/src/mx/effects/Tween.as
+++ frameworks/projects/framework/src/mx/effects/Tween.as
@@ -0,0 +1,711 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2003-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.effects
+{
+
+import flash.events.EventDispatcher;
+import flash.events.IEventDispatcher;
+import flash.events.TimerEvent;
+import flash.utils.Timer;
+import flash.utils.getTimer;
+import mx.core.UIComponentGlobals;
+import mx.core.mx_internal;
+import mx.events.TweenEvent;
+
+use namespace mx_internal;
+/**
+ *  The Tween class defines a tween, a property animation performed
+ *  on a target object over a period of time.
+ *  That animation can be a change in position, such as performed by
+ *  the Move effect; a change in size, as performed by the Resize or
+ *  Zoom effects; a change in visibility, as performed by the Fade or
+ *  Dissolve effects; or other types of animations.
+ *
+ *
When defining tween effects, you typically create an instance
+ *  of the Tween class within your override of the
+ *  EffectInstance.play() method.
+ *  A Tween instance accepts the startValue,
+ *  endValue, and duration properties,
+ *  and an optional easing function to define the animation.

+ *
+ *
The Tween object invokes the
+ *  mx.effects.effectClasses.TweenEffectInstance.onTweenUpdate()
+ *  callback function on a regular interval on the effect instance
+ *  for the duration of the effect, passing to the
+ *  onTweenUpdate() method an interpolated value
+ *  between the startValue and endValue.
+ *  Typically, the callback function updates some property of the target object,
+ *  causing that object to animate over the duration of the effect.

+ *
+ *
When the effect ends, the Tween objects invokes the
+ *  mx.effects.effectClasses.TweenEffectInstance.onTweenEnd()
+ *  callback function, if you defined one.

+ *
+ *  @see mx.effects.TweenEffect
+ *  @see mx.effects.effectClasses.TweenEffectInstance
+ */
+public class Tween extends EventDispatcher
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    mx_internal static var activeTweens:Array = [];
+
+    /**
+     *  @private
+     */
+    private static var interval:Number = 10;
+
+    /**
+     *  @private
+     */
+    private static var timer:Timer = null;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  intervalTime
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Used by effects to get the current effect time tick.
+     */
+    mx_internal static var intervalTime:Number = NaN;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private static function addTween(tween:Tween):void
+    {
+        tween.id = activeTweens.length;
+
+        activeTweens.push(tween);
+
+        if (!timer)
+        {
+            timer = new Timer(interval);
+            timer.addEventListener(TimerEvent.TIMER, timerHandler);
+            timer.start();
+        }
+        else
+        {
+            timer.start();
+        }
+
+        if (isNaN(intervalTime))
+            intervalTime = getTimer();
+
+        tween.startTime = tween.previousUpdateTime = intervalTime;
+    }
+
+    /**
+     *  @private
+     */
+    private static function removeTweenAt(index:int):void
+    {
+        if (index >= activeTweens.length || index < 0)
+            return;
+
+        activeTweens.splice(index, 1);
+
+        var n:int = activeTweens.length;
+        for (var i:int = index; i < n; i++)
+        {
+            var curTween:Tween = Tween(activeTweens[i]);
+            curTween.id--;
+        }
+
+        if (n == 0)
+        {
+            intervalTime = NaN;
+            timer.reset();
+        }
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal static function removeTween(tween:Tween):void
+    {
+        removeTweenAt(tween.id);
+    }
+
+    /**
+     *  @private
+     */
+    private static function timerHandler(event:TimerEvent):void
+    {
+        var needToLayout:Boolean = false;
+
+        var oldTime:Number = intervalTime;
+        intervalTime = getTimer();
+
+        var n:int = activeTweens.length;
+
+        for (var i:int = n; i >= 0; i--)
+        {
+            var tween:Tween = Tween(activeTweens[i]);
+            if (tween)
+            {
+                tween.needToLayout = false;
+                tween.doInterval();
+
+                if (tween.needToLayout)
+                    needToLayout = true;
+            }
+        }
+
+        // If one of the effects requested a layout, do it now.
+        if (needToLayout)
+        {
+            UIComponentGlobals.layoutManager.validateNow();
+        }
+
+        event.updateAfterEvent();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *
When the constructor is called, the animation automatically
+     *  starts playing.

+     *
+     *  @param listener Object that is notified at each interval
+     *  of the animation. You typically pass the this
+     *  keyword as the value.
+     *  The listener must define the
+     *  onTweenUpdate() method and optionally the
+     *  onTweenEnd() method.
+     *  The former method is invoked for each interval of the animation,
+     *  and the latter is invoked just after the animation finishes.
+     *
+     *  @param startValue Initial value(s) of the animation.
+     *  Either a number or an array of numbers.
+     *  If a number is passed, the Tween interpolates
+     *  between this number and the number passed
+     *  in the endValue parameter.
+     *  If an array of numbers is passed,
+     *  each number in the array is interpolated.
+     *
+     *  @param endValue Final value(s) of the animation.
+     *  The type of this argument must match the startValue
+     *  parameter.
+     *
+     *  @param duration Duration of the animation, expressed in milliseconds.
+     *
+     *  @param minFps Minimum number of times that the
+     *  onTweenUpdate() method should be called every second.
+     *  The tween code tries to call the onTweenUpdate()
+     *  method as frequently as possible (up to 100 times per second).
+     *  However, if the frequency falls below minFps,
+     *  the duration of the animation automatically increases.
+     *  As a result, an animation that temporarily freezes
+     *  (because it is not getting any CPU cycles) begins again
+     *  where it left off, instead of suddenly jumping ahead.
+     *
+     *  @param updateFunction Specifies an alternative update callback
+     *  function to be used instead of listener.OnTweenUpdate()
+     *
+     *  @param endFunction Specifies an alternative end callback function
+     *  to be used instead of listener.OnTweenEnd()
+     */
+    public function Tween(listener:Object,
+                          startValue:Object, endValue:Object,
+                          duration:Number = -1, minFps:Number = -1,
+                          updateFunction:Function = null,
+                          endFunction:Function = null)
+    {
+        super();
+
+        if (!listener)
+            return;
+
+        if (startValue is Array)
+            arrayMode = true;
+
+        this.listener = listener;
+        this.startValue = startValue;
+        this.endValue = endValue;
+
+        if (!isNaN(duration) && duration != -1)
+            this.duration = duration;
+
+        // If user has specified a minimum number of frames per second,
+        // remember the maximum allowable milliseconds between frames.
+        if (!isNaN(minFps) && minFps != -1)
+            maxDelay = 1000 / minFps;
+
+        this.updateFunction = updateFunction;
+        this.endFunction = endFunction;
+
+        if (duration == 0)
+        {
+            id = -1; // use -1 to indicate that this tween was never added
+            endTween();
+        }
+        else
+            Tween.addTween(this);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    mx_internal var needToLayout:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var id:int;
+
+    /**
+     *  @private
+     */
+    private var maxDelay:Number = 87.5; // Min frames per second is 12
+
+    /**
+     *  @private
+     */
+    private var arrayMode:Boolean;
+
+    /**
+     *  @private
+     */
+    private var _doSeek:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var _isPlaying:Boolean = true;
+
+    /**
+     *  @private
+     */
+    private var _doReverse:Boolean = false;
+
+    /**
+     *  @private
+     */
+    mx_internal var startTime:Number;
+
+    /**
+     *  @private
+     */
+    private var previousUpdateTime:Number;
+
+    /**
+     *  @private
+     */
+    private var userEquation:Function = defaultEasingFunction;
+
+    /**
+     *  @private
+     */
+    private var updateFunction:Function;
+
+    /**
+     *  @private
+     */
+    private var endFunction:Function;
+
+    /**
+     *  @private
+     *  Final value(s) of the animation.
+     *  This can be a Number of an Array of Numbers.
+     */
+    private var endValue:Object;
+
+    /**
+     *  @private
+     *  Initial value(s) of the animation.
+     *  This can be a Number of an Array of Numbers.
+     */
+    private var startValue:Object;
+
+    /**
+     *  @private
+     */
+    private var started:Boolean = false;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  duration
+    //----------------------------------
+
+    /**
+     *  Duration of the animation, in milliseconds.
+     */
+    public var duration:Number = 3000;
+
+    //----------------------------------
+    //  listener
+    //----------------------------------
+
+    /**
+     *  Object that is notified at each interval of the animation.
+     */
+    public var listener:Object;
+
+    //----------------------------------
+    //  playheadTime
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the playheadTime property.
+     */
+    private var _playheadTime:Number = 0;
+
+    /**
+     *  @private
+     *  The current millisecond position in the tween.
+     *  This value is between 0 and duration.
+     *  Use the seek() method to change the position of the tween.
+     */
+    mx_internal function get playheadTime():Number
+    {
+        return _playheadTime;
+    }
+
+    //----------------------------------
+    //  playReversed
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the playReversed property.
+     */
+    private var _invertValues:Boolean = false;
+
+    /**
+     *  @private
+     *  Starts playing reversed from start of tween.
+     *  Setting this property to true
+     *  inverts the values returned by the tween.
+     *  Using reverse inverts the values and only plays
+     *  for as much time that has already elapsed.
+     */
+    mx_internal function get playReversed():Boolean
+    {
+        return _invertValues;
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal function set playReversed(value:Boolean):void
+    {
+        _invertValues = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  By default, the Tween class invokes the
+     *  mx.effects.effectClasses.TweenEffectInstance.onTweenUpdate()
+     *  callback function on a regular interval on the effect instance
+     *  for the duration of the effect, and the optional
+     *  mx.effects.effectClasses.TweenEffectInstance.onTweenEnd()
+     *  callback function at the end of the effect duration.
+     *
+     *
This method lets you specify different methods
+     *  as the update and the end callback functions.

+     *
+     *  @param updateFunction Specifies the update callback function.
+     *
+     *  @param endFunction Specifies the end callback function.
+     */
+    public function setTweenHandlers(updateFunction:Function,
+                                     endFunction:Function):void
+    {
+        this.updateFunction = updateFunction;
+        this.endFunction = endFunction;
+    }
+
+    /**
+     *  Sets the easing function for the animation.
+     *  The easing function is used to interpolate between
+     *  the startValue value and the endValue.
+     *  A trivial easing function does linear interpolation,
+     *  but more sophisticated easing functions create the illusion of
+     *  acceleration and deceleration, which makes the animation seem
+     *  more natural.
+     *
+     *
If no easing function is specified, an easing function based
+     *  on the Math.sin() method is used.

+     *
+     *
The easing function follows the function signature
+     *  popularized by Robert Penner.
+     *  The function accepts four arguments.
+     *  The first argument is the "current time",
+     *  where the animation start time is 0.
+     *  The second argument is a the initial value
+     *  at the beginning of the animation (a Number).
+     *  The third argument is the ending value
+     *  minus the initial value.
+     *  The fourth argument is the duration of the animation.
+     *  The return value is the interpolated value for the current time
+     *  (usually a value between the initial value and the ending value).

+     *
+     *
Flex includes a set of easing functions
+     *  in the mx.effects.easing package.

+     *
+     *  @param easingFunction Function that implements the easing equation.
+     */
+    public function set easingFunction(value:Function):void
+    {
+        userEquation = value;
+    }
+
+    /**
+     *  Interrupt the tween, jump immediately to the end of the tween,
+     *  and invoke the onTweenEnd() callback function.
+     */
+    public function endTween():void
+    {
+        var event:TweenEvent = new TweenEvent(TweenEvent.TWEEN_END);
+        var value:Object = getCurrentValue(duration);
+
+        event.value = value;
+
+        dispatchEvent(event);
+
+        if (endFunction != null)
+            endFunction(value);
+        else
+            listener.onTweenEnd(value);
+
+        // If tween has been added, id >= 0
+        // but if duration = 0, this might not be the case.
+        if (id >= 0)
+            Tween.removeTweenAt(id);
+    }
+
+    /**
+     *  @private
+     *  Returns true if the tween has ended.
+     */
+    mx_internal function doInterval():Boolean
+    {
+        var tweenEnded:Boolean = false;
+
+        // If user specified a minimum frames per second, we can't guarantee
+        // that we'll be called often enough to satisfy that request.
+        // However, we can avoid skipping over part of the animation.
+        // If this callback arrives too late, adjust the animation startTime,
+        // so that the animation starts up 'maxDelay' milliseconds
+        // after its last update.
+        /*
+        if (intervalTime - previousUpdateTime > maxDelay)
+        {
+            startTime += intervalTime - previousUpdateTime - maxDelay;
+        }
+        */
+        previousUpdateTime = intervalTime;
+
+        if (_isPlaying || _doSeek)
+        {
+
+            var currentTime:Number = intervalTime - startTime;
+            _playheadTime = currentTime;
+
+            var currentValue:Object =
+                getCurrentValue(currentTime);
+
+            if (currentTime >= duration && !_doSeek)
+            {
+                endTween();
+                tweenEnded = true;
+            }
+            else
+            {
+                if (!started)
+                {
+                    var startEvent:TweenEvent = new TweenEvent(TweenEvent.TWEEN_START);
+                    dispatchEvent(startEvent);
+                    started = true;
+                }
+
+                var event:TweenEvent =
+                    new TweenEvent(TweenEvent.TWEEN_UPDATE);
+                event.value = currentValue;
+
+                dispatchEvent(event);
+
+                if (updateFunction != null)
+                    updateFunction(currentValue);
+                else
+                    listener.onTweenUpdate(currentValue);
+            }
+
+            _doSeek = false;
+        }
+        return tweenEnded;
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal function getCurrentValue(currentTime:Number):Object
+    {
+        if (duration == 0)
+        {
+            return endValue;
+        }
+
+        if (_invertValues)
+            currentTime = duration - currentTime;
+
+        if (arrayMode)
+        {
+            var returnArray:Array = [];
+            var n:int = startValue.length;
+            for (var i:int = 0; i < n; i++)
+            {
+                returnArray[i] = userEquation(currentTime, startValue[i],
+                                              endValue[i] - startValue[i],
+                                              duration);
+            }
+            return returnArray;
+        }
+        else
+        {
+            return userEquation(currentTime, startValue,
+                                Number(endValue) - Number(startValue),
+                                duration);
+        }
+    }
+
+    /**
+     *  @private
+     */
+    private function defaultEasingFunction(t:Number, b:Number,
+                                           c:Number, d:Number):Number
+    {
+        return c / 2 * (Math.sin(Math.PI * (t / d - 0.5)) + 1) + b;
+    }
+
+    /**
+     *  Advances the tween effect to the specified position.
+     *
+     *  @param playheadTime The position, in milliseconds, between 0
+     *  and the value of the duration property.
+     */
+    public function seek(playheadTime:Number):void
+    {
+        // Set value between 0 and duration
+        //playheadTime = Math.min(Math.max(playheadTime, 0), duration);
+
+        var clockTime:Number = intervalTime;
+
+        // Reset the previous update time
+        previousUpdateTime = clockTime;
+
+        // Reset the start time
+        startTime = clockTime - playheadTime;
+
+        _doSeek = true;
+    }
+
+    /**
+     *  Plays the effect in reverse,
+     *  starting from the current position of the effect.
+     */
+    public function reverse():void
+    {
+        if (_isPlaying)
+        {
+            _doReverse = false;
+            seek(duration - _playheadTime);
+            _invertValues = !_invertValues;
+        }
+        else
+        {
+            _doReverse = !_doReverse;
+        }
+    }
+
+    /**
+     *  Pauses the effect until you call the resume() method.
+     */
+    public function pause():void
+    {
+        _isPlaying = false;
+    }
+
+    /**
+     *  Stops the tween, ending it without dispatching an event or calling
+     *  endFunction or onTweenEnd().
+     */
+    public function stop():void
+    {
+        if (id >= 0)
+            Tween.removeTweenAt(id);
+    }
+
+    /**
+     *  Resumes the effect after it has been paused
+     *  by a call to the pause() method.
+     */
+    public function resume():void
+    {
+        _isPlaying = true;
+
+        startTime = intervalTime - _playheadTime;
+        if (_doReverse)
+        {
+            reverse();
+            _doReverse = false;
+        }
+    }
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 10914
Author:   gosmith@adobe.com
Date:     2009-10-07T19:09:37.675813Z

Log Message:
-----------
UIFTETextField now has localizable RTE messages. We want to keep FTETextField independent of the rest of the Flex framework, so it has a getErrorMessage() method which just returns hard-coded English strings. But UIFTETextField overrides it to get the messages from the ResourceManager.

QE notes: None
Doc notes: None
Bugs: None
Reviewer: Carol
Tests run: ant checkintests
Is noteworthy for integration: Yes - new strings to localize in frameworks/projects/framework/bundles/en_US/core.properties

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/bundles/en_US/core.properties</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/UIFTETextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/FTETextField.as</path>

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

--- frameworks/projects/spark/src/mx/core/FTETextField.as
+++ frameworks/projects/spark/src/mx/core/FTETextField.as
@@ -25,7 +25,6 @@
 import flash.text.TextFieldAutoSize;
 import flash.text.TextFieldType;
 import flash.text.TextFormat;
-import flash.text.TextFormatAlign;
 import flash.text.TextLineMetrics;
 import flash.text.engine.ElementFormat;
 import flash.text.engine.FontDescription;
@@ -673,7 +672,8 @@
 			value != TextFieldAutoSize.CENTER &&
 			value != TextFieldAutoSize.RIGHT)
 		{
-			throw new ArgumentError("Parameter autoSize must be one of the accepted values.");
+			var message:String = getErrorMessage("badParameter", "autoSize");
+			throw new ArgumentError(message);
 		}

 		if (value == autoSize)
@@ -934,7 +934,10 @@
 	{
 		// TextField throws this RTE if a null value is set.
 		if (!value)
-			throw new TypeError("Parameter format must be non-null.");
+		{
+			var message:String = getErrorMessage("nullParameter", "format");
+			throw new TypeError(message);
+		}

 		// Apply non-null formats in the incoming TextFormat
 		// to the defaultTextFormat.
@@ -1099,7 +1102,8 @@
 		// but that's not what TextField does.
 		if (value == null)
 		{
-			throw new TypeError("Parameter text must be non-null.");
+			var message:String = getErrorMessage("nullParameter", "text");
+			throw new TypeError(message);
 		}

 		// Note: We don't return early if value == _htmlText
@@ -1566,7 +1570,10 @@
 	{
 		// TextField throws this RTE if a null value is set.
 		if (value == null)
-			throw new TypeError("Parameter text must be non-null.");
+		{
+			var message:String = getErrorMessage("nullParameter", "text");
+			throw new TypeError(message);
+		}

 		// Note: We don't return early if value == _text
 		// because the defaultTextFormat may have changed
@@ -1720,15 +1727,21 @@
 	 */
 	public function set type(value:String):void
 	{
+		var message:String;
+
 		// TextField throws this RTE when invalid values are set.
 		if (value != TextFieldType.DYNAMIC &&
 			value != TextFieldType.INPUT)
 		{
-			throw new ArgumentError("Parameter type must be one of the accepted values.");
+			message = getErrorMessage("badParameter", "type");
+			throw new ArgumentError(message);
 		}

 		if (value == TextFieldType.INPUT)
-			throw new Error("FTETextField does not support setting type to \"input\".");
+		{
+			message = getErrorMessage("unsupportedTypeInFTETextField");
+			throw new Error(message);
+		}
 	}

 	//----------------------------------
@@ -1843,7 +1856,10 @@
 	public function set direction(value:String):void
 	{
 		if (value != "ltr" && value != "rtl")
-			throw new ArgumentError("Parameter direction must be one of the accepted values.");
+		{
+			var message:String = getErrorMessage("badParameter", "direction");
+			throw new ArgumentError(message);
+		}

 		if (value == _direction)
 			return;
@@ -2115,7 +2131,10 @@

 		// TextField throws this RTE when invalid values are set.
 		if (lineIndex < 0 || lineIndex >= numChildren)
-			throw new RangeError("The supplied index is out of bounds");
+		{
+			var message:String = getErrorMessage("badIndex");
+			throw new RangeError(message);
+		}

 		// The nth line is the nth child.
 		var textLine:TextLine = TextLine(getChildAt(lineIndex));
@@ -2295,15 +2314,6 @@
 	/**
 	 *  @private
 	 */
-	private function notImplemented(name:String):String
-	{
-		// FIXME (gosmith) Make this an other RTE messages localizable.
-		return "'" + name + "' is not implemented in FTETextField.";
-	}
-
-	/**
-	 *  @private
-	 */
 	private function testFlag(mask:uint):Boolean
 	{
 		return (flags & mask) != 0;
@@ -2317,11 +2327,17 @@
 		flags |= mask;
 	}

+	/**
+	 *  @private
+	 */
 	private function clearFlag(mask:uint):void
 	{
 		flags &= ~mask;
 	}

+	/**
+	 *  @private
+	 */
 	private function setFlagToValue(mask:uint, value:Boolean):void
 	{
 		if (value)
@@ -2836,6 +2852,67 @@
 		_textHeight = Math.round(bounds.height);
 	}

+	/**
+	 *  @private
+	 *  Provides RTE messages.
+	 *  FTETextField is deliberately kept independent
+	 *  of the rest of the Flex framework.
+	 *  Therefore it doesn't have access to localized resource strings
+	 *  in the ResourceManager and simply has hard-coded English Strings.
+	 *  However, framework subclasses such as UIFTETextField override
+	 *  this method to provide localized messages from ResourceManager.
+	 */
+	mx_internal function getErrorMessage(key:String, param:String = null):String
+	{
+		var message:String = "";
+
+		switch (key)
+		{
+			case "badParameter":
+			{
+				// This message matches the one in Flash Player.
+				message = "Parameter " + param + " must be one of the accepted values.";
+				break;
+			}
+
+			case "nullParameter":
+			{
+				// This message matches the one in Flash Player.
+				message = "Parameter " + param + " must be non-null.";
+				break;
+			}
+
+			case "badIndex":
+			{
+				// This message matches the one in Flash Player.
+				message = "The supplied index is out of bounds.";
+				break;
+			}
+
+			case "notImplementedInFTETextField":
+			{
+				message = "'" + param + "' is not implemented in FTETextField.";
+				break;
+			}
+
+			case "unsupportedTypeInFTETextField":
+			{
+				message = "FTETextField does not support setting type to \"input\".";
+				break;
+			}
+		}
+
+		return message;
+	}
+
+	/**
+	 *  @private
+	 */
+	private function notImplemented(name:String):String
+	{
+		return getErrorMessage("notImplementedInFTETextField", name);
+	}
+
 	//--------------------------------------------------------------------------
 	//
 	//  Event handlers


Transferred from the Adobe Open Source Subversion Repository

Revision: 11300
Author:   cframpto@adobe.com
Date:     2009-10-30T13:08:57.678573Z

Log Message:
-----------
Since a border increases the width and height by 1, if there is a scrollRect, it has to be increased as well, so that the right and bottom border will show.  Similiarly, if there is a scrollRect, and the border is removed, the extra pixel has to be removed from the scrollRect.

QE notes:
Doc notes:
Bugs: SDK-23368
Reviewer: Gordon
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/FTETextField.as

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

--- frameworks/projects/spark/src/mx/core/FTETextField.as
+++ frameworks/projects/spark/src/mx/core/FTETextField.as
@@ -784,7 +784,12 @@

 		// The border and background need to be redrawn.
 		setFlag(FLAG_GRAPHICS_INVALID);
-
+
+        // The border increases the width and height by 1 pixel, so if there
+        // is a scrollRect, it has to be modified as well.
+        if (testFlag(FLAG_TEXT_SET | FLAG_HTML_TEXT_SET))
+            setFlag(FLAG_TEXT_LINES_INVALID);
+
 		invalidate();
 	}

@@ -2453,6 +2458,15 @@
 				r.top = 0;
 				r.right = _width;
 				r.bottom = _height;
+
+                // Expand scrollRect by one pixel so the bottom and right
+                // borders are not cliped.  See note below.
+                if (testFlag(FLAG_GRAPHICS_INVALID) && border)
+                {
+                    r.width++;
+                    r.height++;
+                }
+
 				scrollRect = r;
 			}
 			else


Fix 2

Fix 2

--- src/ageofai/unit/utils/VillagerAI.as
+++ src/ageofai/unit/utils/VillagerAI.as
@@ -54,7 +54,7 @@
                 {
                     // Move randomly
                     do {
-                        var newPos:int = Math.round(Math.random() * 4);
+                        var newPos:int = Math.round(Math.random() * 3);
                         newX = villager.position.x + surroundings[newPos][0];
                         newY = villager.position.y + surroundings[newPos][1];


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/mx/src/mx/styles/metadata/IconColorStyles.as
+++ frameworks/projects/mx/src/mx/styles/metadata/IconColorStyles.as
@@ -0,0 +1,37 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+
+/**
+ *  The color for the icon in a skin.
+ *  For example, this style is used by the CheckBoxIcon skin class
+ *  to draw the check mark for a CheckBox control,
+ *  by the ComboBoxSkin class to draw the down arrow of the ComboBox control,
+ *  and by the DateChooserMonthArrowSkin skin class to draw the month arrow
+ *  for the DateChooser control.
+ *
+ *  The default value depends on the component class;
+ *  if it is not overridden by the class, the default value is 0x111111.
+ */
+[Style(name="iconColor", type="uint", format="Color", inherit="yes")]
+
+/**
+ *  The color for the icon in a disabled skin.
+ *  For example, this style is used by the CheckBoxIcon skin class
+ *  to draw the check mark for a disabled CheckBox control,
+ *  by the ComboBoxSkin class to draw the down arrow of a disabled ComboBox control,
+ *  and by the DateChooserMonthArrowSkin skin class to draw the month arrow
+ *  for a disabled DateChooser control.
+ *
+ *  The default value depends on the component class;
+ *  if it is not overridden by the class, the default value is 0x999999.
+ */
+[Style(name="disabledIconColor", type="uint", format="Color", inherit="yes")]


Transferred from the Adobe Open Source Subversion Repository

Revision: 3682
Author:   hmuller@adobe.com
Date:     2008-10-16T15:03:51.166448Z

Log Message:
-----------
FiFixed 17061, removed unnecessary override of 'set value' in FxNumericStepper

Previuosly FxSpinner::step() conflated stepSize and the
valueInterval property.  The latter forces FxRange values to be an
integer multiple of valueInterval, irrespective of the minimum.

I've changed FxSpinner::step() to leave enforcing the valueInterval
constraint to the value property.  So less the valueWrap logic, the
step method becomes:

    value += (increase) ? stepSize : -stepSize;

If the developer _also_ sets the valueInterval property, the new value
will still be forced to be a multiple.

I've also removed the unnecessary override of 'set value' in FxNumericStepper
per the changes in SVN 3597.

QE: It's possible that some spinner/slide/scrollbar tests confirmed the old behavior
Doc: No
Checkintests: Pass
Reviewer: Chet
Bugs:
    SDK-17061 - Gumbo Range does not allow an odd-only range

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxRange.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxNumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxSpinner.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LayoutBase.as</path>

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

--- frameworks/projects/spark/src/spark/components/NumericStepper.as
+++ frameworks/projects/spark/src/spark/components/NumericStepper.as
@@ -77,31 +77,6 @@

     //--------------------------------------------------------------------------
     //
-    // Properties
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     */
-    private var valueChanged:Boolean = false;
-
-    /**
-     *  @private
-     */
-    override public function set value(newValue:Number):void
-    {
-        if (newValue == value)
-           return;
-
-        super.value = newValue;
-
-        valueChanged = true;
-        invalidateProperties();
-    }
-
-    //--------------------------------------------------------------------------
-    //
     // Methods
     //
     //--------------------------------------------------------------------------
@@ -109,26 +84,10 @@
     /**
      *  @private
      */
-    override protected function setValue(value:Number):void
-    {
-        super.setValue(value);
-
-        valueChanged = true;
-        invalidateProperties();
-    }
-
-    /**
-     *  @private
-     */
-    override protected function commitProperties():void
-    {
-        super.commitProperties();
-
-        if (valueChanged)
-        {
-            valueChanged = false;
-            textInput.text = value.toString();
-        }
+    override protected function setValue(newValue:Number):void
+    {
+        super.setValue(newValue);
+        textInput.text = value.toString();
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 5098
Author:   gauravj@adobe.com
Date:     2009-02-27T02:21:27.489350Z

Log Message:
-----------
Update action script files with asdoc version tags.

QE Notes: None.
Doc Notes: Please review and update as necessary.
tests: checkintests

Modified Paths:
--------------
151 paths were modified

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

--- frameworks/projects/spark/src/spark/effects/interpolation/NumberInterpolator.as
+++ frameworks/projects/spark/src/spark/effects/interpolation/NumberInterpolator.as
@@ -23,6 +23,11 @@
 /**
  * The NumberInterpolator class provides interpolation between
  * Number start and end values.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 public class NumberInterpolator implements IInterpolator
 {
@@ -43,6 +48,11 @@
     /**
      * Returns the singleton of this class. Since all NumberInterpolators
      * have the same behavior, there is no need for more than one instance.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public static function getInstance():NumberInterpolator
     {
@@ -54,6 +64,11 @@
     /**
      * Returns the Number type, which is the type of
      * object interpolated by NumberInterpolator
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get interpolatedType():Class
     {
@@ -69,6 +84,11 @@
      * fraction elapsed from start to end, like this:

      *
      *
return startValue + fraction * (endValue - startValue);

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function interpolate(fraction:Number, startValue:Object,
         endValue:Object):Object
@@ -88,6 +108,11 @@
      * @inheritDoc
      *
      *
return baseValue + incrementValue;

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function increment(baseValue:Object, incrementValue:Object):Object
     {
@@ -98,6 +123,11 @@
      * @inheritDoc
      *
      *
return baseValue - decrementValue;

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
    public function decrement(baseValue:Object, decrementValue:Object):Object
    {


Transferred from the Adobe Open Source Subversion Repository

Revision: 11751
Author:   clucier@adobe.com
Date:     2009-11-12T22:28:38.657563Z

Log Message:
-----------
Setting a transform matrix would always invalidate and cause an update.  If you were setting a transform matrix in upateDisplayList, you'd end up in a continuous update loop.  Added logic to early exit (and not invalidate) when the newly set matrix is identical to the existing.

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/core/SpriteVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/MatrixUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>

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

--- frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
@@ -4372,6 +4372,11 @@
     {
         allocateLayoutFeatures();
         var previous:Boolean = needsDisplayObject;
+
+        // Early exit if possible. We don't want to invalidate unnecessarily.
+        if (MatrixUtil.isEqual(layoutFeatures.layoutMatrix, value))
+            return;
+
         layoutFeatures.layoutMatrix = value;
         invalidateTransform(previous != needsDisplayObject, invalidateLayout);
     }
@@ -4435,6 +4440,11 @@
     {
         allocateLayoutFeatures();
         var previous:Boolean = needsDisplayObject;
+
+        // Early exit if possible. We don't want to invalidate unnecessarily.
+        if (MatrixUtil.isEqual3D(layoutFeatures.layoutMatrix3D, value))
+            return;
+
         layoutFeatures.layoutMatrix3D = value;
         invalidateTransform(previous != needsDisplayObject, invalidateLayout);
     }


Get host and port from loaderInfo parameters

--- Agent.as
+++ Agent.as
@@ -8,33 +8,28 @@
     import flash.net.XMLSocket;

     public class Agent extends Sprite {
-        // TODO externalize these into parameters in mm.cfg?
 	    private static const HOST:String = "localhost";
 	    private static const PORT:int = 42624;
 	    private static const PREFIX:String = "[AGENT]";

-	    private static var _instance:Agent;
+	    private var _host:String;
+	    private var _port:int;
 	    private var _socket:XMLSocket;
 	    private var _connected:Boolean;

     	public function Agent() {
-    	    trace(PREFIX, _instance);
+    	    trace(PREFIX, "Loaded");
+
+            /*trace(loaderInfo.loaderURL, loaderInfo.url);*/

-    	    if( null != _instance ) {
-    	        trace(PREFIX,"Already loaded, ignoring request");
-    	        return;
-    	    }
-
-    	    _instance = this;
-
-    	    trace(PREFIX,"Loaded", loaderInfo.parameters["host"], loaderInfo.parameters["port"]);
+    	    _host = loaderInfo.parameters["host"] || HOST;
+    	    _port = loaderInfo.parameters["port"] || PORT;

 	        _socket = new XMLSocket();

             _socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, fail);
             _socket.addEventListener(IOErrorEvent.IO_ERROR, fail);
             _socket.addEventListener(DataEvent.DATA, dataReceived);
-
             _socket.addEventListener(Event.CONNECT, connected);
             _socket.addEventListener(Event.CLOSE, close);

@@ -46,10 +41,10 @@
     	}

     	private function connect():void {
-    	    trace(PREFIX, "Trying to connect to", HOST, ":", PORT);
+    	    trace(PREFIX, "Trying to connect to", _host, ":", _port);

     	    try {
-    	        _socket.connect(HOST, PORT);
+    	        _socket.connect(_host, _port);
 	        } catch (e:Error) {
 	            trace(PREFIX, "Unable to connect ", e);
 	        }