Transferred from the Adobe Open Source Subversion Repository

Revision: 1098
Author:   jimurphy@adobe.com
Date:     2008-04-03T21:50:39.896200Z

Log Message:
-----------
Merge 3.0.x -- 362:394, 427:429, 603:608, 644:645, 651:663, 672:676, 755:756, 763:766, 785:790, 812:814, 854:861, 862:866, 866:933,971:1009, 1050:1056 --> trunk

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/TileListItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/treeClasses/DefaultDataDescriptor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/VRule.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AsyncRequest.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/IList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/LayoutManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/StreamingConnectionHandler.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IRepeaterClient.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/videoClasses/VideoError.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/ObjectProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/messages/HTTPRequestMessage.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/resources/Locale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/ParallelInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/Responder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/errors/MessageSerializationError.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/messages/SOAPMessage.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/IBrowserManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ComponentDescriptor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/events/FaultEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridColumn.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/IViewCursor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/AbstractWebService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Tween.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Panel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/DragManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/menuClasses/IMenuItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/MessageResponder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/preloaders/Preloader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/ILayoutManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Spacer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Label.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/Fault.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/XMLListCollection.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/EffectTargetFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SliderEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AsyncToken.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/Window.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/resources/ResourceManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/ScrollEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/mxml/HTTPService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/videoClasses/CuePointManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/CrossDomainRSLItem.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/NumericStepperEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/BrowserManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/events/ChannelFaultEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/CursorBookmark.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/xml/IXMLEncoder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/HTTPService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/events/WSDLLoadEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/LoadEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/ListCollectionView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/FlexClient.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/SubscriptionInfo.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/DescribeTypeCache.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/logging/LogLogger.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/MessageAgent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/build_framework.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/events/HeaderEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/build.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridDragProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/preloaders/DownloadProgressBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/treeClasses/ITreeDataDescriptor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/remoting/RemoteObject.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/TileBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListItemDragProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/ChannelSet.as</path>

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

