Transferred from the Adobe Open Source Subversion Repository

Revision: 4960
Author:   gosmith@adobe.com
Date:     2009-02-14T02:23:27.721068Z

Log Message:
-----------
Decreased the number of Gumbo style buckets.

Combined AdvancedCharacterFormatTextStyles.as, AdvancedParagraphFormatTextStyles.as, and AdvancedContainerFormatTextStyles.as into AdvancedTextLayoutFormatStyles.as.

Combined BasicCharacterFormatTextStyles.as, BasicParagraphFormatTextStyles.as, and BasicContainerFormatTextStyles.as into BasicTextLayoutFormatStyles.as.

The reason for doing this is that TLF combined its CharacterFormat, ParagraphFormat, and ContainerFormat classes into a single TextLayoutFormat.

QE Notes: None
Doc Notes: None
Bugs: None
Reviewer: None; no functional change

Modified Paths:
--------------
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/AdvancedCharacterFormatTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxScroller.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/BasicContainerFormatTextStyles.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/AdvancedParagraphFormatTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextGraphic.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/BasicCharacterFormatTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxNumericStepper.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/AdvancedTextLayoutFormatStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxTextBase.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/BasicParagraphFormatTextStyles.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/AdvancedContainerFormatTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxDataContainer.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/BasicTextLayoutFormatStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/TextView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxContainer.as</path>

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -108,12 +108,8 @@
 //  Styles
 //--------------------------------------

-include "../styles/metadata/BasicContainerFormatTextStyles.as"
-include "../styles/metadata/AdvancedContainerFormatTextStyles.as"
-include "../styles/metadata/BasicParagraphFormatTextStyles.as"
-include "../styles/metadata/AdvancedParagraphFormatTextStyles.as"
-include "../styles/metadata/BasicCharacterFormatTextStyles.as"
-include "../styles/metadata/AdvancedCharacterFormatTextStyles.as"
+include "../styles/metadata/AdvancedTextLayoutFormatStyles.as"
+include "../styles/metadata/BasicTextLayoutFormatStyles.as"
 include "../styles/metadata/SelectionFormatTextStyles.as"

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 12362
Author:   cframpto@adobe.com
Date:     2009-12-02T13:30:12.251693Z

Log Message:
-----------
Revert the part of svn 12322 that added support for custom context menus to TextArea, TextInput and RichEditableText.  This needs to be reworked so that it builds and works correctly for AIR apps as well.

Apparently you can't override the contextMenu setter/getter because they use a ContextMenu on Flash and a NativeMenu on AIR so the signatures will only match one environment depending on which menu class you use.

Reopened SDK-23926.

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

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

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -1034,33 +1034,33 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    override public function get contextMenu():ContextMenu
-    {
-        if (!contextMenuSet)
-        {
-            super.contextMenu = _textContainerManager.getContextMenu();
-            contextMenuSet = true;
-        }
-
-        return super.contextMenu;
-    }
-
-    /**
-     *  @private
-     */
-    override public function set contextMenu(value:ContextMenu):void
-    {
-        if (contextMenuSet && super.contextMenu == value)
-            return;
-
-        // If the context menu is being reset need to update the menu listeners.
-        if (contextMenuSet && super.contextMenu)
-            _textContainerManager.resetContextMenuListener(value);
-
-        super.contextMenu = value;
-
-        contextMenuSet = true;
-    }
+//    override public function get contextMenu():ContextMenu
+//    {
+//        if (!contextMenuSet)
+//        {
+//            super.contextMenu = _textContainerManager.getContextMenu();
+//            contextMenuSet = true;
+//        }
+//
+//        return super.contextMenu;
+//    }
+
+    /**
+     *  @private
+     */
+//    override public function set contextMenu(value:ContextMenu):void
+//    {
+//        if (contextMenuSet && super.contextMenu == value)
+//            return;
+//
+//        // If the context menu is being reset need to update the menu listeners.
+//        if (contextMenuSet && super.contextMenu)
+//            _textContainerManager.resetContextMenuListener(value);
+//
+//        super.contextMenu = value;
+//
+//        contextMenuSet = true;
+//    }

     //----------------------------------
     //  horizontalScrollPosition


Transferred from the Adobe Open Source Subversion Repository

Revision: 20118
Author:   cframpto@adobe.com
Date:     2011-02-04T01:16:08.985955Z

Log Message:
-----------
Remove [Inspectable(environment="none")] metadata which I added recently to the content property of RichEditableText, RichText, and TextArea.  Apparently Catalyst generates code to these and design model needs them to be resolvable in code model.  As a bonus got a few ASdoc changes in TextArea that I've been working on for mobile text.

QE notes:
Doc notes:
Bugs:
Reviewer: Kevin
Tests run: spark compiles
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/TextArea.as</path>

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -1245,7 +1245,6 @@
          *  within <p>, <span>, etc.
          */
         [RichTextContent]
-        [Inspectable(environment="none")]

         /**
          *  This property is intended for use in MXML at compile time;


Change IconFetchEvent.COMPLETE value to camel case.

--- src/com/esri/builder/supportClasses/IconFetchEvent.as
+++ src/com/esri/builder/supportClasses/IconFetchEvent.as
@@ -20,7 +20,7 @@

 public class IconFetchEvent extends Event
 {
-    public static const FETCH_COMPLETE:String = "FETCH_COMPLETE";
+    public static const FETCH_COMPLETE:String = "fetchComplete";

     private var _iconPath:String;


OFC-180	Fix column widths on multiple enumerated entities

--- collect-flex/collect-flex-client/src/generated/flex/org/openforis/collect/model/proxy/RecordProxy.as
+++ collect-flex/collect-flex-client/src/generated/flex/org/openforis/collect/model/proxy/RecordProxy.as
@@ -64,7 +64,10 @@
 				node = response.createdNode;
 				parent = getNode(node.parentId) as EntityProxy;
 				parent.addChild(node);
-				_nodesMap[node.id] = node;
+				initNode(node);
+				if(node is EntityProxy) {
+					EntityProxy(node).traverse(initNode);
+				}
 			}
 			if(response.deletedNodeId > 0) {
 				node = getNode(response.deletedNodeId);


Remap logic refactored to use a single path.

Better best effort state tracking.
MUCH saner last sequence tracking that now takes into account the
related manifest.
Plays live streams well but Kaltura VOD broken.

--- HLSPlugin/src/com/kaltura/hls/HLSIndexHandler.as
+++ HLSPlugin/src/com/kaltura/hls/HLSIndexHandler.as
@@ -14,6 +14,7 @@
 	import flash.events.TimerEvent;
 	import flash.utils.Timer;
 	import flash.utils.ByteArray;
+	import flash.utils.getTimer;
 	import flash.utils.IDataInput;

 	import org.osmf.events.DVRStreamInfoEvent;
@@ -45,7 +46,33 @@
 		// The new current seek target.
 		public var bumpedSeek:Number = 0;

-		public var lastSequence:int = 0;
+		public var _lastSequence:int = 0;
+		public var _lastSequenceManifest:HLSManifestParser = null;
+
+		public function updateLastSequence(newManifest:HLSManifestParser, newSeq:int):void
+		{
+			trace("UPDATING LAST SEQUENCE " + newSeq + " manifest=" + newManifest.fullUrl);
+			_lastSequence = newSeq;
+			_lastSequenceManifest = newManifest;
+		}
+
+		public function getLastSequence():int
+		{
+			return _lastSequence;
+		}
+
+		public function getLastSequenceManifest():HLSManifestParser
+		{
+			return _lastSequenceManifest;
+		}
+
+		public function getLastSequenceSegments():Vector.<HLSManifestSegment>
+		{
+			if(_lastSequenceManifest)
+				return _lastSequenceManifest.segments;
+			return new Vector.<HLSManifestSegment>();
+		}
+
 		public var lastKnownPlaylistStartTime:Number = 0.0;
 		public var lastQuality:int = 0;
 		public var targetQuality:int = 0;
@@ -83,6 +110,20 @@

 		private var _pendingBestEffortRequest:HTTPStreamRequest = null;

+		private var _pendingBestEffortStartTime:int = -1;
+
+		private function isBestEffortActive():Boolean
+		{
+			var dt:int = getTimer() - _pendingBestEffortStartTime;
+			if(dt > 30*1000) // Timeout on best effort requests of 30 seconds.
+				return false;
+			if(_bestEffortDownloaderMonitor != null)
+				return true;
+			if(_pendingBestEffortRequest != null)
+				return true;
+			return false;
+		}
+
 		// constants used by getNextRequestForBestEffortPlay:
 		private static const BEST_EFFORT_PLAY_SITUAUTION_NORMAL:String = "normal";
 		private static const BEST_EFFORT_PLAY_SITUAUTION_DROPOUT:String = "dropout";
@@ -221,7 +262,7 @@
 			for(var i:int=0; i<segments.length; i++)
 			{
 				var seg:HLSManifestSegment = segments[i];
-				if(seg.startTime <= time && time <= (seg.startTime + seg.duration))
+				if(seg.startTime <= time && time < (seg.startTime + seg.duration))
 					return seg;
 			}

@@ -295,7 +336,7 @@

 			// Make sure we have knowledge of our current stream.
 			if(!checkAnySegmentKnowledge(getManifestForQuality(lastQuality).segments)
-				&& !_bestEffortDownloaderMonitor)
+				&& !isBestEffortActive())
 				_pendingBestEffortRequest = initiateBestEffortRequest(uint.MAX_VALUE, lastQuality);

 			// Reload the manifest we were given, if we were given a manifest
@@ -305,7 +346,6 @@
 			reloadingManifest.addEventListener(Event.COMPLETE, onReloadComplete);
 			reloadingManifest.addEventListener(IOErrorEvent.IO_ERROR, onReloadError);
 			reloadingManifest.reload(manToReload);
-
 		}

 		private function onReloadError(event:Event):void
@@ -417,6 +457,117 @@
 			}

 			return true;
+		}
+
+		/**
+		 * Attempt to remap a sequence from an old manifest to a new.
+		 *
+		 * Will fire timebase fetches.
+		 *
+		 * @param end If true, we remap based on end time of cur segment, else on start time.
+		 *
+		 * Returns -1 if it can't fulfill request right now.
+		 */
+		private function remapSequence(currentManifest:HLSManifestParser, newManifest:HLSManifestParser, currentSequence:int, end:Boolean = true):int
+		{
+			if(currentManifest == null)
+			{
+				trace("remapSequence - no currentManifest!")
+				return -1;
+			}
+
+			if(newManifest == null)
+			{
+				trace("remapSequence - no newManifest!");
+				return -1;
+			}
+
+			if(currentManifest == newManifest)
+			{
+				return currentSequence;
+			}
+
+			var newSequence:int = -1;
+
+			// Check knowledge on both sequences and queue request as appropriate.
+			if(!checkAnySegmentKnowledge(newManifest.segments) && !isBestEffortActive())
+			{
+				trace("(A) Encountered a live/VOD manifest with no timebase knowledge, request newest segment via best effort path for quality " + reloadingQuality);
+				_pendingBestEffortRequest = initiateBestEffortRequest(newManifest.streamEnds ? 0 : uint.MAX_VALUE, reloadingQuality, newManifest.segments);
+			}
+			else if(!checkAnySegmentKnowledge(currentManifest.segments) && !isBestEffortActive())
+			{
+				trace("(B) Encountered a live/VOD manifest with no timebase knowledge, request newest segment via best effort path for quality " + reloadingQuality);
+				_pendingBestEffortRequest = initiateBestEffortRequest(currentManifest.streamEnds ? 0 : uint.MAX_VALUE, lastQuality);
+			}
+
+			if(!checkAnySegmentKnowledge(newManifest.segments) || !checkAnySegmentKnowledge(currentManifest.segments))
+			{
+				trace("Bailing on reload due to lack of knowledge!");
+
+				// re-reload.
+				reloadingManifest = null; // don't want to hang on to this one.
+				if (reloadTimer) reloadTimer.start();
+
+				return -1;
+			}
+
+			// Remap time!
+			updateSegmentTimes(currentManifest.segments);
+			updateSegmentTimes(newManifest.segments);
+
+			const fudgeTime:Number = 1.0;
+			var currentSeg:HLSManifestSegment = getSegmentBySequence(currentManifest.segments, currentSequence);
+			var newSeg:HLSManifestSegment = currentSeg ? getSegmentContainingTime(newManifest.segments, currentSeg.startTime + (end ? currentSeg.duration : 0)) : null;
+			if(newSeg == null)
+			{
+				trace("Remapping from " + currentSequence);
+
+				if(currentSeg)
+				{
+					// Guess by time....
+					trace("Found last seg with startTime = " + currentSeg.startTime + " duration=" + currentSeg.duration);
+
+					// If the segment is beyond last ID, then jump to end...
+					if(currentSeg.startTime + currentSeg.duration >= newManifest.segments[newManifest.segments.length-1].startTime)
+					{
+						trace("ERROR: Couldn't remap sequence to new quality level, restarting at last time " + newManifest.segments[newManifest.segments.length-1].startTime);
+						newSequence = newManifest.segments[newManifest.segments.length-1].id;
+					}
+					else
+					{
+						trace("ERROR: Couldn't remap sequence to new quality level, restarting at first time " + newManifest.segments[0].startTime);
+						newSequence = newManifest.segments[0].id;
+					}
+				}
+				else
+				{
+					// Guess by sequence number...
+					trace("No last seg found");
+
+					// If the segment is beyond last ID, then jump to end...
+					if(currentSequence >= newManifest.segments[newManifest.segments.length-1].id)
+					{
+						trace("ERROR: Couldn't remap sequence to new quality level, restarting at last sequence " + newManifest.segments[newManifest.segments.length-1].id);
+						newSequence = newManifest.segments[newManifest.segments.length-1].id;
+					}
+					else
+					{
+						trace("ERROR: Couldn't remap sequence to new quality level, restarting at first sequence " + newManifest.segments[0].id);
+						newSequence = newManifest.segments[0].id;
+					}
+				}
+			}
+			else
+			{
+				trace("Currently on #" + currentSequence + " start=" + currentSeg.startTime + " end=" + (currentSeg.startTime + currentSeg.duration));
+				newSequence = newSeg.id;
+				trace("===== Remapping to #" + newSequence + " start=" + newSeg.startTime + " end=" + (newSeg.startTime + newSeg.duration) );
+			}
+
+			// And note how we ended.
+			trace("   o Ended at " + newSequence);
+			return newSequence;
 		}

 		private function onReloadComplete(event:Event):void