--- frameworks/projects/mx/src/mx/controls/videoClasses/CuePointManager.as
+++ frameworks/projects/mx/src/mx/controls/videoClasses/CuePointManager.as
@@ -33,770 +33,773 @@
  */
 public class CuePointManager
 {
-	include "../../core/Version.as";
-
-	//--------------------------------------------------------------------------
-	//
-	//  Class methods
-	//
-	//--------------------------------------------------------------------------
-
-    /**
-	 *  @private
-     */
-	private var _owner:VideoPlayer;
-
-	private var _metadataLoaded:Boolean;
-	private var _disabledCuePoints:Array;
-	private var _disabledCuePointsByNameOnly:Object;
-	private var _cuePointIndex:uint;
-	private var _cuePointTolerance:Number;
-	private var _linearSearchTolerance:Number;
-
-	private static var DEFAULT_LINEAR_SEARCH_TOLERANCE:Number = 50;
-
-	private var cuePoints:Array;
-
-	/**
-	 *  @private
-	 *  Reference to VideoDisplay object associated with this CuePointManager
-	 *  instance.
-	 */
-	mx_internal var videoDisplay:VideoDisplay;
-
-	/**
-	 *  @private
-	 *  Used for accessing localized Error messages.
-	 */
-	private var resourceManager:IResourceManager =
-									ResourceManager.getInstance();
-
-	//
-	// public APIs
-	//
-
-	/**
-	 *  Constructor.
-	 */
-	public function CuePointManager(owner:VideoPlayer, id:uint = 0)
-    {
-    	// take in id just to be back-wards compatible
-		super();
-
-		_owner = owner;
-		reset();
-		_cuePointTolerance = _owner.playheadUpdateInterval / 2000;
-		_linearSearchTolerance = DEFAULT_LINEAR_SEARCH_TOLERANCE;
-	}
-
-	/**
-	 *  @private
-	 *  Reset cue point lists
-	 */
-	private function reset():void
-	{
-		_metadataLoaded = false;
-		cuePoints = null;
-		_disabledCuePoints = null;
-		_cuePointIndex = 0;
-	}
-
-	/**
-	 *  @private
-	 *  read only, has metadata been loaded
-	 */
-	private function get metadataLoaded():Boolean
-	{
-		return _metadataLoaded;
-	}
-
-	/**
-	 *  @private
-	 *
Set by FLVPlayback to update _cuePointTolerance

-	 *  Should be exposed in VideoDisplay/ here in Flex 2.0.
-	 */
-	private function set playheadUpdateInterval(aTime:Number):void
-	{
-		_cuePointTolerance = aTime / 2000;
-	}
-
-	/**
-	 *  Adds a cue point.
-	 *
-	 *
You can add multiple cue points with the same
-	 *  name and time.  When you call the removeCuePoint() method
-	 *  with the name and time,  it removes the first matching cue point.
-	 *  To remove all matching cue points, you have to make additional calls to
-	 *  the removeCuePoint() method.

-	 *
-	 *  @param cuePoint The Object describes the cue
-	 *  point.  It must contain the properties name:String
-	 *  and time:Number (in seconds).
-	 *  If the Object does not conform to these
-	 *  conventions, it throws a VideoError error.
-	 *
-	 *  @return A copy of the cue point Object added. The copy has the
-	 *  following additional properties:
-	 *
-	 *

-	 *
array - the Array of all cue points. Treat
-	 *    this Array as read only because adding, removing or editing objects
-	 *    within it can cause cue points to malfunction.

-	 *
-	 *
index - the index into the Array for the
-	 *    returned cue point.

-	 *

-	 *
-	 *  @throws mx.controls.videoClasses.VideoError If the arguments are invalid.
-	 */
-	public function addCuePoint(cuePoint:Object):Object
-	{
-		var message:String;
-
-		// make sense of param
-		var copy:Object = deepCopyObject(cuePoint);
-
-		// sanity check
-		var timeUndefined:Boolean = (isNaN(copy.time) || copy.time < 0);
-		if (timeUndefined)
-		{
-			message = resourceManager.getString(
-				"controls", "wrongTime");
-			throw new VideoError(VideoError.ILLEGAL_CUE_POINT, message);
-		}
-		if (!copy.name)
-		{
-			message = resourceManager.getString(
-				"controls", "wrongName");
-			throw new VideoError(VideoError.ILLEGAL_CUE_POINT, message);
-		}
-
-		// add cue point to cue point array
-		var index:Number;
-		copy.type = "actionscript";
-		if (cuePoints == null || cuePoints.length < 1)
-		{
-			index = 0;
-			cuePoints = [];
-			cuePoints.push(copy);
-		}
-		else
-		{
-			index = getCuePointIndex(cuePoints, true, copy.time, null, 0, 0);
-			index = (cuePoints[index].time > copy.time) ? 0 : index + 1;
-			cuePoints.splice(index, 0, copy);
-		}
-
-		// adjust _cuePointIndex
-		var now:Number = _owner.playheadTime;
-		if (now > 0)
-		{
-			if (_cuePointIndex == index)
-			{
-				if (now > cuePoints[index].time)
-				{
-					_cuePointIndex++;
-				}
-			}
-			else if (_cuePointIndex > index)
-			{
-				_cuePointIndex++;
-			}
-		}
-		else
-		{
-			_cuePointIndex = 0;
-		}
-
-		// return the cue point
-		var returnObject:Object = deepCopyObject(cuePoints[index]);
-		returnObject.array = cuePoints;
-		returnObject.index = index;
-		videoDisplay.dispatchEvent(new Event("cuePointsChanged"));
-		return returnObject;
-	}
-
-	/**
-	 *  Removes a cue point from the currently
-	 *  loaded FLV file.  Only the name and time
-	 *  properties are used from the cuePoint argument to
-	 *  determine the cue point to be removed.
-	 *
-	 *
If multiple cue points match the search criteria, only
-	 *  one will be removed.  To remove all cue points, call this function
-	 *  repeatedly in a loop with the same arguments until it returns
-	 *  null.

-	 *
-	 *  @param cuePoint The Object must contain at least one of
-	 *  name:String and time:Number properties, and
-	 *  removes the cue point that matches the specified properties.
-	 *
-	 *  @return An object representing the cue point removed. If there was no
-	 *  matching cue point, then it returns null.
-	 */
-	public function removeCuePoint(cuePoint:Object):Object
-	{
-		// bail if no cue points
-		if (cuePoints == null || cuePoints.length < 1)
-			return null;
-
-		// remove cue point from cue point array
-		var index:Number = getCuePointIndex(cuePoints, false, cuePoint.time, cuePoint.name, 0, 0);
-		if (index < 0)
-			return null;
-
-		cuePoint = cuePoints[index];
-		cuePoints.splice(index, 1);
-
-		// adjust _cuePointIndex
-		if (_owner.playheadTime > 0)
-		{
-			if (_cuePointIndex > index)
-			{
-				_cuePointIndex--;
-			}
-		}
-		else
-		{
-			_cuePointIndex = 0;
-		}
-
-		videoDisplay.dispatchEvent(new Event("cuePointsChanged"));
-		// return the cue point
-		return cuePoint;
-	}
-
-	/**
-	 *  @private
-	 *  removes enabled cue points from _disabledCuePoints
-	 */
-	private function removeCuePoints(cuePointArray:Array, cuePoint:Object):Number
-	{
-		var matchIndex:Number;
-		var matchCuePoint:Object;
-		var numChanged:Number = 0;
-		for (matchIndex = getCuePointIndex(cuePointArray, true, -1, cuePoint.name, 0, 0); matchIndex >= 0;
-		     matchIndex = getNextCuePointIndexWithName(matchCuePoint.name, cuePointArray, matchIndex))
-		{
-			// remove match
-			matchCuePoint = cuePointArray[matchIndex];
-			cuePointArray.splice(matchIndex, 1);
-			matchIndex--;
-			numChanged++;
-		}
-		return numChanged;
-	}
-
-	/**
-	 *  @private
-	 *  inserts cue points into array
-	 */
-	private function insertCuePoint(insertIndex:Number, cuePointArray:Array, cuePoint:Object):Array
-	{
-		if (insertIndex < 0)
-		{
-			cuePointArray = [];
-			cuePointArray.push(cuePoint);
-		}
-		else
-		{
-			// find insertion point
-			if (cuePointArray[insertIndex].time > cuePoint.time)
-			{
-				insertIndex = 0;
-			}
-			else
-			{
-				insertIndex++;
-			}
-			// insert into sorted cuePointArray
-			cuePointArray.splice(insertIndex, 0, cuePoint);
-		}
-		return cuePointArray;
-	}
-
-	//
-	// package internal methods, called by FLVPlayback
-	//
-
-	/**
-	 *  @private
-	 *
Called by FLVPlayback on "playheadUpdate" event
-	 *  to throw "cuePoint" events when appropriate.

-	 */
-	mx_internal function dispatchCuePoints():void
-	{
-		var now:Number = _owner.playheadTime;
-		if (_owner.stateResponsive && cuePoints != null)
-		{
-			while (_cuePointIndex < cuePoints.length &&
-			        cuePoints[_cuePointIndex].time <= now + _cuePointTolerance)
-			{
-				var metadataEvent:MetadataEvent =
-					new MetadataEvent(MetadataEvent.CUE_POINT);
-				metadataEvent.info = deepCopyObject(cuePoints[_cuePointIndex++]);
-				_owner.dispatchEvent(metadataEvent);
-			}
-		}
-	}
-
-	/**
-	 *  @private
-	 *  When our place in the stream is changed, this is called
-	 *  to reset our index into actionscript cue point array.
-	 *  Another method is used when cue points are added
-	 *  are removed.
-	 */
-	mx_internal function resetCuePointIndex(time:Number):void
-	{
-		if (time <= 0 || cuePoints == null)
-		{
-			_cuePointIndex = 0;
-			return;
-		}
-		var index:Number = getCuePointIndex(cuePoints, true, time, null, 0, 0);
-		_cuePointIndex = (cuePoints[index].time < time) ? index + 1 : index;
-	}
-
-	/**
-	 *  @private
-	 *  Search for a cue point in an array sorted by time.  See
-	 *  closeIsOK parameter for search rules.
-	 *
-	 *  @param cuePointArray array to search
-	 *  @param closeIsOK If true, the behavior differs depending on the
-	 *  parameters passed in:
-	 *
-	 *

-	 *
-	 *
If name is null or undefined, then if the specific time is
-	 *  not found then the closest time earlier than that is returned.
-	 *  If there is no cue point earlier than time, the first cue point
-	 *  is returned.

-	 *
-	 *
If time is null, undefined or less than 0 then the first
-	 *  cue point with the given name is returned.

-	 *
-	 *
If time and name are both defined then the closest cue
-	 *  point, then if the specific time and name is not found then the
-	 *  closest time earlier than that with that name is returned.  If
-	 *  there is no cue point with that name and with an earlier time,
-	 *  then the first cue point with that name is returned.  If there
-	 *  is no cue point with that name, null is returned.

-	 *
-	 *
If time is null, undefined or less than 0 and name is null
-	 *  or undefined, a VideoError is thrown.

-	 *
-	 *

-	 *
-	 *
If closeIsOK is false the behavior is:

-	 *
-	 *

-	 *
-	 *
If name is null or undefined and there is a cue point with
-	 *  exactly that time, it is returned.  Otherwise null is
-	 *  returned.

-	 *
-	 *
If time is null, undefined or less than 0 then the first
-	 *  cue point with the given name is returned.

-	 *
-	 *
If time and name are both defined and there is a cue point
-	 *  with exactly that time and name, it is returned.  Otherwise null
-	 *  is returned.

-	 *
-	 *
If time is null, undefined or less than 0 and name is null
-	 *  or undefined, a VideoError is thrown.

-	 *
-	 *

-	 *  @param time search criteria
-	 *  @param name search criteria
-	 *  @param start index of first item to be searched, used for
-	 *  recursive implementation, defaults to 0 if undefined
-	 *  @param len length of array to search, used for recursive
-	 *  implementation, defaults to cuePointArray.length if undefined
-	 *  @returns index for cue point in given array or -1 if no match found
-	 *  @throws VideoError if time and/or name parameters are bad
-	 *  @see #cuePointCompare()
-	 */
-	private function getCuePointIndex(cuePointArray:Array, closeIsOK:Boolean,
-											  time:Number, name:String,
-	                                          start:Number, len:Number):Number
-	{
-		// sanity checks
-		if (cuePointArray == null || cuePointArray.length < 1)
-			return -1;
-
-		var timeUndefined:Boolean = (isNaN(time) || time < 0);
-		if (timeUndefined && !name)
-		{
-			var message:String = resourceManager.getString(
-				"controls", "wrongTimeName");
-			throw new VideoError(VideoError.ILLEGAL_CUE_POINT, message);
-		}
-
-		if (len == 0) len = cuePointArray.length;
-
-		// name is passed in and time is undefined or closeIsOK is
-		// true, search for first name starting at either start
-		// parameter index or index at or after passed in time, respectively
-		if (name && (closeIsOK || timeUndefined))
-		{
-			var firstIndex:Number;
-			var index:Number;
-			if (timeUndefined)
-				firstIndex = start;
-			else
-				firstIndex = getCuePointIndex(cuePointArray, closeIsOK, time, null, 0, 0);
-			for (index = firstIndex; index >= start; index--)
-				if (cuePointArray[index].name == name)
-					break;
-			if (index >= start)
-				return index;
-			for (index = firstIndex + 1; index < len; index++)
-				if (cuePointArray[index].name == name)
-					break;
-			if (index < len)
-				return index;
-			return -1;
-		}
-
-		var result:Number;
-
-		// iteratively check if short length
-		if (len <= _linearSearchTolerance)
-		{
-			var max:Number = start + len;
-			for (var i:uint = start; i < max; i++)
-			{
-				result = cuePointCompare(time, name, cuePointArray[i]);
-				if (result == 0)
-					return i;
-				if (result < 0) break;
-			}
-			if (closeIsOK)
-			{
-				if (i > 0)
-					return i - 1;
-				return 0;
-			}
-			return -1;
-		}
-
-		// split list and recurse
-		var halfLen:Number = Math.floor(len / 2);
-		var checkIndex:Number = start + halfLen;
-		result = cuePointCompare(time, name, cuePointArray[checkIndex]);
-		if (result < 0)
-			return getCuePointIndex(cuePointArray, closeIsOK, time, name,
-			                         start, halfLen);
-		if (result > 0)
-			return getCuePointIndex(cuePointArray, closeIsOK, time, name,
-			                         checkIndex + 1, halfLen - 1 + (len % 2));
-		return checkIndex;
-	}
-
-	/**
-	 *  @private
-	 *
Given a name, array and index, returns the next cue point in
-	 *  that array after given index with the same name.  Returns null
-	 *  if no cue point after that one with that name.  Throws
-	 *  VideoError if argument is invalid.

-	 *
-	 *  @returns index for cue point in given array or -1 if no match found
-	 */
-	private function getNextCuePointIndexWithName(name:String, array:Array, index:Number):Number
-	{
-		var message:String;
-
-		// sanity checks
-		if (!name)
-		{
-			message = resourceManager.getString(
-				"controls", "wrongName");
-			throw new VideoError(VideoError.ILLEGAL_CUE_POINT, message);
-		}
-		if (!array)
-		{
-			message = resourceManager.getString(
-				"controls", "undefinedArray");
-			throw new VideoError(VideoError.ILLEGAL_CUE_POINT, message);
-		}
-		if (isNaN(index) || index < -1 || index >= array.length)
-		{
-			message = resourceManager.getString(
-				"controls", "wrongIndex");
-			throw new VideoError(VideoError.ILLEGAL_CUE_POINT, message);
-		}
-
-		// find it
-		var i:int;
-		for (i = index + 1; i < array.length; i++)
-			if (array[i].name == name)
-				break;
-		if (i < array.length)
-			return i;
-		return -1;
-	}
-
-	/**
-	 *  @private
-	 *  Takes two cue point Objects and returns -1 if first sorts
-	 *  before second, 1 if second sorts before first and 0 if they are
-	 *  equal.  First compares times with millisecond precision.  If
-	 *  they match, compares name if name parameter is not null or undefined.
-	 */
-	private static function cuePointCompare(time:Number, name:String, cuePoint:Object):Number
-	{
-		var compTime1:Number = Math.round(time * 1000);
-		var compTime2:Number = Math.round(cuePoint.time * 1000);
-		if (compTime1 < compTime2) return -1;
-		if (compTime1 > compTime2) return 1;
-		if (name != null)
-		{
-			if (name == cuePoint.name) return 0;
-			if (name < cuePoint.name) return -1;
-			return 1;
-		}
-		return 0;
-	}
-
-	/**
-	 *  @private
-	 *
-	 *
Search for a cue point in the given array at the given time
-	 *  and/or with given name.

-	 *
-	 *  @param closeIsOK If true, the behavior differs depending on the
-	 *  parameters passed in:
-	 *
-	 *

-	 *
-	 *
If name is null or undefined, then if the specific time is
-	 *  not found then the closest time earlier than that is returned.
-	 *  If there is no cue point earlier than time, the first cue point
-	 *  is returned.

-	 *
-	 *
If time is null, undefined or less than 0 then the first
-	 *  cue point with the given name is returned.

-	 *
-	 *
If time and name are both defined then the closest cue
-	 *  point, then if the specific time and name is not found then the
-	 *  closest time earlier than that with that name is returned.  If
-	 *  there is no cue point with that name and with an earlier time,
-	 *  then the first cue point with that name is returned.  If there
-	 *  is no cue point with that name, null is returned.

-	 *
-	 *
If time is null, undefined or less than 0 and name is null
-	 *  or undefined, a VideoError is thrown.

-	 *
-	 *

-	 *
-	 *
If closeIsOK is false the behavior is:

-	 *
-	 *

-	 *
-	 *
If name is null or undefined and there is a cue point with
-	 *  exactly that time, it is returned.  Otherwise null is
-	 *  returned.

-	 *
-	 *
If time is null, undefined or less than 0 then the first
-	 *  cue point with the given name is returned.

-	 *
-	 *
If time and name are both defined and there is a cue point
-	 *  with exactly that time and name, it is returned.  Otherwise null
-	 *  is returned.

-	 *
-	 *
If time is null, undefined or less than 0 and name is null
-	 *  or undefined, a VideoError is thrown.

-	 *
-	 *

-	 *  @param timeOrCuePoint If String, then name for search.  If
-	 *  Number, then time for search.  If Object, then cuepoint object
-	 *  containing time and/or name parameters for search.
-	 *  @returns null if no match was found, otherwise
-	 *  copy of cuePoint object with additional properties:
-	 *
-	 *

-	 *
-	 *
array - the array that was searched. Treat
-	 *  this array as read only as adding, removing or editing objects
-	 *  within it can cause cue points to malfunction.

-	 *
-	 *
index - the index into the array for the
-	 *  returned cuepoint.

-	 *
-	 *

-	 *  @see #getCuePointIndex()
-	 */
-	private function getCuePoint(cuePointArray:Array, closeIsOK:Boolean,
-	                      timeNameOrCuePoint:Object = null):Object
-	{
-		var cuePoint:Object;
-		switch (typeof(timeNameOrCuePoint))
-		{
-		case "string":
-			cuePoint = {name:timeNameOrCuePoint};
-			break;
-		case "number":
-			cuePoint = {time:timeNameOrCuePoint};
-			break;
-		case "object":
-			cuePoint = timeNameOrCuePoint;
-			break;
-		} // switch
-		var index:Number = getCuePointIndex(cuePointArray, closeIsOK, cuePoint.time, cuePoint.name, 0, 0);
-		if (index < 0) return null;
-		cuePoint = deepCopyObject(cuePointArray[index]);
-		cuePoint.array = cuePointArray;
-		cuePoint.index = index;
-		return cuePoint;
-	}
-
-	/**
-	 *  @private
-	 *
Given a cue point object returned from getCuePoint (needs
-	 *  the index and array properties added to those cue points),
-	 *  returns the next cue point in that array after that one with
-	 *  the same name.  Returns null if no cue point after that one
-	 *  with that name.  Throws VideoError if argument is invalid.

-	 *
-	 *  @returns null if no match was found, otherwise
-	 *  copy of cuePoint object with additional properties:
-	 *
-	 *

-	 *
-	 *
array - the array that was searched.  Treat
-	 *  this array as read only as adding, removing or editing objects
-	 *  within it can cause cue points to malfunction.

-	 *
-	 *
index - the index into the array for the
-	 *  returned cuepoint.

-	 *
-	 *

-	 */
-	private function getNextCuePointWithName(cuePoint:Object):Object
-	{
-		var message:String;
-
-		// sanity checks
-		if (!cuePoint)
-		{
-			message = resourceManager.getString(
-				"controls", "undefinedParameter");
-			throw new VideoError(VideoError.ILLEGAL_CUE_POINT, message);
-		}
-		if (isNaN(cuePoint.time) || cuePoint.time < 0)
-		{
-			message = resourceManager.getString(
-				"controls", "wrongTime");
-			throw new VideoError(VideoError.ILLEGAL_CUE_POINT, message);
-		}
-
-		// get index
-		var index:Number = getNextCuePointIndexWithName(cuePoint.name, cuePoint.array, cuePoint.index);
-		if (index < 0)
-			return null;
-
-		// return copy
-		var returnCuePoint:Object = deepCopyObject(cuePoint.array[index]);
-		returnCuePoint.array = cuePoint.array;
-		returnCuePoint.index = index;
-		return returnCuePoint;
-	}
-
-	/**
-	 *  Search for a cue point with specified name.
-	 *
-	 *  @param name The name of the cue point.
-	 *
-	 *  @return null if no match was found, or
-	 *  a copy of the matching cue point Object with additional properties:
-	 *
-	 *

-	 *
array - the Array of cue points searched. Treat
-	 *    this array as read only because adding, removing or editing objects
-	 *    within it can cause cue points to malfunction.

-	 *
-	 *
index - the index into the Array for the
-	 *    returned cue point.

-	 *

-	 */
-	public function getCuePointByName(name:String):Object
-	{
-		return getCuePoint(cuePoints, false, name);
-	}
-
-	/**
-	 *  Returns an Array of all cue points.
-	 *
-	 *  @return An Array of cue point objects.
-	 *  Each cue point object describes the cue
-	 *  point, and contains the properties name:String
-	 *  and time:Number (in seconds).
-	 */
-	public function getCuePoints():Array
-	{
-		return cuePoints;
-	}
-
-	/**
-	 *  Removes all cue points.
-	 */
-	public function removeAllCuePoints():void
-	{
-		cuePoints = null;
-		videoDisplay.dispatchEvent(new Event("cuePointsChanged"));
-	}
-
-	/**
-	 * Set the array of cue points.
-	 *
-	 *
You can add multiple cue points with the same
-	 * name and time.  When you call the removeCuePoint() method
-	 * with this name, only the first one is removed.

-	 *
-	 *  @param cuePointArray An Array of cue point objects.
-	 *  Each cue point object describes the cue
-	 *  point. It must contain the properties name:String
-	 *  and time:Number (in seconds).
-	 */
-	public function setCuePoints(cuePointArray:Array):void
-	{
-		// sanity checks
-		if (cuePointArray == null)
-			return;
-		for (var index:uint = 0; index < cuePointArray.length; index++)
-		{
-			addCuePoint(cuePointArray[index]);
-		}
-	}
-
-	/**
-	 *  @private
-	 *  Used to make copies of cue point objects.
-	 */
-	private static function deepCopyObject(obj:Object, recurseLevel:Number = 0):Object
-	{
-		if (obj == null || typeof(obj) != "object") return obj;
-		if (isNaN(recurseLevel)) recurseLevel = 0;
-		var newObj:Object = {};
-		for (var i:Object in obj)
-		{
-			if (recurseLevel == 0 && (i == "array" || i == "index"))
-			{
-				// skip it
-			}
-			else if (typeof(obj[i]) == "object")
-			{
-				newObj[i] = deepCopyObject(obj[i], recurseLevel+1);
-			}
-			else
-			{
-				newObj[i] = obj[i];
-			}
-		}
-		return newObj;
-	}
+    include "../../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private var _owner:VideoPlayer;
+
+    private var _metadataLoaded:Boolean;
+    private var _disabledCuePoints:Array;
+    private var _disabledCuePointsByNameOnly:Object;
+    private var _cuePointIndex:uint;
+    private var _cuePointTolerance:Number;
+    private var _linearSearchTolerance:Number;
+
+    private static var DEFAULT_LINEAR_SEARCH_TOLERANCE:Number = 50;
+
+    private var cuePoints:Array;
+
+    /**
+     *  @private
+     *  Reference to VideoDisplay object associated with this CuePointManager
+     *  instance.
+     */
+    mx_internal var videoDisplay:VideoDisplay;
+
+    /**
+     *  @private
+     *  Used for accessing localized Error messages.
+     */
+    private var resourceManager:IResourceManager =
+                                    ResourceManager.getInstance();
+
+    //
+    // public APIs
+    //
+
+    /**
+     *  Constructor.
+     *
+     *  @param owner The VideoPlayer instance that is the parent of this CuePointManager.
+     *  @param id This parameter is ignored; it is provided only for backwards compatibility.
+     */
+    public function CuePointManager(owner:VideoPlayer, id:uint = 0)
+    {
+        // take in id just to be back-wards compatible
+        super();
+
+        _owner = owner;
+        reset();
+        _cuePointTolerance = _owner.playheadUpdateInterval / 2000;
+        _linearSearchTolerance = DEFAULT_LINEAR_SEARCH_TOLERANCE;
+    }
+
+    /**
+     *  @private
+     *  Reset cue point lists
+     */
+    private function reset():void
+    {
+        _metadataLoaded = false;
+        cuePoints = null;
+        _disabledCuePoints = null;
+        _cuePointIndex = 0;
+    }
+
+    /**
+     *  @private
+     *  read only, has metadata been loaded
+     */
+    private function get metadataLoaded():Boolean
+    {
+        return _metadataLoaded;
+    }
+
+    /**
+     *  @private
+     *
Set by FLVPlayback to update _cuePointTolerance

+     *  Should be exposed in VideoDisplay/ here in Flex 2.0.
+     */
+    private function set playheadUpdateInterval(aTime:Number):void
+    {
+        _cuePointTolerance = aTime / 2000;
+    }
+
+    /**
+     *  Adds a cue point.
+     *
+     *
You can add multiple cue points with the same
+     *  name and time.  When you call the removeCuePoint() method
+     *  with the name and time,  it removes the first matching cue point.
+     *  To remove all matching cue points, you have to make additional calls to
+     *  the removeCuePoint() method.

+     *
+     *  @param cuePoint The Object describes the cue
+     *  point.  It must contain the properties name:String
+     *  and time:Number (in seconds).
+     *  If the Object does not conform to these
+     *  conventions, it throws a VideoError error.
+     *
+     *  @return A copy of the cue point Object added. The copy has the
+     *  following additional properties:
+     *
+     *

+     *
array - the Array of all cue points. Treat
+     *    this Array as read only because adding, removing or editing objects
+     *    within it can cause cue points to malfunction.

+     *
+     *
index - the index into the Array for the
+     *    returned cue point.

+     *

+     *
+     *  @throws mx.controls.videoClasses.VideoError If the arguments are invalid.
+     */
+    public function addCuePoint(cuePoint:Object):Object
+    {
+        var message:String;
+
+        // make sense of param
+        var copy:Object = deepCopyObject(cuePoint);
+
+        // sanity check
+        var timeUndefined:Boolean = (isNaN(copy.time) || copy.time < 0);
+        if (timeUndefined)
+        {
+            message = resourceManager.getString(
+                "controls", "wrongTime");
+            throw new VideoError(VideoError.ILLEGAL_CUE_POINT, message);
+        }
+        if (!copy.name)
+        {
+            message = resourceManager.getString(
+                "controls", "wrongName");
+            throw new VideoError(VideoError.ILLEGAL_CUE_POINT, message);
+        }
+
+        // add cue point to cue point array
+        var index:Number;
+        copy.type = "actionscript";
+        if (cuePoints == null || cuePoints.length < 1)
+        {
+            index = 0;
+            cuePoints = [];
+            cuePoints.push(copy);
+        }
+        else
+        {
+            index = getCuePointIndex(cuePoints, true, copy.time, null, 0, 0);
+            index = (cuePoints[index].time > copy.time) ? 0 : index + 1;
+            cuePoints.splice(index, 0, copy);
+        }
+
+        // adjust _cuePointIndex
+        var now:Number = _owner.playheadTime;
+        if (now > 0)
+        {
+            if (_cuePointIndex == index)
+            {
+                if (now > cuePoints[index].time)
+                {
+                    _cuePointIndex++;
+                }
+            }
+            else if (_cuePointIndex > index)
+            {
+                _cuePointIndex++;
+            }
+        }
+        else
+        {
+            _cuePointIndex = 0;
+        }
+
+        // return the cue point
+        var returnObject:Object = deepCopyObject(cuePoints[index]);
+        returnObject.array = cuePoints;
+        returnObject.index = index;
+        videoDisplay.dispatchEvent(new Event("cuePointsChanged"));
+        return returnObject;
+    }
+
+    /**
+     *  Removes a cue point from the currently
+     *  loaded FLV file.  Only the name and time
+     *  properties are used from the cuePoint argument to
+     *  determine the cue point to be removed.
+     *
+     *
If multiple cue points match the search criteria, only
+     *  one will be removed.  To remove all cue points, call this function
+     *  repeatedly in a loop with the same arguments until it returns
+     *  null.

+     *
+     *  @param cuePoint The Object must contain at least one of
+     *  name:String and time:Number properties, and
+     *  removes the cue point that matches the specified properties.
+     *
+     *  @return An object representing the cue point removed. If there was no
+     *  matching cue point, then it returns null.
+     */
+    public function removeCuePoint(cuePoint:Object):Object
+    {
+        // bail if no cue points
+        if (cuePoints == null || cuePoints.length < 1)
+            return null;
+
+        // remove cue point from cue point array
+        var index:Number = getCuePointIndex(cuePoints, false, cuePoint.time, cuePoint.name, 0, 0);
+        if (index < 0)
+            return null;
+
+        cuePoint = cuePoints[index];
+        cuePoints.splice(index, 1);
+
+        // adjust _cuePointIndex
+        if (_owner.playheadTime > 0)
+        {
+            if (_cuePointIndex > index)
+            {
+                _cuePointIndex--;
+            }
+        }
+        else
+        {
+            _cuePointIndex = 0;
+        }
+
+        videoDisplay.dispatchEvent(new Event("cuePointsChanged"));
+        // return the cue point
+        return cuePoint;
+    }
+
+    /**
+     *  @private
+     *  removes enabled cue points from _disabledCuePoints
+     */
+    private function removeCuePoints(cuePointArray:Array, cuePoint:Object):Number
+    {
+        var matchIndex:Number;
+        var matchCuePoint:Object;
+        var numChanged:Number = 0;
+        for (matchIndex = getCuePointIndex(cuePointArray, true, -1, cuePoint.name, 0, 0); matchIndex >= 0;
+             matchIndex = getNextCuePointIndexWithName(matchCuePoint.name, cuePointArray, matchIndex))
+        {
+            // remove match
+            matchCuePoint = cuePointArray[matchIndex];
+            cuePointArray.splice(matchIndex, 1);
+            matchIndex--;
+            numChanged++;
+        }
+        return numChanged;
+    }
+
+    /**
+     *  @private
+     *  inserts cue points into array
+     */
+    private function insertCuePoint(insertIndex:Number, cuePointArray:Array, cuePoint:Object):Array
+    {
+        if (insertIndex < 0)
+        {
+            cuePointArray = [];
+            cuePointArray.push(cuePoint);
+        }
+        else
+        {
+            // find insertion point
+            if (cuePointArray[insertIndex].time > cuePoint.time)
+            {
+                insertIndex = 0;
+            }
+            else
+            {
+                insertIndex++;
+            }
+            // insert into sorted cuePointArray
+            cuePointArray.splice(insertIndex, 0, cuePoint);
+        }
+        return cuePointArray;
+    }
+
+    //
+    // package internal methods, called by FLVPlayback
+    //
+
+    /**
+     *  @private
+     *
Called by FLVPlayback on "playheadUpdate" event
+     *  to throw "cuePoint" events when appropriate.

+     */
+    mx_internal function dispatchCuePoints():void
+    {
+        var now:Number = _owner.playheadTime;
+        if (_owner.stateResponsive && cuePoints != null)
+        {
+            while (_cuePointIndex < cuePoints.length &&
+                    cuePoints[_cuePointIndex].time <= now + _cuePointTolerance)
+            {
+                var metadataEvent:MetadataEvent =
+                    new MetadataEvent(MetadataEvent.CUE_POINT);
+                metadataEvent.info = deepCopyObject(cuePoints[_cuePointIndex++]);
+                _owner.dispatchEvent(metadataEvent);
+            }
+        }
+    }
+
+    /**
+     *  @private
+     *  When our place in the stream is changed, this is called
+     *  to reset our index into actionscript cue point array.
+     *  Another method is used when cue points are added
+     *  are removed.
+     */
+    mx_internal function resetCuePointIndex(time:Number):void
+    {
+        if (time <= 0 || cuePoints == null)
+        {
+            _cuePointIndex = 0;
+            return;
+        }
+        var index:Number = getCuePointIndex(cuePoints, true, time, null, 0, 0);
+        _cuePointIndex = (cuePoints[index].time < time) ? index + 1 : index;
+    }
+
+    /**
+     *  @private
+     *  Search for a cue point in an array sorted by time.  See
+     *  closeIsOK parameter for search rules.
+     *
+     *  @param cuePointArray array to search
+     *  @param closeIsOK If true, the behavior differs depending on the
+     *  parameters passed in:
+     *
+     *

+     *
+     *
If name is null or undefined, then if the specific time is
+     *  not found then the closest time earlier than that is returned.
+     *  If there is no cue point earlier than time, the first cue point
+     *  is returned.

+     *
+     *
If time is null, undefined or less than 0 then the first
+     *  cue point with the given name is returned.

+     *
+     *
If time and name are both defined then the closest cue
+     *  point, then if the specific time and name is not found then the
+     *  closest time earlier than that with that name is returned.  If
+     *  there is no cue point with that name and with an earlier time,
+     *  then the first cue point with that name is returned.  If there
+     *  is no cue point with that name, null is returned.

+     *
+     *
If time is null, undefined or less than 0 and name is null
+     *  or undefined, a VideoError is thrown.

+     *
+     *

+     *
+     *
If closeIsOK is false the behavior is:

+     *
+     *

+     *
+     *
If name is null or undefined and there is a cue point with
+     *  exactly that time, it is returned.  Otherwise null is
+     *  returned.

+     *
+     *
If time is null, undefined or less than 0 then the first
+     *  cue point with the given name is returned.

+     *
+     *
If time and name are both defined and there is a cue point
+     *  with exactly that time and name, it is returned.  Otherwise null
+     *  is returned.

+     *
+     *
If time is null, undefined or less than 0 and name is null
+     *  or undefined, a VideoError is thrown.

+     *
+     *

+     *  @param time search criteria
+     *  @param name search criteria
+     *  @param start index of first item to be searched, used for
+     *  recursive implementation, defaults to 0 if undefined
+     *  @param len length of array to search, used for recursive
+     *  implementation, defaults to cuePointArray.length if undefined
+     *  @returns index for cue point in given array or -1 if no match found
+     *  @throws VideoError if time and/or name parameters are bad
+     *  @see #cuePointCompare()
+     */
+    private function getCuePointIndex(cuePointArray:Array, closeIsOK:Boolean,
+                                              time:Number, name:String,
+                                              start:Number, len:Number):Number
+    {
+        // sanity checks
+        if (cuePointArray == null || cuePointArray.length < 1)
+            return -1;
+
+        var timeUndefined:Boolean = (isNaN(time) || time < 0);
+        if (timeUndefined && !name)
+        {
+            var message:String = resourceManager.getString(
+                "controls", "wrongTimeName");
+            throw new VideoError(VideoError.ILLEGAL_CUE_POINT, message);
+        }
+
+        if (len == 0) len = cuePointArray.length;
+
+        // name is passed in and time is undefined or closeIsOK is
+        // true, search for first name starting at either start
+        // parameter index or index at or after passed in time, respectively
+        if (name && (closeIsOK || timeUndefined))
+        {
+            var firstIndex:Number;
+            var index:Number;
+            if (timeUndefined)
+                firstIndex = start;
+            else
+                firstIndex = getCuePointIndex(cuePointArray, closeIsOK, time, null, 0, 0);
+            for (index = firstIndex; index >= start; index--)
+                if (cuePointArray[index].name == name)
+                    break;
+            if (index >= start)
+                return index;
+            for (index = firstIndex + 1; index < len; index++)
+                if (cuePointArray[index].name == name)
+                    break;
+            if (index < len)
+                return index;
+            return -1;
+        }
+
+        var result:Number;
+
+        // iteratively check if short length
+        if (len <= _linearSearchTolerance)
+        {
+            var max:Number = start + len;
+            for (var i:uint = start; i < max; i++)
+            {
+                result = cuePointCompare(time, name, cuePointArray[i]);
+                if (result == 0)
+                    return i;
+                if (result < 0) break;
+            }
+            if (closeIsOK)
+            {
+                if (i > 0)
+                    return i - 1;
+                return 0;
+            }
+            return -1;
+        }
+
+        // split list and recurse
+        var halfLen:Number = Math.floor(len / 2);
+        var checkIndex:Number = start + halfLen;
+        result = cuePointCompare(time, name, cuePointArray[checkIndex]);
+        if (result < 0)
+            return getCuePointIndex(cuePointArray, closeIsOK, time, name,
+                                     start, halfLen);
+        if (result > 0)
+            return getCuePointIndex(cuePointArray, closeIsOK, time, name,
+                                     checkIndex + 1, halfLen - 1 + (len % 2));
+        return checkIndex;
+    }
+
+    /**
+     *  @private
+     *
Given a name, array and index, returns the next cue point in
+     *  that array after given index with the same name.  Returns null
+     *  if no cue point after that one with that name.  Throws
+     *  VideoError if argument is invalid.

+     *
+     *  @returns index for cue point in given array or -1 if no match found
+     */
+    private function getNextCuePointIndexWithName(name:String, array:Array, index:Number):Number
+    {
+        var message:String;
+
+        // sanity checks
+        if (!name)
+        {
+            message = resourceManager.getString(
+                "controls", "wrongName");
+            throw new VideoError(VideoError.ILLEGAL_CUE_POINT, message);
+        }
+        if (!array)
+        {
+            message = resourceManager.getString(
+                "controls", "undefinedArray");
+            throw new VideoError(VideoError.ILLEGAL_CUE_POINT, message);
+        }
+        if (isNaN(index) || index < -1 || index >= array.length)
+        {
+            message = resourceManager.getString(
+                "controls", "wrongIndex");
+            throw new VideoError(VideoError.ILLEGAL_CUE_POINT, message);
+        }
+
+        // find it
+        var i:int;
+        for (i = index + 1; i < array.length; i++)
+            if (array[i].name == name)
+                break;
+        if (i < array.length)
+            return i;
+        return -1;
+    }
+
+    /**
+     *  @private
+     *  Takes two cue point Objects and returns -1 if first sorts
+     *  before second, 1 if second sorts before first and 0 if they are
+     *  equal.  First compares times with millisecond precision.  If
+     *  they match, compares name if name parameter is not null or undefined.
+     */
+    private static function cuePointCompare(time:Number, name:String, cuePoint:Object):Number
+    {
+        var compTime1:Number = Math.round(time * 1000);
+        var compTime2:Number = Math.round(cuePoint.time * 1000);
+        if (compTime1 < compTime2) return -1;
+        if (compTime1 > compTime2) return 1;
+        if (name != null)
+        {
+            if (name == cuePoint.name) return 0;
+            if (name < cuePoint.name) return -1;
+            return 1;
+        }
+        return 0;
+    }
+
+    /**
+     *  @private
+     *
+     *
Search for a cue point in the given array at the given time
+     *  and/or with given name.

+     *
+     *  @param closeIsOK If true, the behavior differs depending on the
+     *  parameters passed in:
+     *
+     *

+     *
+     *
If name is null or undefined, then if the specific time is
+     *  not found then the closest time earlier than that is returned.
+     *  If there is no cue point earlier than time, the first cue point
+     *  is returned.

+     *
+     *
If time is null, undefined or less than 0 then the first
+     *  cue point with the given name is returned.

+     *
+     *
If time and name are both defined then the closest cue
+     *  point, then if the specific time and name is not found then the
+     *  closest time earlier than that with that name is returned.  If
+     *  there is no cue point with that name and with an earlier time,
+     *  then the first cue point with that name is returned.  If there
+     *  is no cue point with that name, null is returned.

+     *
+     *
If time is null, undefined or less than 0 and name is null
+     *  or undefined, a VideoError is thrown.

+     *
+     *

+     *
+     *
If closeIsOK is false the behavior is:

+     *
+     *

+     *
+     *
If name is null or undefined and there is a cue point with
+     *  exactly that time, it is returned.  Otherwise null is
+     *  returned.

+     *
+     *
If time is null, undefined or less than 0 then the first
+     *  cue point with the given name is returned.

+     *
+     *
If time and name are both defined and there is a cue point
+     *  with exactly that time and name, it is returned.  Otherwise null
+     *  is returned.

+     *
+     *
If time is null, undefined or less than 0 and name is null
+     *  or undefined, a VideoError is thrown.

+     *
+     *

+     *  @param timeOrCuePoint If String, then name for search.  If
+     *  Number, then time for search.  If Object, then cuepoint object
+     *  containing time and/or name parameters for search.
+     *  @returns null if no match was found, otherwise
+     *  copy of cuePoint object with additional properties:
+     *
+     *

+     *
+     *
array - the array that was searched. Treat
+     *  this array as read only as adding, removing or editing objects
+     *  within it can cause cue points to malfunction.

+     *
+     *
index - the index into the array for the
+     *  returned cuepoint.

+     *
+     *

+     *  @see #getCuePointIndex()
+     */
+    private function getCuePoint(cuePointArray:Array, closeIsOK:Boolean,
+                          timeNameOrCuePoint:Object = null):Object
+    {
+        var cuePoint:Object;
+        switch (typeof(timeNameOrCuePoint))
+        {
+        case "string":
+            cuePoint = {name:timeNameOrCuePoint};
+            break;
+        case "number":
+            cuePoint = {time:timeNameOrCuePoint};
+            break;
+        case "object":
+            cuePoint = timeNameOrCuePoint;
+            break;
+        } // switch
+        var index:Number = getCuePointIndex(cuePointArray, closeIsOK, cuePoint.time, cuePoint.name, 0, 0);
+        if (index < 0) return null;
+        cuePoint = deepCopyObject(cuePointArray[index]);
+        cuePoint.array = cuePointArray;
+        cuePoint.index = index;
+        return cuePoint;
+    }
+
+    /**
+     *  @private
+     *
Given a cue point object returned from getCuePoint (needs
+     *  the index and array properties added to those cue points),
+     *  returns the next cue point in that array after that one with
+     *  the same name.  Returns null if no cue point after that one
+     *  with that name.  Throws VideoError if argument is invalid.

+     *
+     *  @returns null if no match was found, otherwise
+     *  copy of cuePoint object with additional properties:
+     *
+     *

+     *
+     *
array - the array that was searched.  Treat
+     *  this array as read only as adding, removing or editing objects
+     *  within it can cause cue points to malfunction.

+     *
+     *
index - the index into the array for the
+     *  returned cuepoint.

+     *
+     *

+     */
+    private function getNextCuePointWithName(cuePoint:Object):Object
+    {
+        var message:String;
+
+        // sanity checks
+        if (!cuePoint)
+        {
+            message = resourceManager.getString(
+                "controls", "undefinedParameter");
+            throw new VideoError(VideoError.ILLEGAL_CUE_POINT, message);
+        }
+        if (isNaN(cuePoint.time) || cuePoint.time < 0)
+        {
+            message = resourceManager.getString(
+                "controls", "wrongTime");
+            throw new VideoError(VideoError.ILLEGAL_CUE_POINT, message);
+        }
+
+        // get index
+        var index:Number = getNextCuePointIndexWithName(cuePoint.name, cuePoint.array, cuePoint.index);
+        if (index < 0)
+            return null;
+
+        // return copy
+        var returnCuePoint:Object = deepCopyObject(cuePoint.array[index]);
+        returnCuePoint.array = cuePoint.array;
+        returnCuePoint.index = index;
+        return returnCuePoint;
+    }
+
+    /**
+     *  Search for a cue point with specified name.
+     *
+     *  @param name The name of the cue point.
+     *
+     *  @return null if no match was found, or
+     *  a copy of the matching cue point Object with additional properties:
+     *
+     *

+     *
array - the Array of cue points searched. Treat
+     *    this array as read only because adding, removing or editing objects
+     *    within it can cause cue points to malfunction.

+     *
+     *
index - the index into the Array for the
+     *    returned cue point.

+     *

+     */
+    public function getCuePointByName(name:String):Object
+    {
+        return getCuePoint(cuePoints, false, name);
+    }
+
+    /**
+     *  Returns an Array of all cue points.
+     *
+     *  @return An Array of cue point objects.
+     *  Each cue point object describes the cue
+     *  point, and contains the properties name:String
+     *  and time:Number (in seconds).
+     */
+    public function getCuePoints():Array
+    {
+        return cuePoints;
+    }
+
+    /**
+     *  Removes all cue points.
+     */
+    public function removeAllCuePoints():void
+    {
+        cuePoints = null;
+        videoDisplay.dispatchEvent(new Event("cuePointsChanged"));
+    }
+
+    /**
+     * Set the array of cue points.
+     *
+     *
You can add multiple cue points with the same
+     * name and time.  When you call the removeCuePoint() method
+     * with this name, only the first one is removed.

+     *
+     *  @param cuePointArray An Array of cue point objects.
+     *  Each cue point object describes the cue
+     *  point. It must contain the properties name:String
+     *  and time:Number (in seconds).
+     */
+    public function setCuePoints(cuePointArray:Array):void
+    {
+        // sanity checks
+        if (cuePointArray == null)
+            return;
+        for (var index:uint = 0; index < cuePointArray.length; index++)
+        {
+            addCuePoint(cuePointArray[index]);
+        }
+    }
+
+    /**
+     *  @private
+     *  Used to make copies of cue point objects.
+     */
+    private static function deepCopyObject(obj:Object, recurseLevel:Number = 0):Object
+    {
+        if (obj == null || typeof(obj) != "object") return obj;
+        if (isNaN(recurseLevel)) recurseLevel = 0;
+        var newObj:Object = {};
+        for (var i:Object in obj)
+        {
+            if (recurseLevel == 0 && (i == "array" || i == "index"))
+            {
+                // skip it
+            }
+            else if (typeof(obj[i]) == "object")
+            {
+                newObj[i] = deepCopyObject(obj[i], recurseLevel+1);
+            }
+            else
+            {
+                newObj[i] = obj[i];
+            }
+        }
+        return newObj;
+    }

 } // class mx.controls.videoClasses.CuePointManager