@@ -478,97 +629,14 @@

 			var timerOnErrorDelay:Number = newManifest.targetDuration * 1000  / 2;

-			// If we're not switching quality or going to a backup stream
-			if (reloadingQuality == lastQuality)
-			{
-				// Do nothing.
-			}
-			else if (reloadingQuality == targetQuality)
-			{
-				// If we are going to a quality level we don't know about, go ahead
-				// and best-effort-fetch a segment from it to establish the timebase.
-				if(!checkAnySegmentKnowledge(newManifest.segments)
-					&& !_bestEffortDownloaderMonitor)
-				{
-					trace("(A) Encountered a live/VOD manifest with no timebase knowledge, request newest segment via best effort path for quality " + reloadingQuality);
-					_pendingBestEffortRequest = initiateBestEffortRequest(uint.MAX_VALUE, reloadingQuality, newManifest.segments);
-				} else if(!checkAnySegmentKnowledge(currentManifest.segments)
-					&& !_bestEffortDownloaderMonitor)
-				{
-					trace("(B) Encountered a live/VOD manifest with no timebase knowledge, request newest segment via best effort path for quality " + reloadingQuality);
-					_pendingBestEffortRequest = initiateBestEffortRequest(uint.MAX_VALUE, lastQuality);
-				}
-
-				if(!checkAnySegmentKnowledge(newManifest.segments) || !checkAnySegmentKnowledge(currentManifest.segments))
-				{
-					trace("Bailing on reload due to lack of knowledge!");
-
-					// re-reload.
-					reloadingManifest = null; // don't want to hang on to this one.
-					if (reloadTimer) reloadTimer.start();
-
-					return;
-				}
-
-			}
-
-			// Remap time.
-			if(reloadingQuality != lastQuality)
-			{
-				updateSegmentTimes(currentManifest.segments);
-				updateSegmentTimes(newManifest.segments);
-
-				const fudgeTime:Number = 1.0;
-				var lastSeg:HLSManifestSegment = getSegmentBySequence(currentManifest.segments, lastSequence);
-				var newSeg:HLSManifestSegment = lastSeg ? getSegmentContainingTime(newManifest.segments, lastSeg.startTime + lastSeg.duration) : null;
-				if(newSeg == null)
-				{
-					trace("Remapping from " + lastSequence);
-
-					if(lastSeg)
-					{
-						// Guess by time....
-						trace("Found last seg with startTime = " + lastSeg.startTime + " duration=" + lastSeg.duration);
-
-						// If the segment is beyond last ID, then jump to end...
-						if(lastSeg.startTime + lastSeg.duration >= newManifest.segments[newManifest.segments.length-1].startTime)
-						{
-							trace("ERROR: Couldn't remap sequence to new quality level, restarting at last time " + newManifest.segments[newManifest.segments.length-1].startTime);
-							lastSequence = newManifest.segments[newManifest.segments.length-1].id;
-						}
-						else
-						{
-							trace("ERROR: Couldn't remap sequence to new quality level, restarting at first time " + newManifest.segments[0].startTime);
-							lastSequence = newManifest.segments[0].id;
-						}
-					}
-					else
-					{
-						// Guess by sequence number...
-						trace("No last seg found");
-
-						// If the segment is beyond last ID, then jump to end...
-						if(lastSequence >= newManifest.segments[newManifest.segments.length-1].id)
-						{
-							trace("ERROR: Couldn't remap sequence to new quality level, restarting at last sequence " + newManifest.segments[newManifest.segments.length-1].id);
-							lastSequence = newManifest.segments[newManifest.segments.length-1].id;
-						}
-						else
-						{
-							trace("ERROR: Couldn't remap sequence to new quality level, restarting at first sequence " + newManifest.segments[0].id);
-							lastSequence = newManifest.segments[0].id;
-						}
-					}
-				}
-				else
-				{
-					trace("Remapping from " + lastSequence + " to " + lastSeg.startTime + "-" + (lastSeg.startTime + lastSeg.duration));
-					trace("===== Remapping to " + lastSequence + " newId=" + (newSeg.id) + " newTime=" + newSeg.startTime + "-" + (newSeg.startTime + newSeg.duration) );
-					lastSequence = newSeg.id;
-				}
-
-				// Dec for next time around.
-				trace("   o Ended at " + lastSequence);
+			// Remap if needed.
+			var newSequence:int = remapSequence(getLastSequenceManifest(), newManifest, getLastSequence(), false);
+			if(newSequence == -1)
+			{
+				reloadingManifest = null; // don't want to hang on to it
+				if (reloadTimer) reloadTimer.start();
+				trace("Can't remap to new manifest, aborting!")
+				return;
 			}

 			// Update our manifest for this quality level.
@@ -579,6 +647,9 @@
 				manifest = newManifest;
 			lastQuality = reloadingQuality;

+			// Update last sequence state.
+			updateLastSequence(newManifest, newSequence);
+
 			// Kick off the next round as appropriate.
 			dispatchDVRStreamInfo();
 			updateTotalDuration();
@@ -659,18 +730,18 @@
 			quality = getWorkingQuality(quality);
 			var segments:Vector.<HLSManifestSegment> = getSegmentsForQuality( origQuality );

-			// If it's the initial MAX_VALUE see, we can jump to last segment less 3.
-			if(time == Number.MAX_VALUE && segments.length > 0)
-			{
-				trace("Seeking to end due to MAX_VALUE.");
-				lastSequence = int.MAX_VALUE;
-			}
-
-			if(!checkAnySegmentKnowledge(segments) && !_bestEffortDownloaderMonitor)
-			{
-				// We may also need to establish a timebase.
-				trace("Seeking without timebase; initiating request.")
-				return initiateBestEffortRequest(uint.MAX_VALUE, origQuality);
+			if(!checkAnySegmentKnowledge(segments))
+			{
+				if(!isBestEffortActive())
+				{
+					// We may also need to establish a timebase.
+					trace("Seeking without timebase; initiating request.")
+					return initiateBestEffortRequest(uint.MAX_VALUE, origQuality);
+				}
+				else
+				{
+					return new HTTPStreamRequest (HTTPStreamRequestKind.LIVE_STALL);
+				}
 			}

 			if(time < segments[0].startTime)
@@ -690,13 +761,11 @@
 			{
 				trace("Got out of bound timestamp. Trying to recover...");

-				var lastSeg:HLSManifestSegment = segments[segments.length - 1];
-				if(segments.length >=4 )
-					lastSeg = segments[segments.length - 3];
+				var lastSeg:HLSManifestSegment = segments[Math.max(0, segments.length - 3)];

 				if(time < segments[0].startTime)
 				{
-					trace("Fell off oldest segment, going to end #" + segments[0].id)
+					trace("Fell off oldest segment, going to start #" + segments[0].id)
 					seq = segments[0].id;
 					//bumpedTime = true;
 				}
@@ -711,15 +780,12 @@
 			if(seq != -1)
 			{
 				var curSegment:HLSManifestSegment = getSegmentBySequence(segments, seq);
-
-				lastSequence = seq;
-
-				//bumpedSeek = curSegment.startTime;
+				updateLastSequence(getManifestForQuality(origQuality), seq);

 				fileHandler.segmentId = seq;
 				fileHandler.key = getKeyForIndex( seq );
 				fileHandler.segmentUri = curSegment.uri;
-				trace("Getting Segment[" + lastSequence + "] StartTime: " + curSegment.startTime + " Continuity: " + curSegment.continuityEra + " URI: " + curSegment.uri);
+				trace("Getting Segment[" + seq + "] StartTime: " + curSegment.startTime + " Continuity: " + curSegment.continuityEra + " URI: " + curSegment.uri);
 				return createHTTPStreamRequest( curSegment );
 			}
 			else
@@ -757,9 +823,12 @@
 			}

 			// Report stalls and/or wait on timebase establishment.
-			if (stalled || _bestEffortDownloaderMonitor)
+			if (stalled)
 			{
 				trace("Stalling -- quality[" + quality + "] lastQuality[" + lastQuality + "]");
+
+				// TODO - ensure a reload is pending?
+
 				return new HTTPStreamRequest(HTTPStreamRequestKind.LIVE_STALL);
 			}

@@ -770,39 +839,42 @@
 			quality = getWorkingQuality(quality);

 			var currentManifest:HLSManifestParser = getManifestForQuality ( origQuality );
-			var oldManifest:HLSManifestParser = getManifestForQuality ( lastQuality);
-
-			var segments:Vector.<HLSManifestSegment> = currentManifest.segments;
-			var oldSegments:Vector.<HLSManifestSegment> = oldManifest.segments;
-
-			// If no knowledge available, cue up a best effort fetch.
-			if(!checkAnySegmentKnowledge(segments))
-			{
-				trace("Lack timebase for this manifest...");
-				if(!_bestEffortDownloaderMonitor)
-				{
-					trace("Initiating best effort request");
-					return initiateBestEffortRequest(uint.MAX_VALUE, origQuality);
+			var oldManifest:HLSManifestParser = getLastSequenceManifest();
+
+			if(quality != origQuality && isBestEffortActive())
+			{
+				trace("Waiting on best effort to resolve...");
+				return new HTTPStreamRequest(HTTPStreamRequestKind.LIVE_STALL);
+			}
+
+			// If no old manifest, it's a new play session.
+			if(oldManifest == null)
+			{
+				trace("SEEDING LAST SEQUENCE");
+				if(currentManifest.streamEnds == true)
+				{
+					updateLastSequence(currentManifest, 0);
 				}
 				else
 				{
-					trace("Best effort request pending, so stalling.");
-					return new HTTPStreamRequest(HTTPStreamRequestKind.LIVE_STALL, null, RETRY_INTERVAL);
-				}
-			}
-
-			if(!checkAnySegmentKnowledge(oldSegments))
-			{
-				trace("Lack timebase for this manifest...");
-				if(!_bestEffortDownloaderMonitor)
-				{
-					trace("Initiating best effort request");
-					return initiateBestEffortRequest(uint.MAX_VALUE, lastQuality);
+					updateLastSequence(currentManifest, currentManifest.segments[Math.max(0, currentManifest.segments.length - 4)].id);
+				}
+			}
+
+			// Attempt remap.
+			var newSequence:int = remapSequence(getLastSequenceManifest(), currentManifest, getLastSequence());
+			if(newSequence == -1)
+			{
+				if(_pendingBestEffortRequest && !isBestEffortActive())
+				{
+					trace("Firing pending best effort request (2): " + _pendingBestEffortRequest);
+					var pber:HTTPStreamRequest = _pendingBestEffortRequest;
+					_pendingBestEffortRequest = null;
+					return pber;
 				}
 				else
 				{
-					trace("Best effort request pending, so stalling.");
-					return new HTTPStreamRequest(HTTPStreamRequestKind.LIVE_STALL, null, RETRY_INTERVAL);
+					return new HTTPStreamRequest(HTTPStreamRequestKind.LIVE_STALL);
 				}
 			}

@@ -813,100 +885,35 @@
 				return new HTTPStreamRequest(HTTPStreamRequestKind.LIVE_STALL);
 			}

-			if(lastSequence == int.MAX_VALUE)
-			{
-				trace("Catching seek-to-end!");
-				lastSequence = segments[Math.max(0, segments.length - 3)].id;
-				bumpedTime = true;
-				bumpedSeek = segments[Math.max(0, segments.length - 3)].startTime;
-			}
-			else
-			{
-				// Advance sequence number.
-				lastSequence++;
-			}
-
-			// Remap time immediately if needed and we're not on a DVR.
-			if(origQuality != lastQuality && quality == origQuality)
-			{
-				updateSegmentTimes(segments);
-				updateSegmentTimes(oldSegments);
-
-				const fudgeTime:Number = 1.0;
-				var lastSeg:HLSManifestSegment = getSegmentBySequence(oldSegments, lastSequence);
-				var newSeg:HLSManifestSegment = lastSeg ? getSegmentContainingTime(segments, lastSeg.startTime + lastSeg.duration) : null;
-				if(newSeg == null)
-				{
-					trace("Remapping from " + lastSequence);
-
-					if(lastSeg)
-					{
-						// Guess by time....
-						trace("Found last seg with startTime = " + lastSeg.startTime + " duration=" + lastSeg.duration);
-
-						// If the segment is beyond last ID, then jump to end...
-						if(lastSeg.startTime + lastSeg.duration >= segments[segments.length-1].startTime)
-						{
-							trace("ERROR: Couldn't remap sequence to new quality level, restarting at last time " + segments[segments.length-1].startTime);
-							lastSequence = segments[segments.length-1].id;
-						}
-						else
-						{
-							trace("ERROR: Couldn't remap sequence to new quality level, restarting at first time " + segments[0].startTime);
-							lastSequence = segments[0].id;
-						}
-					}
-					else
-					{
-						// Guess by sequence number...
-						trace("No last seg found");
-
-						// If the segment is beyond last ID, then jump to end...
-						if(lastSequence >= segments[segments.length-1].id)
-						{
-							trace("ERROR: Couldn't remap sequence to new quality level, restarting at last sequence " + segments[segments.length-1].id);
-							lastSequence = segments[segments.length-1].id;
-						}
-						else
-						{
-							trace("ERROR: Couldn't remap sequence to new quality level, restarting at first sequence " + segments[0].id);
-							lastSequence = segments[0].id;
-						}
-					}
-				}
-				else
-				{
-					trace("Remapping from " + lastSequence + " to " + lastSeg.startTime + "-" + (lastSeg.startTime + lastSeg.duration));
-					trace("===== Remapping to " + lastSequence + " newId=" + (newSeg.id) + " newTime=" + newSeg.startTime + "-" + (newSeg.startTime + newSeg.duration) );
-					lastSequence = newSeg.id;
-				}
-
-				// Dec for next time around.
-				trace("   o Ended at " + lastSequence);
-			}
-
-			if( segments.length > 0 && lastSequence < segments[0].id)
-			{
-				trace("Resetting too low sequence " + lastSequence + " to " + segments[0].id);
-				lastSequence = segments[0].id;
-				//bumpedTime = true;
-			}
-
-			if (segments.length > 2 && lastSequence > (segments[segments.length-1].id + 3))
-			{
-				trace("Got in a bad state of " + lastSequence + " , resetting to near end of stream " + segments[segments.length-2].id);
-				lastSequence = segments[segments.length-2].id;
-			}
-
-			var curSegment:HLSManifestSegment = getSegmentBySequence(segments, lastSequence);
+			// Advance sequence number.
+			newSequence++;
+
+			var segments:Vector.<HLSManifestSegment> = currentManifest.segments;
+
+			if( segments.length > 0 && newSequence < segments[0].id)
+			{
+				trace("Resetting too low sequence " + newSequence + " to " + segments[0].id);
+				newSequence = segments[0].id;
+			}
+
+			if (segments.length > 0 && newSequence > (segments[Math.max(0, segments.length-1)].id + 3))
+			{
+				trace("Got in a bad state of " + newSequence + " , resetting to near end of stream " + segments[segments.length-2].id);
+				newSequence = segments[segments.length-2].id;
+			}
+
+			var curSegment:HLSManifestSegment = getSegmentBySequence(segments, newSequence);
 			if ( curSegment != null )
 			{
-				trace("Getting Next Segment[" + lastSequence + "] StartTime: " + curSegment.startTime + " Continuity: " + curSegment.continuityEra + " URI: " + curSegment.uri);
+				trace("Getting Next Segment[" + newSequence + "] StartTime: " + curSegment.startTime + " Continuity: " + curSegment.continuityEra + " URI: " + curSegment.uri);

+				// Note new value.
+				updateLastSequence(currentManifest, newSequence);
+
 				//bumpedSeek = curSegment.startTime;

-				fileHandler.segmentId = lastSequence;
-				fileHandler.key = getKeyForIndex( lastSequence );
+				fileHandler.segmentId = newSequence;
+				fileHandler.key = getKeyForIndex( newSequence );
 				fileHandler.segmentUri = curSegment.uri;

 				return createHTTPStreamRequest( curSegment );
@@ -914,8 +921,7 @@

 			if ( reloadingManifest || !manifest.streamEnds )
 			{
-				trace("Stalling -- requested segment " + lastSequence + " past the end " + segments[segments.length-1].id + " and we're in a live stream");
-				lastSequence--;
+				trace("Stalling -- requested segment " + newSequence + " past the end " + segments[segments.length-1].id + " and we're in a live stream");

 				return new HTTPStreamRequest(HTTPStreamRequestKind.LIVE_STALL, null, segments[segments.length-1].duration / 2);
 			}
@@ -1100,7 +1106,7 @@
 		public function getCurrentContinuityToken():String
 		{
 			// Check to ensure we do not get a range error
-			var segments:Vector.<HLSManifestSegment> = getSegmentsForQuality(lastQuality);
+			var segments:Vector.<HLSManifestSegment> = getLastSequenceSegments();

 			if (segments.length == 0)
 			{
@@ -1109,18 +1115,18 @@
 				return returnString;
 			}

-			if (lastSequence > segments[segments.length - 1].id || lastSequence < 0)
-			{
-				trace("==WARNING: lastSegmentIndex is greater than number of segments in last quality==");
-				trace("lastSegmentIndex: " + lastSequence + " | max allowed index: " + segments[segments.length - 1].id);
+			if (getLastSequence() > segments[segments.length - 1].id || getLastSequence() < 0)
+			{
+				/*trace("==WARNING: lastSegmentIndex is greater than number of segments in last quality==");
+				trace("lastSegmentIndex: " + getLastSequence() + " | max allowed index: " + segments[segments.length - 1].id);
 				trace("Setting lastSegmentIndex to " + segments[segments.length - 1].id);
-				lastSequence = segments[segments.length - 1].id;
+				getLastSequence() = segments[segments.length - 1].id;

 				// Back off by one as it will get incremented later.
-				lastSequence--;
-			}
-
-			var lastSeg:HLSManifestSegment = getSegmentBySequence(segments, lastSequence);
+				//lastSequence--; */
+			}
+
+			var lastSeg:HLSManifestSegment = getSegmentBySequence(segments, getLastSequence());
 			return "/" + sequenceSkips + "/" + lastQuality + "/" +  (lastSeg ? lastSeg.continuityEra : 0);
 		}

@@ -1135,8 +1141,9 @@

 		public function getCurrentSegmentOffset():Number
 		{
-			var segments:Vector.<HLSManifestSegment> = getSegmentsForQuality( lastQuality );
-			var segment:HLSManifestSegment = getSegmentBySequence( segments, lastSequence );
+			var segments:Vector.<HLSManifestSegment> = getLastSequenceSegments();
+			updateSegmentTimes(segments);
+			var segment:HLSManifestSegment = getSegmentBySequence( segments, getLastSequence() );

 			return segment ? segment.startTime : 0.0;
 		}
@@ -1167,14 +1174,14 @@
 			_bestEffortDownloaderMonitor = new EventDispatcher();
 			_bestEffortDownloaderMonitor.addEventListener(HTTPStreamingEvent.DOWNLOAD_COMPLETE, onBestEffortDownloadComplete);
 			_bestEffortDownloaderMonitor.addEventListener(HTTPStreamingEvent.DOWNLOAD_ERROR, onBestEffortDownloadError);
-
+
 			if(!segments)
 			{
 				// Get the URL.
 				var newMan:HLSManifestParser = getManifestForQuality(quality);
 				if(newMan == null)
 				{
-					trace("No manifest found to best effort request quality level " + quality);
+					trace("initiateBestEffortRequest - No manifest found to best effort request quality level " + quality);
 					return null;
 				}

@@ -1183,15 +1190,15 @@

 			if(!segments)
 			{
-				trace("NO SEGMENTS FOUND, ABORTING initiateBestEffortRequest");
+				trace("initiateBestEffortRequest - NO SEGMENTS FOUND, ABORTING initiateBestEffortRequest");
 				return null;
 			}

 			if(nextFragmentId > segments.length - 1 || nextFragmentId == uint.MAX_VALUE)
 			{
-				trace("Capping to end of segment list " + (segments.length - 1));
+				trace("initiateBestEffortRequest - Capping to end of segment list " + (segments.length - 1));
 				nextFragmentId = segments.length - 1;
-			}
+			}

 			_bestEffortFileHandler.segmentId = segments[nextFragmentId].id;
 			_bestEffortFileHandler.key = getKeyForIndex( nextFragmentId );
@@ -1203,7 +1210,9 @@
 				-1, // retryAfter
 				_bestEffortDownloaderMonitor); // bestEffortDownloaderMonitor

-			trace("Requesting best effort download: " + streamRequest.toString());
+			_pendingBestEffortStartTime = getTimer();
+
+			trace("initiateBestEffortRequest - Requesting: " + streamRequest.toString());

 			return streamRequest;
 		}
@@ -1217,6 +1226,7 @@
 		{
 			if(_bestEffortDownloaderMonitor != null)
 			{
+				trace("stopListeningToBestEffortDownload - Disconnecting existing best effort monitor.");
 				_bestEffortDownloaderMonitor.removeEventListener(HTTPStreamingEvent.DOWNLOAD_COMPLETE, onBestEffortDownloadComplete);
 				_bestEffortDownloaderMonitor.removeEventListener(HTTPStreamingEvent.DOWNLOAD_ERROR, onBestEffortDownloadError);
 				_bestEffortDownloaderMonitor = null;


More similar to Adobe reference implementation

Adobe reference implementation: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Camera.html#getCamera()

--- flash/Webcam.as
+++ flash/Webcam.as
@@ -1,161 +1,186 @@
-package {
-	/* Webcam.js v1.0 */
-	/* Webcam library for capturing JPEG/PNG images and sending them to JavaScript */
-	/* Author: Joseph Huckaby <jhuckaby@effectgames.com> */
-	/* Based on JPEGCam: http://code.google.com/p/jpegcam/ */
-	/* Copyright (c) 2012 Joseph Huckaby */
-	/* Licensed under the MIT License */
-
-	import flash.display.LoaderInfo;
-	import flash.display.Sprite;
-	import flash.display.StageAlign;
-	import flash.display.StageScaleMode;
-	import flash.display.Bitmap;
-	import flash.display.BitmapData;
-	import flash.events.*;
-	import flash.utils.*;
-	import flash.media.Camera;
-	import flash.media.Video;
-	import flash.external.ExternalInterface;
-	import flash.net.*;
-	import flash.system.Security;
-	import flash.system.SecurityPanel;
-	import flash.media.Sound;
-	import flash.media.SoundChannel;
-	import flash.geom.Matrix;
-	import mx.utils.Base64Encoder;
-	import com.adobe.images.BitString;
-	import com.adobe.images.PNGEncoder;
-	import com.adobe.images.JPGEncoder;
-
-	public class Webcam extends Sprite {
-		private var video:Video;
-		private var video_width:int;
-		private var video_height:int;
-		private var dest_width:int;
-		private var dest_height:int;
-		private var camera:Camera;
-		private var bmpdata:BitmapData;
-		private var jpeg_quality:int;
-		private var image_format:String;
-
-		public function Webcam() {
-			// class constructor
-			flash.system.Security.allowDomain("*");
-			var flashvars:Object = LoaderInfo(this.root.loaderInfo).parameters;
-
-			video_width = Math.floor( flashvars.width );
-			video_height = Math.floor( flashvars.height );
-			dest_width = Math.floor( flashvars.dest_width );
-			dest_height = Math.floor( flashvars.dest_height );
-			jpeg_quality = Math.floor( flashvars.jpeg_quality );
-			image_format = flashvars.image_format;
-
-			stage.scaleMode = StageScaleMode.NO_SCALE;
-			// stage.scaleMode = StageScaleMode.EXACT_FIT;
-			stage.align = StageAlign.TOP_LEFT;
-			stage.stageWidth = Math.max(video_width, dest_width);
-			stage.stageHeight = Math.max(video_height, dest_height);
-
-			if (flashvars.new_user) {
-				Security.showSettings( SecurityPanel.PRIVACY );
-			}
-
-			// Hack to auto-select iSight camera on Mac (JPEGCam Issue #5, submitted by manuel.gonzalez.noriega)
-			// From: http://www.squidder.com/2009/03/09/trick-auto-select-mac-isight-in-flash/
-			var cameraIdx:int = -1;
-			for (var idx = 0, len = Camera.names.length; idx < len; idx++) {
-				if (Camera.names[idx] == "USB Video Class Video") {
-					cameraIdx = idx;
-					idx = len;
-				}
-			}
-			if (cameraIdx > -1) camera = Camera.getCamera( String(cameraIdx) );
-			else camera = Camera.getCamera();
-
-			if (camera != null) {
-				camera.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
-				video = new Video( Math.max(video_width, dest_width), Math.max(video_height, dest_height) );
-				video.attachCamera(camera);
-				addChild(video);
-
-				if ((video_width < dest_width) && (video_height < dest_height)) {
-					video.scaleX = video_width / dest_width;
-					video.scaleY = video_height / dest_height;
-				}
-
-				camera.setQuality(0, 100);
-				camera.setKeyFrameInterval(10);
-				camera.setMode( Math.max(video_width, dest_width), Math.max(video_height, dest_height), 30);
-
-				// only detect motion once, to determine when camera is "live"
-				camera.setMotionLevel( 1 );
-
-				ExternalInterface.addCallback('_snap', snap);
-				ExternalInterface.addCallback('_configure', configure);
-
-				ExternalInterface.call('Webcam.flashNotify', 'flashLoadComplete', true);
-			}
-			else {
-				trace("You need a camera.");
-				ExternalInterface.call('Webcam.flashNotify', "error", "No camera was detected.");
-			}
-		}
-
-		public function configure(panel:String = SecurityPanel.CAMERA) {
-			// show configure dialog inside flash movie
-			Security.showSettings(panel);
-		}
-
-		private function activityHandler(event:ActivityEvent):void {
-			trace("activityHandler: " + event);
-			ExternalInterface.call('Webcam.flashNotify', 'cameraLive', true);
-
-			// now disable motion detection (may help reduce CPU usage)
-			camera.setMotionLevel( 100 );
-		}
-
-		public function snap() {
-			// take snapshot from camera, and upload if URL was provided
-			trace("in snap(), drawing to bitmap");
-
-			// take snapshot, convert to jpeg, submit to server
-			bmpdata = new BitmapData( Math.max(video_width, dest_width), Math.max(video_height, dest_height) );
-			bmpdata.draw( video );
-
-			if ((video_width > dest_width) && (video_height > dest_height)) {
-				// resize image downward before submitting
-				var tmpdata = new BitmapData(dest_width, dest_height);
-
-				var matrix = new Matrix();
-				matrix.scale( dest_width / video_width, dest_height / video_height );
-
-				tmpdata.draw( bmpdata, matrix, null, null, null, true ); // smoothing
-				bmpdata = tmpdata;
-			} // need resize
-
-			trace("converting to " + image_format);
-
-			var bytes:ByteArray;
-
-			if (image_format == 'png') {
-				bytes = PNGEncoder.encode( bmpdata );
-			}
-			else {
-				var encoder:JPGEncoder;
-				encoder = new JPGEncoder( jpeg_quality );
-				bytes = encoder.encode( bmpdata );
-			}
-
-			trace("raw image length: " + bytes.length);
-
-			var be = new Base64Encoder();
-			be.encodeBytes( bytes );
-
-			var bstr = be.toString();
-			trace("b64 string length: " + bstr.length);
-
-			return bstr;
-		}
-	}
-}+package {
+	/* Webcam.js v1.0 */
+	/* Webcam library for capturing JPEG/PNG images and sending them to JavaScript */
+	/* Author: Joseph Huckaby <jhuckaby@effectgames.com> */
+	/* Based on JPEGCam: http://code.google.com/p/jpegcam/ */
+	/* Copyright (c) 2012 Joseph Huckaby */
+	/* Licensed under the MIT License */
+
+	import flash.display.LoaderInfo;
+	import flash.display.Sprite;
+	import flash.display.StageAlign;
+	import flash.display.StageScaleMode;
+	import flash.display.Bitmap;
+	import flash.display.BitmapData;
+	import flash.events.*;
+	import flash.utils.*;
+	import flash.media.Camera;
+	import flash.media.Video;
+	import flash.external.ExternalInterface;
+	import flash.net.*;
+	import flash.system.Security;
+	import flash.system.SecurityPanel;
+	import flash.media.Sound;
+	import flash.media.SoundChannel;
+	import flash.geom.Matrix;
+	import mx.utils.Base64Encoder;
+	import com.adobe.images.BitString;
+	import com.adobe.images.PNGEncoder;
+	import com.adobe.images.JPGEncoder;
+
+	public class Webcam extends Sprite {
+		private var video:Video;
+		private var video_width:int;
+		private var video_height:int;
+		private var dest_width:int;
+		private var dest_height:int;
+		private var camera:Camera;
+		private var bmpdata:BitmapData;
+		private var jpeg_quality:int;
+		private var image_format:String;
+		private var fps:int;
+
+		public function Webcam() {
+			// class constructor
+			flash.system.Security.allowDomain("*");
+			var flashvars:Object = LoaderInfo(this.root.loaderInfo).parameters;
+
+			video_width = Math.floor( flashvars.width );
+			video_height = Math.floor( flashvars.height );
+			dest_width = Math.floor( flashvars.dest_width );
+			dest_height = Math.floor( flashvars.dest_height );
+			jpeg_quality = Math.floor( flashvars.jpeg_quality );
+			image_format = flashvars.image_format;
+			fps = Math.floor( flashvars.fps );
+
+			stage.scaleMode = StageScaleMode.NO_SCALE;
+			// stage.scaleMode = StageScaleMode.EXACT_FIT; // Note: This breaks HD capture
+
+			stage.align = StageAlign.TOP_LEFT;
+			stage.stageWidth = Math.max(video_width, dest_width);
+			stage.stageHeight = Math.max(video_height, dest_height);
+
+			if (Camera.isSupported) {
+				// Hack to auto-select iSight camera on Mac (JPEGCam Issue #5, submitted by manuel.gonzalez.noriega)
+				// From: http://www.squidder.com/2009/03/09/trick-auto-select-mac-isight-in-flash/
+				var cameraIdx:int = -1;
+				for (var idx = 0, len = Camera.names.length; idx < len; idx++) {
+					if (Camera.names[idx] == "USB Video Class Video") {
+						cameraIdx = idx;
+						idx = len;
+					}
+				}
+				if (cameraIdx > -1) camera = Camera.getCamera( String(cameraIdx) );
+				else camera = Camera.getCamera();
+				if (!camera) {
+					trace("You need a camera.");
+					ExternalInterface.call('Webcam.flashNotify', "error", "No camera was detected.");
+				} else if (cam.muted) {
+            				Security.showSettings(SecurityPanel.PRIVACY);
+            				cam.addEventListener(StatusEvent.STATUS, statusHandler);
+            			} else {
+                    			connectCamera();
+                    		}
+			} else {
+				trace("You need a camera.");
+				ExternalInterface.call('Webcam.flashNotify', "error", "No camera was detected.");
+			}
+		}
+
+		private function connectCamera():void {
+        		camera.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
+			video = new Video( Math.max(video_width, dest_width), Math.max(video_height, dest_height) );
+			video.attachCamera(camera);
+			addChild(video);
+
+			if ((video_width < dest_width) && (video_height < dest_height)) {
+				video.scaleX = video_width / dest_width;
+				video.scaleY = video_height / dest_height;
+			}
+
+			camera.setQuality(0, 100);
+			camera.setKeyFrameInterval(10);
+			camera.setMode( Math.max(video_width, dest_width), Math.max(video_height, dest_height), fps );
+
+			// only detect motion once, to determine when camera is "live"
+			camera.setMotionLevel( 1 );
+
+			ExternalInterface.addCallback('_snap', snap);
+			ExternalInterface.addCallback('_configure', configure);
+
+			ExternalInterface.call('Webcam.flashNotify', 'flashLoadComplete', true);
+        	}
+
+		public function configure(panel:String = SecurityPanel.CAMERA) {
+			// show configure dialog inside flash movie
+			Security.showSettings(panel);
+		}
+
+		private function activityHandler(event:ActivityEvent):void {
+			trace("activityHandler: " + event);
+			ExternalInterface.call('Webcam.flashNotify', 'cameraLive', true);
+
+			// now disable motion detection (may help reduce CPU usage)
+			camera.setMotionLevel( 100 );
+		}
+
+		private function handleCameraStatus(e:StatusEvent):void {
+			switch (e.code) {
+				case 'Camera.Muted': {
+					trace("Camera not allowed");
+					ExternalInterface.call('Webcam.flashNotify', "error", "Access to camera denied");
+					break;
+				}
+				case 'Camera.Unmuted': {
+					trace("Camera allowed");
+					connectCamera();
+					cam.removeEventListener(StatusEvent.STATUS, statusHandler);
+					break;
+				}
+			}
+		}
+
+		public function snap() {
+			// take snapshot from camera, and upload if URL was provided
+			trace("in snap(), drawing to bitmap");
+
+			// take snapshot, convert to jpeg, submit to server
+			bmpdata = new BitmapData( Math.max(video_width, dest_width), Math.max(video_height, dest_height) );
+			bmpdata.draw( video );
+
+			if ((video_width > dest_width) && (video_height > dest_height)) {
+				// resize image downward before submitting
+				var tmpdata = new BitmapData(dest_width, dest_height);
+
+				var matrix = new Matrix();
+				matrix.scale( dest_width / video_width, dest_height / video_height );
+
+				tmpdata.draw( bmpdata, matrix, null, null, null, true ); // smoothing
+				bmpdata = tmpdata;
+			} // need resize
+
+			trace("converting to " + image_format);
+
+			var bytes:ByteArray;
+
+			if (image_format == 'png') {
+				bytes = PNGEncoder.encode( bmpdata );
+			}
+			else {
+				var encoder:JPGEncoder;
+				encoder = new JPGEncoder( jpeg_quality );
+				bytes = encoder.encode( bmpdata );
+			}
+
+			trace("raw image length: " + bytes.length);
+
+			var be = new Base64Encoder();
+			be.encodeBytes( bytes );
+
+			var bstr = be.toString();
+			trace("b64 string length: " + bstr.length);
+
+			return bstr;
+		}
+	}
+}


Tweaked clock timing

Tweaked clock timing

--- src/Modules/Clock.as
+++ src/Modules/Clock.as
@@ -21,7 +21,7 @@
 		}

 		override public function drive(port:Port):Value {
-			if ((U.state.time.moment + 1) % period == 0)
+			if ((U.state.time.moment - 1) % period == 0)
 				return EDGE;
 			return NO_EDGE;
 		}


fix CloneOptions.cloneAllOptions to exclude the TransformController from the list of controllers to clone

--- src/aerys/minko/type/clone/CloneOptions.as
+++ src/aerys/minko/type/clone/CloneOptions.as
@@ -54,7 +54,11 @@
 		{
 			var cloneOptions : CloneOptions = new CloneOptions();

-			cloneOptions._ignoredControllerTypes.push(VisibilityController, CameraController);
+			cloneOptions._ignoredControllerTypes.push(
+				VisibilityController,
+				CameraController,
+				TransformController
+			);
 			cloneOptions._defaultControllerAction = ControllerCloneAction.CLONE;

 			return cloneOptions;


Let's use a different name for our local variable so that we don't end up
adding nothing to our nothingness.

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

--- src/as/com/threerings/parlor/data/Table.as
+++ src/as/com/threerings/parlor/data/Table.as
@@ -88,15 +88,13 @@
      */
     public function getPlayers () :Array
     {
-        // create and populate the players array
-        var players :Array = new Array();
+        var parray :Array = new Array();
         for (var ii :int = 0; ii < players.length; ii++) {
             if (players[ii] != null) {
-                players.push(players[ii]);
-            }
-        }
-
-        return players;
+                parray.push(players[ii]);
+            }
+        }
+        return parray;
     }

     /**


Исправление ошибки

Исправление ошибки

--- src/main/org/shypl/common/lang/requireNotNull.as
+++ src/main/org/shypl/common/lang/requireNotNull.as
@@ -1,6 +1,6 @@
 package org.shypl.common.lang {
 	public function requireNotNull(obj:Object, message:String = null):void {
-		if (obj == null) {
+		if (obj === null) {
 			throw new NullPointerException(message);
 		}
 	}


OFC-361 After saving a record and returning to list, "EDIT" button does not work

--- collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/presenter/ListPresenter.as
+++ collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/presenter/ListPresenter.as
@@ -5,9 +5,9 @@
 	 * */
 	import flash.display.DisplayObject;
 	import flash.events.Event;
-	import flash.events.FocusEvent;
 	import flash.events.MouseEvent;

+	import mx.collections.ArrayCollection;
 	import mx.collections.IList;
 	import mx.collections.ListCollectionView;
 	import mx.core.FlexGlobals;
@@ -24,15 +24,18 @@
 	import org.openforis.collect.i18n.Message;
 	import org.openforis.collect.metamodel.proxy.EntityDefinitionProxy;
 	import org.openforis.collect.metamodel.proxy.ModelVersionProxy;
+	import org.openforis.collect.model.RecordSummarySortField;
+	import org.openforis.collect.model.RecordSummarySortField$Sortable;
 	import org.openforis.collect.model.proxy.RecordProxy;
 	import org.openforis.collect.ui.UIBuilder;
 	import org.openforis.collect.ui.component.SelectVersionPopUp;
 	import org.openforis.collect.ui.component.datagrid.PaginationBar;
+	import org.openforis.collect.ui.component.datagrid.RecordSummaryDataGrid;
 	import org.openforis.collect.ui.view.ListView;
 	import org.openforis.collect.util.AlertUtil;
 	import org.openforis.collect.util.CollectionUtil;
-	import org.openforis.collect.util.StringUtil;

+	import spark.collections.Sort;
 	import spark.collections.SortField;
 	import spark.events.GridSortEvent;

@@ -59,9 +62,9 @@
 		 */
 		private var currentPage:int;
 		/**
-		 * The current orderBy column dataField
-		 */
-		private var currentOrderByFieldName:String;
+		 * The current sortField
+		 */
+		private var currentSortFields:IList;
 		/**
 		 * The current filter applied on root entity key fields.
 		 * */
@@ -156,7 +159,6 @@
 		protected function editButtonClickHandler(event:MouseEvent):void {
 			var selectedRecord:RecordProxy = _view.dataGrid.selectedItem as RecordProxy;
 			if(selectedRecord != null) {
-				selectedRecord.showErrors(); //to make validation errors visible
 				var uiEvent:UIEvent = new UIEvent(UIEvent.RECORD_SELECTED);
 				uiEvent.obj = selectedRecord;
 				eventDispatcher.dispatchEvent(uiEvent);
@@ -224,7 +226,7 @@
 			var offset:int = (currentPage - 1) * MAX_RECORDS_PER_PAGE;

 			_dataClient.getRecordSummaries(new AsyncResponder(getRecordsSummaryResultHandler, faultHandler), Application.activeRootEntity.name,
-				offset, MAX_RECORDS_PER_PAGE, currentOrderByFieldName, currentFilter);
+				offset, MAX_RECORDS_PER_PAGE, currentSortFields, currentFilter);
 		}

 		protected function getRecordsSummaryResultHandler(event:ResultEvent, token:Object = null):void {
@@ -234,7 +236,7 @@
 			totalPages = Math.ceil(totalRecords / MAX_RECORDS_PER_PAGE);

 			_view.dataGrid.dataProvider = records;
-
+			_view.dataGrid.setSortedColumns(currentSortFields);
 			_view.currentState = ListView.DEFAULT_STATE;

 			updatePaginationBar();
@@ -302,10 +304,12 @@
 		protected function dataGridSortChangingHandler(event:GridSortEvent):void {
 			//avoid client sorting, perform the sorting by server side
 			event.preventDefault();
-			var newSortFields:Array = event.newSortFields;
-			var sortField:SortField = newSortFields[0];
-			currentOrderByFieldName = sortField.name;
-			loadRecordSummariesCurrentPage();
-		}
+			var oldSortFields:IList = currentSortFields;
+			currentSortFields = RecordSummaryDataGrid.createRecordSummarySortFields(event.newSortFields, oldSortFields);;
+
+			loadRecordSummariesCurrentPage();
+		}
+
+
 	}
 }


Fixed bug where opening requirements map twice in same session caused a crash

--- flexEditor/src/org/arisgames/editor/view/RequirementsEditorView.as
+++ flexEditor/src/org/arisgames/editor/view/RequirementsEditorView.as
@@ -29,6 +29,7 @@
     // Associated Data
     private var requirementObjectId:Number; //The object id to impose requirements
 	private var requirementObjectType:String; //One of the REQUIREMENTTYPES defined in constants
+	private var edMapOpened:Boolean;

     // Data For GUI
     [Bindable] public var requirements:ArrayCollection;
@@ -47,6 +48,7 @@
     public function RequirementsEditorView()
     {
         super();
+		edMapOpened = false;
         requirements = new ArrayCollection();
         reqTypes = new ArrayCollection();
         this.addEventListener(FlexEvent.CREATION_COMPLETE, handleInit);
@@ -398,7 +400,11 @@
 			//requirementsEditorMap.setPlacemarkLocation(pm.latitude, pm.longitude);
         }

-        this.parent.addChild(requirementsEditorMap);
+		if(!edMapOpened){
+        	this.parent.addChild(requirementsEditorMap);
+			edMapOpened = true;
+		}
+
         // Need to validate the display so that entire component is rendered
         requirementsEditorMap.validateNow();


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -78,6 +78,11 @@
  *  due to a user interaction.
  *
  *  @eventType mx.events.FlexEvent.SELECTION_CHANGE
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 [Event(name="selectionChange", type="mx.events.FlexEvent")]

@@ -87,6 +92,11 @@
  *  to prevent the operation from being processed.
  *
  *  @eventType mx.events.FlexEvent.CHANGING
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 [Event(name="changing", type="mx.events.TextOperationEvent")]

@@ -94,6 +104,11 @@
  *  Dispatched after a user editing operation is complete.
  *
  *  @eventType mx.events.FlexEvent.CHANGE
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 [Event(name="change", type="mx.events.TextOperationEvent")]

@@ -101,6 +116,11 @@
  *  Dispatched when the user pressed the Enter key.
  *
  *  @eventType mx.events.FlexEvent.ENTER
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 [Event(name="enter", type="mx.events.FlexEvent")]

@@ -138,6 +158,11 @@
  *  @see mx.graphics.TextGraphic
  *
  *  @includeExample examples/TextViewExample.mxml
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 public class TextView extends UIComponent implements IViewport
 {
@@ -188,6 +213,11 @@

     /**
      *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function TextView()
     {
@@ -331,6 +361,11 @@

     /**
      *  @copy mx.layout.LayoutBase#clipAndEnableScrolling
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get clipAndEnableScrolling():Boolean
     {
@@ -373,6 +408,11 @@

     /**
      *  Documentation is not currently available.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get content():Object
     {
@@ -417,6 +457,11 @@

     /**
      *  Documentation is not currently available.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get contentHeight():Number
     {
@@ -436,6 +481,11 @@

     /**
      *  Documentation is not currently available.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get contentWidth():Number
     {
@@ -458,6 +508,11 @@

     /**
      *  Documentation is not currently available.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get displayAsPassword():Boolean
     {
@@ -496,6 +551,11 @@
      *  Specifies whether the user is allowed to edit the text in this control.
      *
      *  @default true;
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get editable():Boolean
     {
@@ -560,6 +620,11 @@
      *  because a TextView often starts out with no text. Instead it uses this property, and the widthInChars property
      *  to determine its measuredWidth and measuredHeight. These are
      *  similar to the cols and rows of an HTML TextArea.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get heightInLines():Number
     {
@@ -599,6 +664,11 @@

     /**
      *  Documentation is not currently available.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get horizontalScrollPosition():Number
     {
@@ -625,6 +695,11 @@

     /**
      *  @copy mx.layout.LayoutBase#getHorizontalScrollPositionDelta
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function getHorizontalScrollPositionDelta(scrollUnit:uint):Number
     {
@@ -683,6 +758,11 @@
      *  @default null
      *
      * @see flash.system.IMEConversionMode
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
      public function get imeMode():String
     {
@@ -715,6 +795,11 @@
      *  a user can enter an unlimited amount of text.
      *
      *  @default 0
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get maxChars():int
     {
@@ -745,6 +830,11 @@
      *  but causes the TextView to dispatch an "enter" event.
      *
      *  @default true
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get multiline():Boolean
     {
@@ -772,6 +862,11 @@
      *  Documentation is not currently available.
      *
      *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get restrict():String
     {
@@ -805,6 +900,11 @@
      *  Making the text selectable lets you copy text from the control.
      *
      *  @default true;
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get selectable():Boolean
     {
@@ -842,6 +942,11 @@
      *  or the end of the selection.
      *
      *  @default -1
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get selectionActivePosition():int
     {
@@ -865,6 +970,11 @@
      *  or the end of the selection.
      *
      *  @default -1
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get selectionAnchorPosition():int
     {
@@ -892,6 +1002,11 @@
      *  Documentation is not currently available.
      *
      *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get selectionVisibility():String
     {
@@ -928,6 +1043,11 @@

     /**
      *  The text String displayed by this TextView.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get text():String
     {
@@ -979,6 +1099,11 @@

     /**
      *  Documentation is not currently available.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get verticalScrollPosition():Number
     {
@@ -1005,6 +1130,11 @@

     /**
      *  @copy mx.layout.LayoutBase#getVerticalScrollPositionDelta
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function getVerticalScrollPositionDelta(scrollUnit:uint):Number
     {
@@ -1083,6 +1213,11 @@
      *  to let the user enter 5 digits.
      *
      *  @default
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get widthInChars():Number
     {
@@ -1195,6 +1330,11 @@
         g.beginFill(0xEEEEEE, 1.0);
         g.drawRect(0, 0, unscaledWidth, unscaledHeight);
         g.endFill();
+        *
+        *  @langversion 3.0
+        *  @playerversion Flash 10
+        *  @playerversion AIR 1.5
+        *  @productversion Flex 4
         */

         var flowComposer:IFlowComposer;
@@ -1275,6 +1415,11 @@

     /**
      *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     override public function stylesInitialized():void
     {
@@ -1287,6 +1432,11 @@

     /**
      *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     override public function styleChanged(styleProp:String):void
     {
@@ -1736,6 +1886,11 @@
     /**
      *  Sets the selection range and.  If the text is not editable or selectable
      *  this will also implicitly make the text selectable.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function setSelection(anchorPosition:int = 0,
                                  activePosition:int = int.MAX_VALUE):void
@@ -1756,6 +1911,11 @@
      *  if there was an insertion point, the new text is inserted there,
      *  otherwise the text is appended to the text that is there.
      *  An insertion point is then set after the new text.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function insertText(text:String):void
     {
@@ -1786,6 +1946,11 @@
      *  When TextView supports vertical scrolling,
      *  it will scroll to ensure that the last line
      *  of the inserted text is visible.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function appendText(text:String):void
     {
@@ -1813,6 +1978,11 @@
      *  this TextView's TextFlow.
      *  This markup String has the appropriate format
      *  for setting the content property.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function export():XML
     {
@@ -1834,6 +2004,11 @@
      *  if the selection is uniformly 12-point but has multiple colors.
      *  The supported attributes are those in the
      *  ICharacterAttributes and IParagraphAttributes interfaces.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function getSelectionFormat(names:Array = null):Object
     {
@@ -1931,6 +2106,11 @@
      *  will set the fontSize and color of the selection.
      *  The supported attributes are those in the
      *  ICharacterFormat and IParagraphFormat interfaces.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function setSelectionFormat(attributes:Object):void
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 17200
Author:   clucier@adobe.com
Date:     2010-08-05T13:51:41.882441Z

Log Message:
-----------
Fix to Animation to treat zero duration effects a bit differently in start().

QE notes: None
Doc notes: None
Bugs: SDK-26691
Reviewer: Jason
Tests run: Mustella Cyclone, manual cyclone, checkin.
Is noteworthy for integration: No

Modified Paths:
--------------
/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/effects/animation/Animation.as

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

--- frameworks/projects/spark/src/spark/effects/animation/Animation.as
+++ frameworks/projects/spark/src/spark/effects/animation/Animation.as
@@ -1169,6 +1169,7 @@
             }
             startTime = cycleStartTime = intervalTime - playheadTime;
         }
+
         doInterval();
         _doSeek = false;
     }
@@ -1366,22 +1367,15 @@

         calculateValue(0);

-        if (duration == 0)
-        {
-            id = -1; // use -1 to indicate that this animation was never added
-            end();
-        }
-        else
-        {
-            // TODO (rfrishbe): if the animation gets stopped() or ended() in
-            // the first update, then the animation never actually gets removed
-            sendUpdateEvent();
-            Animation.addAnimation(this);
-            startTime = cycleStartTime;
-            _isPlaying = true;
-            if (actualStartTime > 0)
-                seek(actualStartTime);
-        }
+        // TODO (rfrishbe): if the animation gets stopped() or ended() in
+        // the first update, then the animation never actually gets removed
+        sendUpdateEvent();
+        Animation.addAnimation(this);
+        startTime = cycleStartTime;
+        _isPlaying = true;
+        if (actualStartTime > 0)
+            seek(actualStartTime);
+
         started = true;
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 6441
Author:   chaase@adobe.com
Date:     2009-04-30T22:28:01.444147Z

Log Message:
-----------
Fixed various bugs in the transform effects, plus an unrelated namespace bug where TransformOffsets was still living only in the halo namespace.

QE Notes: Fixes projection bugs that were holdups to 3D effects testing
Doc Notes: None
Bugs: sdk-20169, sdk-20807, sdk-20846
Reviewer: Jason
Tests: checkintests, Musteall spark/effects/Move spark/effects/AnimateTransform spark/effects/Rotate spark/effects/AnimateTransform mx/states/Transition

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/Animation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/spark-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateTransformInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransform.as</path>

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

--- frameworks/projects/spark/src/spark/effects/animation/Animation.as
+++ frameworks/projects/spark/src/spark/effects/animation/Animation.as
@@ -1129,10 +1129,10 @@
         {
             Animation.removeAnimationAt(id);
             id = -1;
-        }
-        _doReverse = false
-        _invertValues = false;
-        _isPlaying = false;
+            _doReverse = false
+            _invertValues = false;
+            _isPlaying = false;
+        }
     }

     /**


Apply formatting.

Apply formatting.

--- src/modules/Print/PrintModel.as
+++ src/modules/Print/PrintModel.as
@@ -16,8 +16,8 @@
 package modules.Print
 {

+import com.esri.builder.model.Model;
 import com.esri.builder.supportClasses.URLUtil;
-import com.esri.builder.model.Model;

 import modules.IWidgetModel;

@@ -106,7 +106,7 @@
         {
             defaultLayoutTemplate = doc.layouttemplates.@defaultvalue[0];
         }
-        if(doc.useproxy[0] == "true")
+        if (doc.useproxy[0] == "true")
         {
             useProxy = true;
         }
@@ -183,7 +183,7 @@
             configXML.appendChild(<layouttemplates defaultvalue={defaultLayoutTemplate}/>)
         }

-        if(useProxy)
+        if (useProxy)
         {
             configXML.appendChild(<useproxy>{useProxy}</useproxy>);
         }


add preinitialize event as a way to defer initialization so things like fonts can get loaded first

--- frameworks/projects/Core/as/src/org/apache/flex/core/Application.as
+++ frameworks/projects/Core/as/src/org/apache/flex/core/Application.as
@@ -24,8 +24,6 @@
     import flash.display.StageQuality;
     import flash.display.StageScaleMode;
     import flash.events.Event;
-    import flash.events.IOErrorEvent;
-    import flash.events.MouseEvent;
     import flash.system.ApplicationDomain;
     import flash.utils.getQualifiedClassName;

@@ -51,6 +49,20 @@
      *  @productversion FlexJS 0.0
      */
     [Event(name="initialize", type="org.apache.flex.events.Event")]
+
+    /**
+     *  Dispatched at startup before the instances get created.
+     *  Beads can call preventDefault and defer initialization.
+     *  This event will be dispatched on every frame until no
+     *  listeners call preventDefault(), then the initialize()
+     *  method will be called.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="preinitialize", type="org.apache.flex.events.Event")]

     /**
      *  Dispatched at startup after the initial view has been
@@ -135,6 +147,34 @@

             dispatchEvent(new org.apache.flex.events.Event("beadsAdded"));

+            if (dispatchEvent(new org.apache.flex.events.Event("preinitialize", false, true)))
+                initialize();
+            else
+                addEventListener(flash.events.Event.ENTER_FRAME, enterFrameHandler);
+
+        }
+
+        private function enterFrameHandler(event:flash.events.Event):void
+        {
+            if (dispatchEvent(new org.apache.flex.events.Event("preinitialize", false, true)))
+            {
+                removeEventListener(flash.events.Event.ENTER_FRAME, enterFrameHandler);
+                initialize();
+            }
+        }
+
+        /**
+         *  This method gets called when all preinitialize handlers
+         *  no longer call preventDefault();
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        protected function initialize():void
+        {
+
             MXMLDataInterpreter.generateMXMLInstances(this, null, MXMLDescriptor);

             dispatchEvent(new org.apache.flex.events.Event("initialize"));


Transferred from the Adobe Open Source Subversion Repository

Revision: 12975
Author:   klin@adobe.com
Date:     2009-12-16T00:22:26.935084Z

Log Message:
-----------
Fix for http://bugs.adobe.com/jira/browse/SDK-24546. Add Exclude metadata for scriptTimeLimit property in WindowedApplication because AIR doesn't implement it.

QE notes: No
Doc notes: No
Bugs: SDK-24546
Reviewer: Ryan
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airspark/src/spark/components/WindowedApplication.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/WindowedApplication.as</path>

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

--- frameworks/projects/airframework/src/mx/core/WindowedApplication.as
+++ frameworks/projects/airframework/src/mx/core/WindowedApplication.as
@@ -498,6 +498,7 @@
 //--------------------------------------

 [Exclude(name="moveEffect", kind="effect")]
+[Exclude(name="scriptTimeLimit", kind="property")]

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


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

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

 package mx.core
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 6260
Author:   rfrishbe@adobe.com
Date:     2009-04-24T22:08:41.005574Z

Log Message:
-----------
Automation assumed that a component implemented both IUIComponent and IAutomationObject; however, we'd like to automate FlexNativeMenu and FNM doesn't implement IUIComponent.  The properties automation needed from IUIComponent, were enabled, parent, owner, and visible.  We now have properties on IAutomationObject called automationEnabled, automationParent, automationOwner, and automationVisible for this purpose.  Now automation only needs to rely on IAutomationObject.

QE Notes: -
Doc Notes: -
Bugs: SDK-20488
Reviewer: Evtim
tests: checkintests

Modified Paths:
--------------
<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/core/UITextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/automation/IAutomationObject.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework_textLayout/src/mx/core/UITLFTextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/WindowedApplication.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/airframework/src/mx/controls/FlexNativeMenu.as</path>

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

--- frameworks/projects/airframework/src/mx/core/WindowedApplication.as
+++ frameworks/projects/airframework/src/mx/core/WindowedApplication.as
@@ -1395,8 +1395,20 @@
      */
     public function set menu(value:FlexNativeMenu):void
     {
+        if (_menu)
+        {
+            _menu.automationOwner = null;
+            _menu.automationParent = null;
+        }
+
         _menu = value;
         menuChanged = true;
+
+        if (_menu)
+        {
+            menu.automationParent = this;
+            menu.automationOwner = this;
+        }
     }

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 9211
Author:   hmuller@adobe.com
Date:     2009-08-10T21:50:20.402032Z

Log Message:
-----------
Corrected two alignment=JUSTIFY problems exposed by this bug:

- VerticalLayout/updateDisplayListVirtual() methods unconditionally
used LinearLayoutVector.minorSize for the contentWidth.  If
horizontalAlign=JUSTIFY then the contentWidth is less than or equal to
the "targetWidth", i.e. the target's width less the left/right
padding.  HorizontalLayout is similar.

- DataGroup/getVirtualElementAt() now initializes the new renderer's
width and height with setLayoutBoundsSize(), before calling validateNow().
If  VerticalLayout.horizontalAlign=JUSTIFY, the (renderer's) width is
the DataGroup's width less padding and height is NaN.   HorizontalLayout
is similar.

The signature for GroupBase/getVirtualElementAt() has changed, two optional
parameters were added:

  public function getVirtualElementAt(index:int, eltWidth:Number=NaN, eltHeight:Number=NaN):IVisualElement

QE Notes: API change should not affect tests.  Mustella datagroup, viewport, and layout tests pass.
Doc Notes: ASDoc revisions in all classes
Bugs: sdk-22017
Reviewer: Evtim

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/supportClasses/Block.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/supportClasses/LinearLayoutVector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataGroup.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/supportClasses/Block.as
+++ frameworks/projects/spark/src/spark/layouts/supportClasses/Block.as
@@ -16,10 +16,12 @@

 /**
  *  @private
+ *  A LinearLayoutVector block of layout element heights or widths.
+ *
  *  Total "distance" for a Block is: sizesSum + (defaultCount * distanceVector.default).
  *
- *  This class is essentially a C-struct.   If it was possible to make it a static
- *  inner class of DistanceVector, then it would be.
+ *  This class is essentially a C-struct.   If it was possible to make it a private static
+ *  inner class of LinearyLayoutVector (as in Java), then it would be.
  *
  *  @langversion 3.0
  *  @playerversion Flash 10


Import added

Import added

--- Arguments/src/Controller/logic/NotAllSyllogism.as
+++ Arguments/src/Controller/logic/NotAllSyllogism.as
@@ -12,6 +12,7 @@
 	import components.ArgSelector;
 	import components.ArgumentPanel;
 	import components.MenuPanel;
+	import classes.Language;

 	import mx.controls.Alert;
 	import mx.core.FlexGlobals;


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package
 {


[crt-amd64-linux] Fix main,exit types

[crt-amd64-linux] Fix main,exit types

--- crt/amd64-linux/crt.as
+++ crt/amd64-linux/crt.as
@@ -3,6 +3,6 @@
 	.global	_start

 _start:
-	call	$main
+	call	main
 	movl    %eax, %edi
-	call	$exit
+	call	exit


Transferred from the Adobe Open Source Subversion Repository

Revision: 7487
Author:   cframpto@adobe.com
Date:     2009-06-02T15:10:21.029844Z

Log Message:
-----------
Scrolling work.  Fix scrolling delta code.  Override RichEditableTextContainerManager.keyDownHandler() so we can call event.preventDefault() which will tell our scroller, if there is one, that it doesn't need to respond to the key.  Ideally, TLF will do this, rather than our override.

QA Notes:
Doc Notes:
Bugs: SDK-18486
Reviewers: Gordon

Modified Paths:
--------------
<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/flex4/src/spark/primitives/supportClasses/RichEditableTextContainerManager.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/RichEditableTextContainerManager.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/RichEditableTextContainerManager.as
@@ -15,6 +15,7 @@
 import flash.display.BlendMode;
 import flash.display.Graphics;
 import flash.events.FocusEvent;
+import flash.events.KeyboardEvent;
 import flash.geom.Rectangle;

 import flashx.textLayout.container.TextContainerManager;
@@ -233,6 +234,19 @@

         super.focusInHandler(event);
     }
+
+    /**
+     *  @private
+     */
+    override public function keyDownHandler(event:KeyboardEvent):void
+    {
+        super.keyDownHandler(event);
+
+        // Assume when this has focus it handles all keys.  Setting this will
+        // tell our scroller, if there is one, that it shouldn't act on the
+        // key.
+        event.preventDefault();
+    }
 }

 }


setProperty() now makes a copy before setting the value.

--- WeaveCore/src/weave/core/LinkableDisplayObject.as
+++ WeaveCore/src/weave/core/LinkableDisplayObject.as
@@ -25,6 +25,7 @@
 	import flash.utils.getQualifiedClassName;

 	import mx.core.UIComponent;
+	import mx.utils.ObjectUtil;

 	import weave.api.core.IDisposableObject;
 	import weave.api.core.ILinkableDisplayObject;
@@ -93,7 +94,7 @@
 		 */
 		public function setProperty(name:String, value:Object):void
 		{
-			var state:Object = Object(properties.value);
+			var state:Object = Object(ObjectUtil.copy(properties.value));
 			state[name] = value;
 			properties.value = state;
 		}


moved depend() call back to appropriate location

--- WeaveData/src/weave/data/DataSources/CensusApi.as
+++ WeaveData/src/weave/data/DataSources/CensusApi.as
@@ -150,7 +150,7 @@
 			var filters:Array = [];
 			var requires:Array = null;

-			return new WeavePromise(this).depend(dataSource.dataSet, dataSource.geographicScope, dataSource.apiKey, dataSource.geographicFilters)
+			return new WeavePromise(this).depend(dataSource.dataSet)
 			.thenAgain(
 				function (context:Object):IThenable
 				{
@@ -170,12 +170,11 @@
 				{
 					weaveTrace("Calling getGeographies", dataset_name);
 					title = variableInfo[variable_name].label;
-					return getGeographies(dataset_name);
-				}
-			, reportError).thenAgain(
+					return getGeographies(dataset_name);
+				}
+			, reportError).depend(dataSource.geographicScope, dataSource.apiKey, dataSource.geographicFilters).thenAgain(
 				function (geographyInfo:Object):IThenable
 				{
-
 					geography_name = dataSource.geographicScope.value;
 					geography_filters = dataSource.geographicFilters.getSessionState();
 					api_key = dataSource.apiKey.value;


Transferred from the Adobe Open Source Subversion Repository

Revision: 13035
Author:   hneelu@adobe.com
Date:     2009-12-17T07:35:16.160630Z

Log Message:
-----------
Updating automation project to latest p4 changes.

Modified Paths:
--------------
228 paths were modified

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

--- frameworks/projects/automation/src/mx/automation/delegates/containers/ApplicationAutomationImpl.as
+++ frameworks/projects/automation/src/mx/automation/delegates/containers/ApplicationAutomationImpl.as
@@ -101,7 +101,7 @@
 		override public function get automationName():String
 		{
 			var am:IAutomationManager2 = Automation.automationManager2;
-			return am.getUniqueApplicationId();
+			return am.getUniqueApplicationID();
 		}
 		/**
 		 *  @private
@@ -231,7 +231,7 @@
 			var am:IAutomationManager2 = Automation.automationManager2;

 			return application.numChildren + application.numRepeaters +
-				getDockedApplicationControlBarCount() +am.getPopoupChildrenCount();
+				getDockedApplicationControlBarCount() +am.getPopUpChildrenCount();
 		}

 		override public function getAutomationChildren():Array
@@ -240,7 +240,7 @@

 			// we need to add popup children
 			var childList:Array = new Array();
-			var tempChildren1:Array  = am.getPopoupChildren();
+			var tempChildren1:Array  = am.getPopUpChildren();
 			var n:int = 0;
 			var i:int = 0;

@@ -287,9 +287,9 @@
 		{
 			var am:IAutomationManager2 = Automation.automationManager2;
 			// handle popup objects
-			var popUpCount:int = am.getPopoupChildrenCount();
+			var popUpCount:int = am.getPopUpChildrenCount();
 			if (index < popUpCount)
-				return am.getPopoupChildObject(index) ;
+				return am.getPopUpChildObject(index) ;
 			else
 				index = index - popUpCount;


Application.as now redirects to ApplicationController#load

--- vendor/ras3r/ras3r/Application.as
+++ vendor/ras3r/ras3r/Application.as
@@ -102,7 +102,7 @@
 			// load environment config
 			Environment.load(url);

-			var params:Hash = parameters.merge({ controller: 'products', action: 'show' });
+			var params:Hash = parameters.merge({ controller: 'application', action: 'load' });

 			// HACK! ROUTES NEEDED?
 			ReactionController.redirect_to(params);


fixed wrong depth value after DrawCall.configure() has been called with computeDepth = true but neither localToWorld/worldToScreen has changed

--- src/aerys/minko/render/DrawCall.as
+++ src/aerys/minko/render/DrawCall.as
@@ -156,6 +156,8 @@
 			if (_bindings != null)
 				unsetBindings(meshBindings, sceneBindings);

+			_invalidDepth = computeDepth;
+
 			setProgram(program);
 			updateGeometry(geometry);
 			setGeometry(geometry);


Transferred from the Adobe Open Source Subversion Repository

Revision: 16670
Author:   deeptika@adobe.com
Date:     2010-06-25T08:08:02.259649Z

Log Message:
-----------
Automation support for spark Form and Image.

QE notes: Yes. Need SDK-26784 to be fixed
Doc notes:
Bugs:
Reviewer:
Tests run:
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkFormAutomationImpl.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/manifest_automation_spark.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/AutomationSparkClasses.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkFormItemAutomationImpl.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkImageAutomationImpl.as</path>

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

--- frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkFormItemAutomationImpl.as
+++ frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkFormItemAutomationImpl.as
@@ -0,0 +1,259 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2010 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package spark.automation.delegates.components
+{
+	import flash.display.DisplayObject;
+
+	import mx.automation.Automation;
+	import mx.automation.IAutomationObject;
+	import mx.automation.IAutomationObjectHelper;
+
+	import spark.components.FormItem;
+
+
+	[Mixin]
+	/**
+	 *
+	 *  Defines the methods and properties required to perform instrumentation for the
+	 *  FormItem class.
+	 *
+	 *  @see spark.components.FormItem
+	 *
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10
+	 *  @playerversion AIR 2.5
+	 *  @productversion Flex 4.5
+	 */
+	public class SparkFormItemAutomationImpl extends SparkSkinnableContainerAutomationImpl
+	{
+
+		include "../../../core/Version.as";
+
+		//--------------------------------------------------------------------------
+		//
+		//  Class methods
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Registers the delegate class for a component class with automation manager.
+		 *
+		 *  @param root The SystemManger of the application.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10
+		 *  @playerversion AIR 2.5
+		 *  @productversion Flex 4.5
+		 */
+		public static function init(root:DisplayObject):void
+		{
+			Automation.registerDelegateClass(spark.components.FormItem, SparkFormItemAutomationImpl);
+		}
+
+		//--------------------------------------------------------------------------
+		//
+		//  Constructor
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Constructor.
+		 *  @param obj FormItem object to be automated.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10
+		 *  @playerversion AIR 2.5
+		 *  @productversion Flex 4.5
+		 */
+		public function SparkFormItemAutomationImpl(obj:spark.components.FormItem)
+		{
+			super(obj);
+		}
+
+		/**
+		 *  @private
+		 *  storage for the formItem component
+		 */
+		protected function get formItem():spark.components.FormItem
+		{
+			return uiComponent as spark.components.FormItem;
+		}
+
+
+		//----------------------------------
+		//  automationValue
+		//----------------------------------
+
+		/**
+		 *  @private
+		 */
+		override public function get automationValue():Array
+		{
+			var labelObj:IAutomationObject = formItem.labelDisplay as IAutomationObject;
+			var label:String = formItem.label;
+
+			var sequenceLabelObj:IAutomationObject = formItem.sequenceLabelDisplay as IAutomationObject;
+			var seqLabel:String = formItem.sequenceLabel;
+			// Add values  of sequence label and label in that order if they exist
+			var result:Array = [ seqLabel ? seqLabel : null ];
+			result.push(label ? label : null);
+
+			var childArray:Array = getAutomationChildren();
+			if (childArray)
+			{
+				var n:int = childArray.length;
+				for (var i:int = 0; i < n; i++)
+				{
+					var child:IAutomationObject = childArray[i] as IAutomationObject;
+					if (child == labelObj || child == sequenceLabelObj)
+						continue;
+					var x:Array = child.automationValue;
+					if (x && x.length != 0)
+						result.push(x);
+				}
+			}
+			return result;
+		}
+
+		//----------------------------------
+		//  numAutomationChildren
+		//----------------------------------
+
+		/**
+		 *  @private
+		 */
+		override public function get numAutomationChildren():int
+		{
+			return formItem.numChildren + (formItem.labelDisplay != null ? 1 : 0) + (formItem.sequenceLabelDisplay != null ? 1 : 0)
+				+ (formItem.errorTextDisplay != null ? 1 : 0) + (formItem.helpContentGroup != null ? 1 : 0);
+		}
+
+		/**
+		 *  @private
+		 */
+		override public function createAutomationIDPart(child:IAutomationObject):Object
+		{
+			var help:IAutomationObjectHelper = Automation.automationObjectHelper;
+			return help.helpCreateIDPart(uiAutomationObject, child, getItemAutomationName);
+		}
+
+		override public function createAutomationIDPartWithRequiredProperties(child:IAutomationObject, properties:Array):Object
+		{
+			var help:IAutomationObjectHelper = Automation.automationObjectHelper;
+			return help.helpCreateIDPartWithRequiredProperties(uiAutomationObject, child,properties, getItemAutomationName);
+		}
+
+		/**
+		 *  @private
+		 */
+		override public function getAutomationChildAt(index:int):IAutomationObject
+		{
+			var labelObj:IAutomationObject = formItem.labelDisplay as IAutomationObject;
+			var seqLabelObj:IAutomationObject = formItem.sequenceLabelDisplay as IAutomationObject;
+			var errorLabelObj:IAutomationObject = formItem.errorTextDisplay as IAutomationObject;
+			var helpObj:IAutomationObject = formItem.helpContentGroup as IAutomationObject;
+
+			if(index >= formItem.numChildren)
+			{
+				index = index - formItem.numChildren;
+
+				var nonContentChildren:Array = [];
+
+				if(labelObj)
+					nonContentChildren.push(labelObj);
+				if(seqLabelObj)
+					nonContentChildren.push(seqLabelObj);
+				if(errorLabelObj)
+					nonContentChildren.push(errorLabelObj);
+				if(helpObj)
+					nonContentChildren.push(helpObj);
+
+				return nonContentChildren[index];
+			}
+
+			return super.getAutomationChildAt(index);
+		}
+
+		/**
+		 * @private
+		 */
+		override public function getAutomationChildren():Array
+		{
+			var childList:Array = new Array();
+			var seqLabelObj:IAutomationObject = formItem.sequenceLabelDisplay as IAutomationObject;
+			var labelObj:IAutomationObject = formItem.labelDisplay as IAutomationObject;
+			var errorLabelObj:IAutomationObject = formItem.errorTextDisplay as IAutomationObject;
+			var helpObj:IAutomationObject = formItem.helpContentGroup as IAutomationObject;
+			// we need to add all label objects and the children of the form also
+
+			var tempArray1:Array = super.getAutomationChildren();
+			if(tempArray1)
+			{
+				var n:int = tempArray1.length;
+				for (var i:int = 0; i < n ; i++)
+				{
+					childList.push(tempArray1[i]);
+				}
+			}
+
+			if(labelObj)
+				childList.push(labelObj);
+			if(seqLabelObj)
+				childList.push(seqLabelObj);
+			if(errorLabelObj)
+				childList.push(errorLabelObj);
+			if(helpObj)
+				childList.push(helpObj);
+
+			return childList;
+		}
+
+		/**
+		 * @private
+		 */
+		private function getItemAutomationName(child:IAutomationObject):String
+		{
+			var seqLabelObj:IAutomationObject = formItem.sequenceLabelDisplay as IAutomationObject;
+			var seqLabel:String = formItem.sequenceLabel;
+
+			var labelObj:IAutomationObject = formItem.labelDisplay as IAutomationObject;
+			var label:String = formItem.label;
+
+			var result:String = null;
+			result = (seqLabel && seqLabel.length != 0) ? seqLabel + ":" : "";	//add sequence label if exists
+			result = (label && label.length != 0) ? result + label + ":" : result+""; // add label if exists
+			if (child.automationName && child.automationName.length != 0)
+			{
+				result = result + child.automationName;
+			}
+			else
+			{
+				var childArray:Array = getAutomationChildren();
+				if (childArray)
+				{
+					var n:int = childArray.length;
+					for (var i:uint = 0; !result && i < n; i++)
+					{
+						if (childArray[i] == child)
+						{
+							result = (i == 0 &&
+								n == ((labelObj && seqLabelObj) ? 3 : (labelObj ? 2 : (seqLabelObj ? 2 : 1))) 	// if both seqLabelObj and labelObj exist, 3
+								? result : result + ":" + i);													// 2 if one of them exist, 1 otherwise
+						}
+					}
+				}
+			}
+			return result;
+		}
+	}
+}