fix XflLayer parse signature

fix XflLayer parse signature

--- exporter/src/main/as/flump/xfl/XflLayer.as
+++ exporter/src/main/as/flump/xfl/XflLayer.as
@@ -19,7 +19,7 @@

     use namespace xflns;

-    public static function parse (lib :XflLibrary, baseLocation :String, xml :XML, flipbook :Boolean) :LayerMold {
+    public static function parse (lib :XflLibrary, baseLocation :String, xml :XML, flipbook :Boolean,mask:String=null) :LayerMold {
         const layer :LayerMold = new LayerMold();
         layer.name = XmlUtil.getStringAttr(xml, NAME);
         layer.flipbook = flipbook;


Changed ports to not highlight on mouseover on main menu

--- src/Displays/DPort.as
+++ src/Displays/DPort.as
@@ -59,7 +59,7 @@
 		}

 		protected function getColor():uint {
-			if (!U.buttonManager.moused && overlapsPoint(U.mouseFlxLoc))
+			if (!U.buttonManager.moused && overlapsPoint(U.mouseFlxLoc) && U.state)
 				return U.HIGHLIGHTED_COLOR;

 			if (!port.getSource())


Add author head

Add author head

--- jinx.as
+++ jinx.as
@@ -1,3 +1,7 @@
+/**
+Author : Andre Caetano 2015
+**/
+
 import flash.events.Event;
 import flash.events.MouseEvent;
 import flash.external.ExternalInterface;


Transferred from the Adobe Open Source Subversion Repository

Revision: 10263
Author:   cframpto@adobe.com
Date:     2009-09-15T13:45:57.609886Z

Log Message:
-----------
Add textInputClass class to the components that use it so that textInputClass can be specified via mxml for DateField, NumericStepper, ColorPicker and ComboBox.

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/colorPickerClasses/SwatchPanel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/NumericStepper.as</path>

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

--- frameworks/projects/mx/src/mx/controls/colorPickerClasses/SwatchPanel.as
+++ frameworks/projects/mx/src/mx/controls/colorPickerClasses/SwatchPanel.as
@@ -308,6 +308,25 @@
  *  @productversion Flex 3
  */
 [Style(name="textFieldWidth", type="Number", format="Length", inherit="no")]
+
+/**
+ *  The class implementing ITextInput that is used by this component
+ *  to input text.
+ *
+ *
It can be set to either the mx.core.TextInput class
+ *  (to use the classic Halo TextInput control)
+ *  or the mx.controls.TLFTextInput class
+ *  (to use the Spark TextInput component based on the Text Layout Framework
+ *  to get improved text rendering, including bidirectional layout).

+ *
+ *  @default mx.controls.TextInput
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Style(name="textInputClass", type="Class", inherit="no")]

 //--------------------------------------
 //  Other metadata


Allow subclasses to create custom backends.

git-svn-id: a3e1eb16dde062992de22c830ed8045c8013209a@143 c613c5cb-e716-0410-b11b-feb51c14d237

--- src/as/com/threerings/ezgame/client/EZGamePanel.as
+++ src/as/com/threerings/ezgame/client/EZGamePanel.as
@@ -47,7 +47,7 @@
         var cfg :EZGameConfig = (_ctrl.getPlaceConfig() as EZGameConfig);

         _ezObj = (plobj as EZGameObject);
-        backend = new GameControlBackend(_ctx, _ezObj);
+        backend = createBackend();

         _gameView = new GameContainer(cfg.configData); // TODO?
         backend.setSharedEvents(
@@ -65,6 +65,14 @@
         backend.shutdown();
     }

+    /**
+     * Creates the backend object that will handle requests from user code.
+     */
+    protected function createBackend () :GameControlBackend
+    {
+        return new GameControlBackend(_ctx, _ezObj);
+    }
+
     protected var _ctx :CrowdContext;
     protected var _ctrl :EZGameController;


Reconnection fixes for BOSH. r=Armando. XIFF-36

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

--- src/org/jivesoftware/xiff/core/XMPPBOSHConnection.as
+++ src/org/jivesoftware/xiff/core/XMPPBOSHConnection.as
@@ -39,15 +39,15 @@
 		private var failedRequests:Array = [];
 		private var requestQueue:Array = [];
 		private var responseQueue:Array = [];
-		private const responseTimer:Timer = new Timer(0.0, 1);
+		private var responseTimer:Timer;
 		private var isDisconnecting:Boolean = false;
 		private var boshPollingInterval:Number = 10000;
 		private var sid:String;
 		private var rid:Number;
 		private var wait:int;
 		private var inactivity:int;
-		private var pollTimer:Timer = new Timer(1, 1);
-		private var pollTimeoutTimer:Timer = new Timer(1, 1);
+		private var pollTimer:Timer;
+		private var pollTimeoutTimer:Timer;

 		private var auth:SASLAuth;
 		private var authHandler:Function;
@@ -148,13 +148,14 @@
 	            maxConcurrentRequests = Math.min(serverRequests, maxConcurrentRequests);
 	        active = true;
 	        configureConnection(responseBody);
+	        responseTimer = new Timer(0.0, 1);
 	        responseTimer.addEventListener(TimerEvent.TIMER_COMPLETE, processResponse);
 	        trace(boshPollingInterval);
-	        pollTimer.delay = boshPollingInterval;
+	        pollTimer = new Timer(boshPollingInterval, 1);
+	        pollTimeoutTimer = new Timer(inactivity, 1);
 	        pollTimer.addEventListener(TimerEvent.TIMER_COMPLETE, pollServer);
 	        pollTimer.start();

-	        pollTimeoutTimer.delay = inactivity;
 	        pollTimeoutTimer.addEventListener(TimerEvent.TIMER_COMPLETE, function(evt:TimerEvent):void {
 				trace("Poll timed out, resuming");
 				pollServer(evt, true);
@@ -328,7 +329,8 @@
 				trace("Polling at: " + lastPollTime.getMinutes() + ":" + lastPollTime.getSeconds());
 			}

-			pollTimer.stop();
+			if(pollTimer)
+				pollTimer.stop();

 			return true;
 		}


"info.duration" is not always sent. This could give a NaN value in "myStatus.duration".

--- src/actionscript/happyworm/jPlayer/JplayerMp4.as
+++ src/actionscript/happyworm/jPlayer/JplayerMp4.as
@@ -388,7 +388,9 @@

 				myStatus.metaDataReady = true; // Set flag so that this event only effects jPlayer the 1st time.
 				myStatus.metaData = info;
-				myStatus.duration = info.duration * 1000; // Only available via Meta Data.
+				if(info.duration != undefined) {
+					myStatus.duration = info.duration * 1000; // Only available via Meta Data.
+				}
 				if(info.width != undefined) {
 					myVideo.width = myStatus.videoWidth = info.width;
 				}


no more event fsm

no more event fsm

--- src/com/phylake/fsm/impl/Fsm.as
+++ src/com/phylake/fsm/impl/Fsm.as
@@ -22,26 +22,11 @@
         protected var _destroyed:Boolean;
         protected var _actionFsm:IFsm;
         protected var _guardFsm:IFsm;
-        protected var _eventFsm:IFsm;
         protected var _rootFsm:IFsm;

-        /**
-         * An optional root IFsm to use instead of this one.
-         */
         public function set rootFsm(value:IFsm):void
         {
-            actionFsm = value;
-            guardFsm = value;
-            eventFsm = value;
             _rootFsm = value;
-        }
-
-        /**
-         * An optional IFsm to use for the event loop
-         */
-        public function set eventFsm(value:IFsm):void
-        {
-            _eventFsm = value;
         }

         /**
@@ -96,7 +81,6 @@
             _currentState = null;
             _actionFsm = null;
             _guardFsm = null;
-            _eventFsm = null;
             _rootFsm = null;
         }

@@ -123,15 +107,8 @@

         public function pushEvent(value:IEvent):void
         {
-            if (_eventFsm)
-            {
-                _eventFsm.pushEvent(value);
-            }
-            else
-            {
-                _events.push(value);
-                eventLoop();
-            }
+            _events.push(value);
+            eventLoop();
         }

         /**


added debug code

added debug code

--- WeaveUISpark/src/weave/visualization/plotters/HistogramPlotter.as
+++ WeaveUISpark/src/weave/visualization/plotters/HistogramPlotter.as
@@ -31,8 +31,8 @@
 	import weave.api.primitives.IBounds2D;
 	import weave.api.registerLinkableChild;
 	import weave.api.setSessionState;
+	import weave.api.ui.IPlotTask;
 	import weave.api.ui.ISelectableAttributes;
-	import weave.api.ui.IPlotTask;
 	import weave.core.LinkableBoolean;
 	import weave.core.LinkableString;
 	import weave.data.AttributeColumns.BinnedColumn;
@@ -50,6 +50,8 @@
 	 */
 	public class HistogramPlotter extends AbstractPlotter implements ISelectableAttributes
 	{
+		public var debug:Boolean = false;
+
 		public function HistogramPlotter()
 		{
 			clipDrawing = true;
@@ -186,6 +188,10 @@
 				initBoundsArray(output).setBounds(0, binIndex - 0.5, binHeight, binIndex + 0.5);
 			else
 				initBoundsArray(output).setBounds(binIndex - 0.5, 0, binIndex + 0.5, binHeight);
+
+			var bounds:IBounds2D = output[0];
+			if (debug)
+				debugTrace(recordKey.localName, bounds.getWidth(), bounds.getHeight())
 		}

 		/**


Clock button only appears if sysclocks can be added to the level

--- src/LevelStates/LevelState.as
+++ src/LevelStates/LevelState.as
@@ -1,6 +1,7 @@
 package LevelStates {
 	import flash.utils.Dictionary;
 	import flash.geom.Point;
+	import Modules.SysDelayClock;
 	import org.flixel.*;
 	import Actions.*;
 	import Controls.*;
@@ -195,7 +196,7 @@
 			makeSaveButtons();
 			makeUndoButtons();
 			makeTestButtons();
-			if (level.delay)
+			if (level.delay && level.allowedModules.indexOf(SysDelayClock) != -1)
 				makeClockButton();
 		}


Transferred from the Adobe Open Source Subversion Repository

Revision: 3509
Author:   jimurphy@adobe.com
Date:     2008-10-07T18:19:17.646255Z

Log Message:
-----------
Rename of flex -> mx.

For compatibility reasons it was decided that the new functionality remain integrated with the old framework, although we will continue to build two separate SWCs, one with primarily existing framework classes, and one with new Flex 4 classes. This change removes duplicate names from the Flex 4 framework to avoid class name overlapping with the old framework code.  The naming overlap consists of two major areas:  New Components, and New Effects

Modified Paths:
--------------
386 paths were modified

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

--- frameworks/projects/spark/src/SparkClasses.as
+++ frameworks/projects/spark/src/SparkClasses.as
@@ -23,37 +23,37 @@
  *  For example, Button does not have a reference to ButtonSkin,
  *  but ButtonSkin needs to be in framework.swc along with Button.
  */
-import flex.skin.ApplicationSkin; ApplicationSkin;
-import flex.graphics.Parser; Parser;
-import flex.skin.ButtonSkin; ButtonSkin;
-import flex.skin.CheckBoxSkin; CheckBoxSkin;
-import flex.skin.DataComponentSkin; DataComponentSkin;
-import flex.skin.HScrollBarSkin; HScrollBarSkin;
-import flex.skin.HScrollBarThumbSkin; HScrollBarThumbSkin;
-import flex.skin.HSliderSkin; HSliderSkin;
-import flex.skin.HSliderThumbSkin; HSliderThumbSkin;
-import flex.skin.HSliderTrackSkin; HSliderTrackSkin;
-import flex.skin.ItemsComponentSkin; ItemsComponentSkin;
-import flex.skin.ListSkin; ListSkin;
-import flex.skin.NumericStepperSkin; NumericStepperSkin;
-import flex.skin.RadioButtonSkin; RadioButtonSkin;
-import flex.skin.ScrollBarUpButtonSkin; ScrollBarUpButtonSkin;
-import flex.skin.ScrollBarDownButtonSkin; ScrollBarDownButtonSkin;
-import flex.skin.ScrollBarLeftButtonSkin; ScrollBarLeftButtonSkin;
-import flex.skin.ScrollBarRightButtonSkin; ScrollBarRightButtonSkin;
-import flex.skin.ScrollerSkin; ScrollerSkin;
-import flex.skin.SelectorSkin; SelectorSkin;
-import flex.skin.SpinnerDecrButtonSkin; SpinnerDecrButtonSkin;
-import flex.skin.SpinnerIncrButtonSkin; SpinnerIncrButtonSkin;
-import flex.skin.SpinnerSkin; SpinnerSkin;
-import flex.skin.TextAreaSkin; TextAreaSkin;
-import flex.skin.TextInputSkin; TextInputSkin;
-import flex.skin.ToggleButtonSkin; ToggleButtonSkin;
-import flex.skin.VScrollBarSkin; VScrollBarSkin;
-import flex.skin.VScrollBarThumbSkin; VScrollBarThumbSkin;
-import flex.skin.VSliderSkin; VSliderSkin;
-import flex.skin.VSliderThumbSkin; VSliderThumbSkin;
-import flex.skin.VSliderTrackSkin; VSliderTrackSkin;
+import mx.skins.spark.FxApplicationSkin; FxApplicationSkin;
+import mx.skins.spark.FxButtonSkin; FxButtonSkin;
+import mx.skins.spark.FxCheckBoxSkin; FxCheckBoxSkin;
+import mx.skins.spark.FxDataComponentSkin; FxDataComponentSkin;
+import mx.skins.spark.FxHScrollBarSkin; FxHScrollBarSkin;
+import mx.skins.spark.FxHScrollBarThumbSkin; FxHScrollBarThumbSkin;
+import mx.skins.spark.FxHSliderSkin; FxHSliderSkin;
+import mx.skins.spark.FxHSliderThumbSkin; FxHSliderThumbSkin;
+import mx.skins.spark.FxHSliderTrackSkin; FxHSliderTrackSkin;
+import mx.skins.spark.FxItemsComponentSkin; FxItemsComponentSkin;
+import mx.skins.spark.FxListSkin; FxListSkin;
+import mx.skins.spark.FxNumericStepperSkin; FxNumericStepperSkin;
+import mx.skins.spark.FxRadioButtonSkin; FxRadioButtonSkin;
+import mx.skins.spark.FxScrollBarUpButtonSkin; FxScrollBarUpButtonSkin;
+import mx.skins.spark.FxScrollBarDownButtonSkin; FxScrollBarDownButtonSkin;
+import mx.skins.spark.FxScrollBarLeftButtonSkin; FxScrollBarLeftButtonSkin;
+import mx.skins.spark.FxScrollBarRightButtonSkin; FxScrollBarRightButtonSkin;
+import mx.skins.spark.FxScrollerSkin; FxScrollerSkin;
+import mx.skins.spark.FxSelectorSkin; FxSelectorSkin;
+import mx.skins.spark.FxSpinnerDecrButtonSkin; FxSpinnerDecrButtonSkin;
+import mx.skins.spark.FxSpinnerIncrButtonSkin; FxSpinnerIncrButtonSkin;
+import mx.skins.spark.FxSpinnerSkin; FxSpinnerSkin;
+import mx.skins.spark.FxTextAreaSkin; FxTextAreaSkin;
+import mx.skins.spark.FxTextInputSkin; FxTextInputSkin;
+import mx.skins.spark.FxToggleButtonSkin; FxToggleButtonSkin;
+import mx.skins.spark.FxVScrollBarSkin; FxVScrollBarSkin;
+import mx.skins.spark.FxVScrollBarThumbSkin; FxVScrollBarThumbSkin;
+import mx.skins.spark.FxVSliderSkin; FxVSliderSkin;
+import mx.skins.spark.FxVSliderThumbSkin; FxVSliderThumbSkin;
+import mx.skins.spark.FxVSliderTrackSkin; FxVSliderTrackSkin;
+import mx.graphics.Parser; Parser;
 }

 }


TextFieldHelper autoSize bugfix

TextFieldHelper autoSize bugfix

--- src/ras3r/reaction_view/helpers/TextFieldHelper.as
+++ src/ras3r/reaction_view/helpers/TextFieldHelper.as
@@ -61,6 +61,7 @@
 		{
 			_autoSize = s;
 			setProperty('autoSize', s);
+			reset_text_size();
 		}

 		/**
@@ -156,7 +157,7 @@
 				with (proxied_object)
 				{
 					autoSize = _autoSize;
-					var h:Number = height;
+					var h:Number = textHeight;
 					autoSize = 'none';
 					height = h + getTextFormat().leading;
 				}
@@ -169,16 +170,7 @@
 			if (_autoSize != 'none') proxied_object.autoSize = _autoSize;
 			t ||= '';
 			setProperty(p, t);
-			// if autoSizing, work around scroll bug with this height hack
-			if (_autoSize != 'none')
-			{
-				with (proxied_object)
-				{
-					var h:Number = height;
-					autoSize = 'none';
-					height = h + getTextFormat().leading;
-				}
-			}
+			reset_text_size();
 		}
 	}
 }


Fixed load generation bug

Fixed load generation bug

--- src/Testing/Types/LoadType.as
+++ src/Testing/Types/LoadType.as
@@ -36,7 +36,7 @@

 		private function can_produce_with_one_contextual(value:AbstractArg, arg:AbstractArg, args:Vector.<AbstractArg>):Boolean {
 			return ((arg.inMemory && arg.value == value.value) ||
-					(arg.inRegisters && arg.value >= U.MIN_INT && arg.value <= U.MAX_MEM && !AbstractArg.addrInVec(arg.value, args)));
+					(arg.inRegisters && arg.value >= U.MIN_MEM && arg.value <= U.MAX_MEM && !AbstractArg.addrInVec(arg.value, args)));
 		}

 		override protected function can_produce_with(value:AbstractArg, args:Vector.<AbstractArg>):Boolean {
@@ -75,7 +75,9 @@
 		override protected function produce_with_one(value:AbstractArg, arg:AbstractArg):InstructionAbstraction {
 			if (arg.inMemory)
 				return new LoadAbstraction(arg.address, value.value);
-			return new LoadAbstraction(C.randomRange(U.MIN_MEM, U.MAX_MEM), value.value);
+			if (arg.inRegisters)
+				return new LoadAbstraction(arg.value, value.value);
+			throw new Error("Invalid arg to load abstraction!");
 		}

 		override protected function produce_with(value:AbstractArg, args:Vector.<AbstractArg>):InstructionAbstraction {


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

--- frameworks/projects/framework/src/mx/validators/PhoneNumberValidator.as
+++ frameworks/projects/framework/src/mx/validators/PhoneNumberValidator.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.validators
 {


remove dependencies on global levels Array (make the code re-entrant)

--- src/org/mangui/HLS/streaming/AutoLevelManager.as
+++ src/org/mangui/HLS/streaming/AutoLevelManager.as
@@ -9,12 +9,16 @@

         /** Reference to the HLS controller. **/
         private var _hls:HLS;
-        /** Reference to the manifest levels. **/
-        private var _levels:Array;
         /** switch up threshold **/
         private var _switchup:Array = null;
         /** switch down threshold **/
         private var _switchdown:Array = null;
+        /** bitrate array **/
+        private var _bitrate:Array = null;
+        /** nb level **/
+        private var _nbLevel:Number = 0;
+        /** lowest non audio level **/
+        private var _lowestNonAudioLevel:Number = -1;

         /** Create the loader. **/
         public function AutoLevelManager(hls:HLS):void {
@@ -24,50 +28,50 @@

         /** Store the manifest data. **/
         private function _manifestLoadedHandler(event:HLSEvent):void {
-            _levels = event.levels;
-            _initlevelswitch();
+            var levels:Array= event.levels;
+            var maxswitchup:Number=0;
+            var minswitchdwown:Number=Number.MAX_VALUE;
+            _nbLevel = levels.length;
+            _bitrate = new Array(_nbLevel);
+            _switchup = new Array(_nbLevel);
+            _switchdown = new Array(_nbLevel);
+            var i:Number;
+
+            for(i=0 ; i < _nbLevel; i++) {
+              _bitrate[i] = levels[i].bitrate;
+            }
+
+            // Select the lowest non-audio level.
+            for(i = 0; i < _nbLevel; i++) {
+                if(!levels[i].audio) {
+                    _lowestNonAudioLevel = i;
+                    break;
+                }
+            }
+
+            for(i=0 ; i < _nbLevel-1; i++) {
+               _switchup[i] = (_bitrate[i+1] - _bitrate[i]) / _bitrate[i];
+               maxswitchup = Math.max(maxswitchup,_switchup[i]);
+            }
+            for(i=0 ; i < _nbLevel-1; i++) {
+               _switchup[i] = Math.min(maxswitchup,2*_switchup[i]);
+               //Log.txt("_switchup["+i+"]="+_switchup[i]);
+            }
+
+            for(i = 1; i < _nbLevel; i++) {
+               _switchdown[i] = (_bitrate[i] - _bitrate[i-1]) / _bitrate[i];
+               minswitchdwown  =Math.min(minswitchdwown,_switchdown[i]);
+            }
+            for(i = 1; i < _nbLevel; i++) {
+               _switchdown[i] = Math.max(2*minswitchdwown,_switchdown[i]);
+               //Log.txt("_switchdown["+i+"]="+_switchdown[i]);
+            }
         };
-
-        /* initialize level switching heuristic tables */
-        private function _initlevelswitch():void {
-          var i:Number;
-          var maxswitchup:Number=0;
-          var minswitchdwown:Number=Number.MAX_VALUE;
-          _switchup = new Array(_levels.length);
-          _switchdown = new Array(_levels.length);
-
-          for(i=0 ; i < _levels.length-1; i++) {
-             _switchup[i] = (_levels[i+1].bitrate - _levels[i].bitrate) / _levels[i].bitrate;
-             maxswitchup = Math.max(maxswitchup,_switchup[i]);
-          }
-          for(i=0 ; i < _levels.length-1; i++) {
-             _switchup[i] = Math.min(maxswitchup,2*_switchup[i]);
-             //Log.txt("_switchup["+i+"]="+_switchup[i]);
-          }
-
-
-          for(i = 1; i < _levels.length; i++) {
-             _switchdown[i] = (_levels[i].bitrate - _levels[i-1].bitrate) / _levels[i].bitrate;
-             minswitchdwown  =Math.min(minswitchdwown,_switchdown[i]);
-          }
-          for(i = 1; i < _levels.length; i++) {
-             _switchdown[i] = Math.max(2*minswitchdwown,_switchdown[i]);
-             //Log.txt("_switchdown["+i+"]="+_switchdown[i]);
-          }
-        }

         /** Update the quality level for the next fragment load. **/
         public function getnextlevel(current_level:Number, buffer:Number, last_segment_duration:Number, last_fetch_duration:Number, last_bandwidth:Number):Number {
-         var i:Number;
-
-            var level:Number = -1;
-            // Select the lowest non-audio level.
-            for(i = 0; i < _levels.length; i++) {
-                if(!_levels[i].audio) {
-                    level = i;
-                    break;
-                }
-            }
+            var i:Number;
+            var level:Number = _lowestNonAudioLevel;
             if(level == -1) {
                 Log.txt("No other quality levels are available");
                 return -1;
@@ -88,7 +92,7 @@
                the condition (bufferratio > 2*_levels[_level+1].bitrate/_last_bandwidth)
                ensures that buffer time is bigger than than the time to download 2 fragments from current_level+1, if we keep same bandwidth
             */
-            if((current_level < _levels.length-1) && (fetchratio > (1+_switchup[current_level])) && (bufferratio > 2*_levels[current_level+1].bitrate/last_bandwidth)) {
+            if((current_level < _nbLevel-1) && (fetchratio > (1+_switchup[current_level])) && (bufferratio > 2*_bitrate[current_level+1]/last_bandwidth)) {
                //Log.txt("fetchratio:> 1+_switchup[_level]="+(1+_switchup[current_level]));
                //Log.txt("switch to level " + (current_level+1));
                   //level up
@@ -99,7 +103,7 @@
                or buffer time is too small to retrieve one fragment with current level
             */

-            else if(current_level > 0 &&((fetchratio < (1-_switchdown[current_level])) || (bufferratio < 1)) ) {
+            else if(current_level > 0 && ((fetchratio < (1-_switchdown[current_level])) || (bufferratio < 1)) ) {
                   //Log.txt("bufferratio < 2 || fetchratio: < 1-_switchdown[_level]="+(1-_switchdown[_level]));
                   /* find suitable level matching current bandwidth, starting from current level
                      when switching level down, we also need to consider that we might need to load two fragments.
@@ -107,7 +111,7 @@
                     ensures that buffer time is bigger than than the time to download 2 fragments from level j, if we keep same bandwidth
                   */
                   for(var j:Number = current_level-1; j > 0; j--) {
-                     if( _levels[j].bitrate <= last_bandwidth && (bufferratio > 2*_levels[j].bitrate/last_bandwidth)) {
+                     if( _bitrate[j] <= last_bandwidth && (bufferratio > 2*_bitrate[j]/last_bandwidth)) {
                           Log.txt("switch to level " + j);
                           return j;
                       }


Transferred from the Adobe Open Source Subversion Repository

Revision: 7163
Author:   aharui@adobe.com
Date:     2009-05-21T02:19:55.813792Z

Log Message:
-----------
Initial checkin of frame 1 cleanup.  In an RSL linkage, more classes will now come from the RSL because they are no longer needed in frame 1, and the size of the application SWF will be smaller.

QE Notes: None
Doc Notes: Maybe.  All new classes should be undocumented, but it might be worth checking that and any changes to interfaces
Bugs:
Reviewer: darrell
tests: checkintests mustella/MarshallPlan

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/TileListItemRenderer.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/systemClasses/ActiveWindowManager.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/marshalClasses</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/LayoutManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/RSLEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Menu.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/marshalClasses/MarshalPopUpData.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IEmbeddedFontRegistry.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/PopUpManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ColorPicker.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/StandardDefs.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/systemClasses/EventProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextFormat.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/tools/dependencychecker/flex/tools/dependencychecker/FrameworkSwcDependencyRules.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/DragManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Application.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridColumn.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/EmbeddedFontRegistry.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/ToolTipManagerImpl.as</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/framework/src/mx/core/EmbeddedFont.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/tools/PreLink.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/preloaders/Preloader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/resources/ResourceManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ResourceModuleRSLItem.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/ISWFBridgeProvider.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/marshalClasses/FocusManagerMarshalMixin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/Window.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/resources/ResourceManager.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/IMarshalSystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/EventListenerRequest.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/marshalClasses/ToolTipManagerMarshalMixin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/tools/dependencychecker/frameworkSwcExceptionsList.txt</path>
<path kind="file" action="M">/flex/sdk/trunk/mustella/MustellaResultsParser.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Alert.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/systemClasses/ChildManager.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/systemClasses/MarshallPlan.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManagerGlobals.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/SWFBridgeGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/alertClasses/AlertForm.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/spark/components/Window.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/treeClasses/TreeItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/ISystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework_textLayout/src/mx/core/UITLFTextField.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/marshalClasses/DragManagerMarshalMixin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/MenuBar.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/Request.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/framework/src/mx/styles/CSSStyleDeclaration.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/FlexEvent.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/IActiveWindowManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Application.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/SimpleText.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/marshalClasses/PopUpManagerMarshalMixin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManagerProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/messaging/config/LoaderConfig.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/IFocusManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/preloaders/DownloadProgressBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ScrollControlBase.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/ISystemManagerChildManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridItemRenderer.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/marshalClasses/CursorManagerMarshalMixin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/CursorManagerImpl.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/PopUpData.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ISWFBridgeGroup.as</path>

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

--- frameworks/projects/framework/src/mx/managers/SystemManagerGlobals.as
+++ frameworks/projects/framework/src/mx/managers/SystemManagerGlobals.as
@@ -26,6 +26,20 @@
 	public static var showMouseCursor:Boolean;

 	public static var changingListenersInOtherSystemManagers:Boolean;
+
+    /**
+     *  @private
+     *  reference to the info() object from the first systemManager
+	 *  in the application..
+     */
+	public static var info:Object;
+
+    /**
+     *  @private
+     *  reference to the loaderInfo.parameters object from the first systemManager
+	 *  in the application..
+     */
+	public static var parameters:Object;
 }

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 10870
Author:   cframpto@adobe.com
Date:     2009-10-05T18:23:10.599724Z

Log Message:
-----------
In the past when the width (or maxWidth) wasn’t specified we told TLF that the width was our default maxWidth=10000.  This had implications especially when the text was rtl or textAlign != left because it aligned over a width of 10000. With this change we let TLF measure.  It will figure out the widest line and use that for the width.  Text will be aligned on that width.  So if there is only one line, and no explicit width, left, center and right alignment all look the same.

Truncation results will be slightly different now if there isn’t an explicit width.  We will let TLF measure the width and it will use that width for the truncation.  Depending on whether the last line is the widest line or not, it may have to remove some of the text to make room for the truncation indicator.

QE notes: there are a handful of RichText and Label failures as a result of this change - Ella approved the submit.
Doc notes:
Bugs: SDK-22909
Reviewer: Gordon
Tests run: checkintests, TextArea, TextInput, NumericStepper, RichText, Label
Is noteworthy for integration: yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/RichEditableTextContainerManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Label.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -2460,15 +2460,12 @@
                 bounds = measureTextSize(composeWidth);

                 measuredWidth = _textContainerManager.compositionWidth;
-                measuredHeight = Math.ceil(bounds.height);
+                measuredHeight = Math.ceil(bounds.bottom);
             }
             else if (!isNaN(heightConstraint) || !isNaN(explicitHeight) ||
                      !isNaN(_heightInLines))
             {
                 // if no text, 1 char wide with specified height and grow
-
-                composeWidth =
-                    hostFormat.lineBreak == "toFit" ? maxWidth : NaN;

                 if (!isNaN(heightConstraint))
                     composeHeight = heightConstraint;
@@ -2478,12 +2475,12 @@
                     composeHeight = calculateHeightInLines();

                 // The composeWidth may be adjusted for minWidth/maxWidth.
-                bounds = measureTextSize(composeWidth);
+                bounds = measureTextSize(NaN);

                 // Have we already hit the limit with the existing text?  If we
                 // are beyond the composeHeight we can assume we've maxed out on
                 // the compose width as well.
-                if (bounds.height > composeHeight)
+                if (bounds.bottom > composeHeight)
                 {
                     measuredWidth = _textContainerManager.compositionWidth;
                     measuredHeight = composeHeight;
@@ -2491,24 +2488,17 @@
                 }
                 else
                 {
-                    measuredWidth = Math.ceil(bounds.width);
+                    measuredWidth = Math.ceil(bounds.right);
                     measuredHeight = composeHeight;
                 }
             }
             else
             {
-                // If toFit line breaks and no text, start at explicitMaxWidth
-                // or default to maxWidth.
-                // If explicit line breaks and no text, width is NaN
-
-                composeWidth =
-                    hostFormat.lineBreak == "toFit" ? maxWidth : NaN;
-
                 // The composeWidth may be adjusted for minWidth/maxWidth.
-                bounds = measureTextSize(composeWidth);
-
-                measuredWidth = Math.ceil(bounds.width);
-                measuredHeight = Math.ceil(bounds.height);
+                bounds = measureTextSize(NaN);
+
+                measuredWidth = Math.ceil(bounds.right);
+                measuredHeight = Math.ceil(bounds.bottom);
             }

             // Clamp the height, except if we're using the explicitHeight.
@@ -3277,17 +3267,22 @@
      */
     private function measureTextSize(composeWidth:Number):Rectangle
     {
-        var clampWidth:Boolean = isNaN(explicitWidth);
-
         // Don't want to trigger a another remeasure when we compose the text.
         ignoreDamageEvent = true;

-        // Up the composeWidth if it isn't at least minWidth so we get an
-        // accurate measurement.
-        if (clampWidth &&
-            !isNaN(explicitMinWidth) && composeWidth < explicitMinWidth)
-        {
-            composeWidth = explicitMinWidth;
+        // Adjust for explicit min/maxWidth so the measurement is accurate.
+        if (isNaN(explicitWidth))
+        {
+            if (!isNaN(explicitMinWidth) &&
+                isNaN(composeWidth) || composeWidth < minWidth)
+            {
+                composeWidth = minWidth;
+            }
+            if (!isNaN(explicitMaxWidth) &&
+                isNaN(composeWidth) || composeWidth > maxWidth)
+            {
+                composeWidth = maxWidth;
+            }
         }

         // The bottom border can grow to allow all the text to fit.
@@ -3297,21 +3292,12 @@
         // Compose only.  The display should not be updated.
         _textContainerManager.compose();

-        var bounds:Rectangle = _textContainerManager.getContentBounds();
-
-        // Remeasure if the composed width was restricted by max width.
-        // Typical this is done in validateSize() after returing from measure()
-        // but it impacts our calculations so we need to do it now.
-        if (clampWidth && bounds.width > maxWidth)
-        {
-            _textContainerManager.compositionWidth = composeWidth;
-            _textContainerManager.compose();
-            bounds = _textContainerManager.getContentBounds();
-        }
-
+        // Adjust width and height for text alignment.
+        var bounds:Rectangle = _textContainerManager.getContentBounds();
+
         // If it's an empty text flow, there is one line with one
         // character so the height is good for the line but we
-        // need to give it some width.
+        // need to give it some width other than optional padding.

          if (_textContainerManager.getText().length == 0)
         {


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

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