Style fixes and more strong typing in AS2Broadcaster

--- src/avm2/generated/avm1lib/AS2Broadcaster.as
+++ src/avm2/generated/avm1lib/AS2Broadcaster.as
@@ -17,7 +17,7 @@
  */
 package avm1lib {
   public class AS2Broadcaster {
-    public static function initialize(obj) {
+    public static function initialize(obj: Object): void {
       obj._listeners = [];
       obj.broadcastMessage = _broadcastMessage;
       obj.addListener = _addListener;
@@ -26,22 +26,23 @@
   }
 }

-function _broadcastMessage(eventName) {
-  var args = Array.prototype.slice.call(arguments, 1);
-  for (var i = 0; i < this._listeners.length; i++) {
-    var listener = this._listeners[i];
+function _broadcastMessage(eventName: String): void {
+  var args: Array = Array.prototype.slice.call(arguments, 1);
+  var listeners: Array = this._listeners;
+  for (var i: int = 0; i < listeners.length; i++) {
+    var listener: Object = listeners[i];
     if (!(eventName in listener)) {
       continue;
     }
     listener[eventName].apply(listener, args);
   }
 }
-function _addListener(listener) {
+function _addListener(listener: Object): void {
   if (this._broadcastEventsRegistrationNeeded) {
     this._broadcastEventsRegistrationNeeded = false;
-    for (var i = 0; i < this._broadcastEvents.length; i++) {
-      (function (subject, eventName) {
-        subject[eventName] = function () {
+    for (var i: int = 0; i < this._broadcastEvents.length; i++) {
+      (function (subject: Object, eventName: String): void {
+        subject[eventName] = function handler(): void {
           _broadcastMessage.apply(subject, [eventName].concat(arguments));
         };
       })(this, this._broadcastEvents[i]);
@@ -49,10 +50,11 @@
   }
   this._listeners.push(listener);
 }
-function _removeListener(listener) {
-  var i = this._listeners.indexOf(listener);
+function _removeListener(listener: Object): Boolean {
+  var i: int = this._listeners.indexOf(listener);
   if (i < 0) {
-    return;
+    return false;
   }
   this._listeners.splice(i, 1);
+  return true;
 }


comments

comments

--- dorkbots/dorkbots_ui/TruncateTextField.as
+++ dorkbots/dorkbots_ui/TruncateTextField.as
@@ -25,8 +25,8 @@
 				tempTextField.text = tempTextField.text.substr( 0, tempTextField.text.length - 1 );
 			}

-			// Remove any spaces at the end
-			while(tempTextField.text.charAt(tempTextField.text.length - 1) == " ")
+			// Remove any empty spaces and periods at the end
+			while(tempTextField.text.charAt(tempTextField.text.length - 1) == " " || tempTextField.text.charAt(tempTextField.text.length - 1) == ".")
 			{
 				characterRemoveCnt++;
 				tempTextField.text = tempTextField.text.slice(0, -1);
@@ -184,7 +184,7 @@

 			if(result.length == 0) return result;

-			// Remove any spaces and periods at the end
+			// Remove any empty spaces and periods at the end
 			while(result.charAt(result.length - 1) == " " || result.charAt(result.length - 1) == ".")
 			{
 				result = result.slice(0, -1);


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

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

 package spark.automation.delegates.components.supportClasses
 {


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

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


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

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

 package mx.formatters
 {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/rpc/src/mx/messaging/AbstractProducer.as
+++ frameworks/projects/rpc/src/mx/messaging/AbstractProducer.as
@@ -0,0 +1,660 @@
+/*************************************************************************
+ *
+ * ADOBE CONFIDENTIAL
+ * __________________
+ *
+ *  [2002] - [2007] Adobe Systems Incorporated
+ *  All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Adobe Systems Incorporated and its suppliers,
+ * if any.  The intellectual and technical concepts contained
+ * herein are proprietary to Adobe Systems Incorporated
+ * and its suppliers and may be covered by U.S. and Foreign Patents,
+ * patents in process, and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * from Adobe Systems Incorporated.
+ */
+package mx.messaging
+{
+
+import flash.errors.IllegalOperationError;
+import flash.events.TimerEvent;
+import flash.utils.Timer;
+
+import mx.core.mx_internal;
+import mx.events.PropertyChangeEvent;
+import mx.logging.Log;
+import mx.messaging.config.ConfigMap;
+import mx.messaging.config.ServerConfig;
+import mx.messaging.errors.InvalidDestinationError;
+import mx.messaging.errors.MessagingError;
+import mx.messaging.events.ChannelEvent;
+import mx.messaging.events.ChannelFaultEvent;
+import mx.messaging.events.MessageAckEvent;
+import mx.messaging.events.MessageEvent;
+import mx.messaging.events.MessageFaultEvent;
+import mx.messaging.messages.AbstractMessage;
+import mx.messaging.messages.AcknowledgeMessage;
+import mx.messaging.messages.AsyncMessage;
+import mx.messaging.messages.CommandMessage;
+import mx.messaging.messages.ErrorMessage;
+import mx.messaging.messages.IMessage;
+import mx.resources.IResourceManager;
+import mx.resources.ResourceManager;
+
+use namespace mx_internal;
+
+[ResourceBundle("messaging")]
+
+/**
+ *  @private
+ */
+public class AbstractProducer extends MessageAgent
+{
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @private
+     */
+	public function AbstractProducer()
+	{
+		super();
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 *  A connect message to use for (re)connect attempts which allows the underlying
+	 *  ChannelSet to de-dupe if multiple reconnects queue up at the channel layer.
+	 */
+	private var _connectMsg:CommandMessage;
+
+    /**
+     *  @private
+     *  This is the current number of reconnect attempts that we've done.
+     */
+    private var _currentAttempt:int;
+
+    /**
+     *  @private
+     *  The timer used for reconnect attempts.
+     */
+    private var _reconnectTimer:Timer;
+
+	/**
+	 *  @private
+	 *  Indicates whether this agent should be connected or not.
+	 */
+	protected var _shouldBeConnected:Boolean;
+
+    /**
+     *  @private
+     */
+    private var resourceManager:IResourceManager =
+									ResourceManager.getInstance();
+
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    //
+    //--------------------------------------------------------------------------
+
+	//----------------------------------
+	//  autoConnect
+	//----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _autoConnect:Boolean = true;
+
+    [Bindable(event="propertyChange")]
+
+    /**
+     *  If true the Producer will automatically connect to its destination the
+     *  first time send() is invoked.
+     *  If false then connect() must be invoked explicitly to
+     *  establish a connection to the destination.
+     *  By default this property is true but applications that need to operate
+     *  in an offline fashion may set this to false to prevent send()
+     *  from connecting implicitly.
+     */
+    public function get autoConnect():Boolean
+    {
+        return _autoConnect;
+    }
+
+    /**
+     *  @private
+     */
+    public function set autoConnect(value:Boolean):void
+    {
+        if (_autoConnect != value)
+        {
+            var event:PropertyChangeEvent = PropertyChangeEvent.createUpdateEvent(this, "autoConnect", _autoConnect, value);
+            _autoConnect = value;
+            dispatchEvent(event);
+        }
+    }
+
+	//----------------------------------
+	//  defaultHeaders
+	//----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _defaultHeaders:Object;
+
+    [Bindable(event="propertyChange")]
+
+    /**
+     *  The default headers to apply to messages sent by the Producer.
+     *  Any default headers that do not exist in the message will be created.
+     *  If the message already contains a matching header, the value in the
+     *  message takes precedence and the default header value is ignored.
+     */
+    public function get defaultHeaders():Object
+    {
+        return _defaultHeaders;
+    }
+
+    /**
+     *  @private
+     */
+    public function set defaultHeaders(value:Object):void
+    {
+        if (_defaultHeaders != value)
+        {
+            var event:PropertyChangeEvent = PropertyChangeEvent.createUpdateEvent(this, "defaultHeaders", _defaultHeaders, value);
+            _defaultHeaders = value;
+            dispatchEvent(event);
+        }
+    }
+
+    //----------------------------------
+	//  reconnectAttempts
+	//----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _reconnectAttempts:int;
+
+    [Bindable(event="propertyChange")]
+
+	/**
+	 *  The number of reconnect attempts that the Producer makes in the event
+	 *  that the destination is unavailable or the connection to the destination closes.
+	 *  A value of -1 enables infinite attempts.
+	 *  A value of zero disables reconnect attempts.
+	 *

+	 *  Reconnect attempts are made at a constant rate according to the reconnect interval
+	 *  value. When a reconnect attempt is made if the underlying channel for the Producer is not
+	 *  connected or attempting to connect the channel will start a connect attempt.
+	 *  Subsequent Producer reconnect attempts that occur while the underlying
+	 *  channel connect attempt is outstanding are effectively ignored until
+	 *  the outstanding channel connect attempt succeeds or fails.
+	 *

+	 *
+	 *  @see mx.messaging.Producer#reconnectInterval
+	 */
+	public function get reconnectAttempts():int
+	{
+	    return _reconnectAttempts;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set reconnectAttempts(value:int):void
+	{
+	    if (_reconnectAttempts != value)
+	    {
+	        if (value == 0)
+	            stopReconnectTimer();
+
+	        var event:PropertyChangeEvent = PropertyChangeEvent.createUpdateEvent(this, "reconnectAttempts", _reconnectAttempts, value);
+	        _reconnectAttempts = value;
+	        dispatchEvent(event);
+	    }
+	}
+
+    //----------------------------------
+	//  reconnectInterval
+	//----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _reconnectInterval:int;
+
+    [Bindable(event="propertyChange")]
+
+	/**
+	 *  The number of milliseconds between reconnect attempts.
+	 *  If a Producer doesn't receive an acknowledgement for a connect
+	 *  attempt, it will wait the specified number of milliseconds before
+	 *  making a subsequent reconnect attempt.
+	 *  Setting the value to zero disables reconnect attempts.
+	 *

+	 *  Reconnect attempts are made at a constant rate according to this
+	 *  value. When a reconnect attempt is made if the underlying channel for the Producer is not
+	 *  connected or attempting to connect the channel will start a connect attempt.
+	 *  Subsequent Producer reconnect attempts that occur while the underlying
+	 *  channel connect attempt is outstanding are effectively ignored until
+	 *  the outstanding channel connect attempt succeeds or fails.
+	 *

+	 *
+	 *  @see mx.messaging.Producer#reconnectInterval
+	 *
+	 *  @throws ArgumentError If the assigned value is negative.
+	 */
+	public function get reconnectInterval():int
+	{
+	    return _reconnectInterval;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set reconnectInterval(value:int):void
+	{
+	    if (_reconnectInterval != value)
+	    {
+	        if (value < 0)
+			{
+				var message:String = resourceManager.getString(
+					"messaging", "reconnectIntervalNegative");
+	            throw new ArgumentError(message);
+			}
+		    else if (value == 0)
+			{
+		        stopReconnectTimer();
+			}
+		    else if (_reconnectTimer != null)
+			{
+		        _reconnectTimer.delay = value;
+			}
+
+		    var event:PropertyChangeEvent = PropertyChangeEvent.createUpdateEvent(this, "reconnectInterval", _reconnectInterval, value);
+		    _reconnectInterval = value;
+		    dispatchEvent(event);
+		}
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    // Overridden Public Methods
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+     *  Custom processing for message acknowledgments.
+     *  Specifically, re/connect acknowledgements.
+     *
+     *  @param ackMsg The AcknowledgeMessage.
+     *
+     *  @param msg The original message.
+	 */
+	override public function acknowledge(ackMsg:AcknowledgeMessage, msg:IMessage):void
+	{
+	    // Ignore acks for any outstanding messages that return after disconnect() is invoked.
+	    if (_disconnectBarrier)
+	        return;
+
+	    super.acknowledge(ackMsg, msg);
+	    if (msg is CommandMessage && CommandMessage(msg).operation == CommandMessage.CLIENT_PING_OPERATION)
+	        stopReconnectTimer();
+	}
+
+    /**
+	 *  @private
+     *  The Producer supresses ErrorMessage processing if the fault is for a connect
+     *  attempt that is being retried.
+     *
+     *  @param errMsg The ErrorMessage describing the fault.
+     *
+     *  @param msg The original message.
+	 */
+	override public function fault(errMsg:ErrorMessage, msg:IMessage):void
+    {
+        internalFault(errMsg, msg);
+    }
+
+    /**
+     *  @private
+     *  Custom processing to start up a reconnect timer if our channel is
+     *  disconnected when we should be connected.
+     *
+     *  @param event The ChannelEvent.
+     */
+    override public function channelDisconnectHandler(event:ChannelEvent):void
+	{
+	    super.channelDisconnectHandler(event);
+
+	    if (_shouldBeConnected && !event.rejected)
+            startReconnectTimer();
+	}
+
+	/**
+	 *  @private
+	 *  Custom processing to start up a reconnect timer if our channel faults
+	 *  when we should be connected.
+	 *
+	 *  @param event The ChannelFaultEvent.
+	 */
+	override public function channelFaultHandler(event:ChannelFaultEvent):void
+	{
+	    super.channelFaultHandler(event);
+
+	    if (_shouldBeConnected && !event.rejected && !event.channel.connected)
+	        startReconnectTimer();
+    }
+
+    /**
+	 *  Disconnects the Producer from its remote destination.
+	 *  This method does not wait for outstanding network operations to complete.
+	 *  After invoking disconnect(), the Producer will report that it is not
+	 *  connected and it will not receive any outstanding message acknowledgements or faults.
+	 *  Disconnecting stops automatic reconnect attempts if they are running.
+	 */
+	override public function disconnect():void
+	{
+	    _shouldBeConnected = false; // Prevent reconnect attempts.
+
+        stopReconnectTimer();
+
+        super.disconnect();
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Methods
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  Connects the Producer to its target destination.
+	 *  When a connection is established the connected property will
+	 *  change to true and this property is bindable and generates
+	 *  PropertyChangeEvents.
+	 *  The underlying CLIENT_PING_OPERATION CommandMessage that is sent will result
+	 *  in an acknowledge or fault event depending upon its success.
+	 *
+	 *  @throws mx.messaging.errors.InvalidDestinationError  If no destination is set.
+     *
+     *  @example
+     *

+     *     var producer:Producer = new Producer();
+     *     producer.destination = "TestTopic";
+     *     producer.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, handleConnect);
+     *     producer.connect();
+	 *

+	 */
+	public function connect():void
+	{
+	    if (!connected)
+	    {
+    	    _shouldBeConnected = true;
+
+    	    if (_connectMsg == null)
+        	    _connectMsg = buildConnectMessage();
+    	    internalSend(_connectMsg, false);
+	    }
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    // Methods
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  Sends the specified message to its destination.
+	 *  If the producer is being used for publish/subscribe messaging, only messages of type AsyncMessage
+	 *  should be sent unless a custom message type is being used and the
+	 *  message destination on the server has been configured to process the
+	 *  custom message type.
+     *
+	 *  @param message The Message to send.
+     *
+     *  @throws mx.messaging.errors.InvalidDestinationError  If no destination is set.
+     *
+     *  @example
+     *

+     *     var producer:Producer = new Producer();
+     *     producer.destination = "TestTopic";
+     *     var msg:AsyncMessage = new AsyncMessage();
+     *     msg.body = "test message";
+     *     producer.send(msg);
+	 *

+     *
+	 */
+	public function send(message:IMessage):void
+	{
+        if (!connected && autoConnect)
+            _shouldBeConnected = true;
+
+        if (defaultHeaders != null)
+        {
+            for (var header:String in defaultHeaders)
+            {
+                if (!message.headers.hasOwnProperty(header))
+                    message.headers[header] = defaultHeaders[header];
+            }
+        }
+
+        if (!connected && !autoConnect)
+        {
+            _shouldBeConnected = false;
+            var errMsg2:ErrorMessage = new ErrorMessage();
+			errMsg2.faultCode = "Client.Error.MessageSend";
+            errMsg2.faultString = resourceManager.getString(
+				"messaging", "producerSendError");
+            errMsg2.faultDetail = resourceManager.getString(
+				"messaging", "producerSendErrorDetails");
+            errMsg2.correlationId = message.messageId;
+            internalFault(errMsg2, message, false, true);
+        }
+        else
+        {
+            if (Log.isInfo())
+    	        _log.info("'{0}' {1} sending message '{2}'", id, _agentType, message.messageId);
+    	    internalSend(message);
+        }
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    // Internal Methods
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+     *  The Producer supresses ErrorMessage processing if the fault is for a connect
+     *  attempt that is being retried.
+     *
+     *  @param errMsg The ErrorMessage describing the fault.
+     *
+     *  @param msg The original message.
+     *
+     *  @param routeToStore currently not used.  Previously was a flag used to
+     *  indicate if the faulted message shoudl be stored offline to retry.
+     *
+     *  @param ignoreDisconnectBarrier If true the message is faulted regardless
+     *  of whether disconnect() has been invoked. Generally a disconnect() will
+     *  supress pending acks and faults.
+	 */
+	mx_internal function internalFault(errMsg:ErrorMessage, msg:IMessage,
+	                                   routeToStore:Boolean = true,
+	                                   ignoreDisconnectBarrier:Boolean = false):void
+	{
+	    // Ignore faults for any outstanding messages that return after disconnect() is invoked.
+	    if (_disconnectBarrier && !ignoreDisconnectBarrier)
+	        return;
+
+        if (msg is CommandMessage && CommandMessage(msg).operation == CommandMessage.CLIENT_PING_OPERATION)
+        {
+            if (_reconnectTimer == null)
+            {
+                // If this error correlates to our current connect message,
+                // we should no longer be connected.
+                if ((_connectMsg != null) && (errMsg.correlationId == _connectMsg.messageId))
+                {
+                    _shouldBeConnected = false;
+                    // Improve the messaging.
+                    var errMsg2:ErrorMessage = buildConnectErrorMessage();
+                    errMsg2.rootCause = errMsg.rootCause;
+                    super.fault(errMsg2, msg);
+                }
+                else
+                {
+                    super.fault(errMsg, msg);
+                }
+            }
+            // Else, suppress the fault dispatch because the reconnect timer
+            // is running and will generate a fault when it runs out of
+            // allowed reconnect attempts.
+        }
+	    else
+	    {
+            super.fault(errMsg, msg);
+	    }
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    // Protected Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Attempt to reconnect.  This can be called directly or
+     *  from a Timer's event handler.
+     *
+     *  @param event The timer event for reconnect attempts.
+     */
+    protected function reconnect(event:TimerEvent):void
+    {
+        // If we're past our limit of attempts, fault out.
+        if ((_reconnectAttempts != -1) &&
+            (_currentAttempt >= _reconnectAttempts))
+        {
+            stopReconnectTimer();
+            _shouldBeConnected = false;
+            fault(buildConnectErrorMessage(), _connectMsg);
+            return;
+        }
+
+        if (Log.isDebug())
+            _log.debug("'{0}' {1} trying to reconnect.", id, _agentType);
+
+        _reconnectTimer.delay = _reconnectInterval;
+        _currentAttempt++;
+        if (_connectMsg == null)
+            _connectMsg = buildConnectMessage();
+
+        internalSend(_connectMsg, false);
+    }
+
+	/**
+	 *  @private
+     *  This method will start a timer which attempts to reconnect
+     *  periodically.
+     */
+    protected function startReconnectTimer():void
+    {
+        if (_shouldBeConnected && (_reconnectTimer == null))
+        {
+            // If we're configured for reconnect set up the timer.
+            if ((_reconnectAttempts != 0) && (_reconnectInterval > 0))
+            {
+                if (Log.isDebug())
+                    _log.debug("'{0}' {1} starting reconnect timer.", id, _agentType);
+	            /*
+	             * Initially, the timeout is set to 1 so we try to
+	             * reconnect immediately (perhaps to a different channel).
+	             * after that, it will poll at the configured time interval.
+	             */
+	            _reconnectTimer = new Timer(1);
+	            _reconnectTimer.addEventListener(TimerEvent.TIMER, reconnect);
+	            _reconnectTimer.start();
+	            _currentAttempt = 0;
+            }
+        }
+    }
+
+    /**
+     * @private
+     * Stops a reconnect timer if one is running.
+     */
+    protected function stopReconnectTimer():void
+    {
+        if (_reconnectTimer != null)
+        {
+            if (Log.isDebug())
+                _log.debug("'{0}' {1} stopping reconnect timer.", id, _agentType);
+
+            _reconnectTimer.removeEventListener(TimerEvent.TIMER, reconnect);
+            _reconnectTimer.reset();
+            _reconnectTimer = null;
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Private Methods
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 *  Builds an ErrorMessage for a failed connect attempt.
+	 *
+	 *  @return The ErrorMessage.
+	 */
+	private function buildConnectErrorMessage():ErrorMessage
+	{
+	    var errMsg:ErrorMessage = new ErrorMessage();
+		errMsg.faultCode = "Client.Error.Connect";
+        errMsg.faultString = resourceManager.getString(
+			"messaging", "producerConnectError");
+        errMsg.faultDetail = resourceManager.getString(
+			"messaging", "failedToConnect");
+        errMsg.correlationId = _connectMsg.messageId;
+        return errMsg;
+	}
+
+	/**
+	 *  @private
+	 *  Builds a 'connect' message to use for a connect attempt.
+	 *
+	 *  @return The 'connect' CommandMessage.
+	 */
+	private function buildConnectMessage():CommandMessage
+	{
+        var msg:CommandMessage = new CommandMessage();
+        msg.operation = CommandMessage.CLIENT_PING_OPERATION;
+        msg.clientId = clientId;
+        msg.destination = destination;
+        return msg;
+	}
+
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 3621
Author:   smgilson@adobe.com
Date:     2008-10-14T15:21:00.927025Z

Log Message:
-----------
ASdoc updates

Checkin Test Passed: Yes
QA: No
Bug:
Doc: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxVScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxHScrollBar.as</path>

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

--- frameworks/projects/spark/src/spark/components/HScrollBar.as
+++ frameworks/projects/spark/src/spark/components/HScrollBar.as
@@ -21,8 +21,6 @@
  *  the portion of data that is displayed when there is too much data
  *  to fit horizontally in a display area.
  *
- *
This control extends the base ScrollBar control.

- *
  *
Although you can use the FxHScrollBar control as a stand-alone control,
  *  you usually combine it as part of another group of components to
  *  provide scrolling functionality.

@@ -52,7 +50,7 @@
     //--------------------------------------------------------------------------

     /**
-     *  The size of the track on an FxHScrollBar equals the width of the track.
+     *  The size of the track, which equals the width of the track.
      */
     override protected function get trackSize():Number
     {
@@ -69,8 +67,8 @@
     //--------------------------------------------------------------------------

     /**
-     *  Position the thumb button according to the given thumbPos parameter,
-     *  relative to the current x location of the track in the scrollbar control.
+     *  Position the thumb button based on the specified thumb position,
+     *  relative to the current X location of the track in the control.
      *
      *  @param thumbPos A number representing the new position of the thumb
      *  button in the control.
@@ -82,7 +80,7 @@
             var trackPos:Number = track ? track.x : 0;
             var layoutItem:ILayoutItem = LayoutItemFactory.getLayoutItemFor(thumb);
             layoutItem.setActualPosition(Math.round(trackPos + thumbPos),
-            					    	 layoutItem.actualPosition.y);
+                                         layoutItem.actualPosition.y);
         }
     }

@@ -103,11 +101,14 @@
     }

     /**
-     *  The position of the thumb on an FxHScrollBar is equal to the given
-     *  localX parameter.
-     *
-     *  @param localX The x position relative to the scrollbar control
-     *  @param localY The y position relative to the scrollbar control
+     *  Returns the position of the thumb button on an FxHScrollBar control,
+     *  which is equal to the localX parameter.
+     *
+     *  @param localX The X position relative to the scrollbar control.
+     *
+     *  @param localY The Y position relative to the scrollbar control.
+     *
+     *  @return The position of the thumb button.
      */
     override protected function pointToPosition(localX:Number,
                                                 localY:Number):Number
@@ -128,13 +129,29 @@
     }

     /**
-     *  If viewport is non null then ask it to compute the horizontal
-     *  scroll position delta for page up/down.  The delta is added
-     *  to this scrollbar's value.
-     *
-     *  @see viewport
-     *  @see #setValue
-     *  @see IViewport#horizontalScrollPositionDelta
+     *  If viewport is not null,
+     *  change the horizontal scroll position for page up or page down by
+     *  scrolling the viewport.
+     *  This method calculates the amount to scroll by calling the
+     *  IViewport.horizontalScrollPositionDelta() method
+     *  with either flash.ui.Keyboard.PAGE_UP
+     *  or flash.ui.Keyboard.PAGE_DOWN.
+     *  It then calls the setValue() method to
+     *  set the IViewport.horizontalScrollPosition property
+     *  to the appropriate value.
+     *
+     *
If viewport is null,
+     *  change the scroll position for page up or page down by calling
+     *  the page() method.

+     *
+     *  @param increase Whether the page scroll is up (true) or
+     *  down (false).
+     *
+     *  @see mx.components.baseClasses.FxTrackBase#page()
+     *  @see mx.components.baseClasses.FxTrackBase#setValue()
+     *  @see mx.core.IViewport
+     *  @see mx.core.IViewport#horizontalScrollPosition
+     *  @see mx.core.IViewport#horizontalScrollPositionDelta()
      */
     override public function page(increase:Boolean = true):void
     {
@@ -145,13 +162,29 @@
     }

     /**
-     *  If viewport is non null then ask it to compute the horizontal
-     *  scroll position delta for step up/down.  The delta is added
-     *  to this scrollbar's value.
-     *
-     *  @see viewport
-     *  @see #setValue
-     *  @see IViewport#horizontalScrollPositionDelta
+     *  If viewport is not null,
+     *  change the horizontal scroll position for line up or line down by
+     *  scrolling the viewport.
+     *  This method calculates the amount to scroll by calling the
+     *  IViewport.horizontalScrollPositionDelta() method
+     *  with either flash.ui.Keyboard.RIGHT
+     *  or flash.ui.Keyboard.LEFT.
+     *  It then calls the setValue() method to
+     *  set the IViewport.horizontalScrollPosition property
+     *  to the appropriate value.
+     *
+     *
If viewport is null,
+     *  change the scroll position for line up or line down by calling
+     *  the step() method.

+     *
+     *  @param increase Whether the line scoll is up (true) or
+     *  down (false).
+     *
+     *  @see mx.components.baseClasses.FxTrackBase#step()
+     *  @see mx.components.baseClasses.FxTrackBase#setValue()
+     *  @see mx.core.IViewport
+     *  @see mx.core.IViewport#horizontalScrollPosition
+     *  @see mx.core.IViewport#horizontalScrollPositionDelta()
      */
     override public function step(increase:Boolean = true):void
     {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/spark/src/spark/effects/AnimateFilter.as
+++ frameworks/projects/spark/src/spark/effects/AnimateFilter.as
@@ -18,7 +18,7 @@
 import mx.effects.Effect;
 import mx.effects.IEffectInstance;
 import mx.events.EffectEvent;
-import mx.filters.IBitmapFilter;
+import mx.filters.IFlexBitmapFilter;
 import mx.styles.IStyleClient;

 use namespace mx_internal;
@@ -80,7 +80,7 @@
     /**
      *  Constructor.
      */
-    public function FxAnimateFilter(target:Object = null, filter:IBitmapFilter = null)
+    public function FxAnimateFilter(target:Object = null, filter:IFlexBitmapFilter = null)
     {
         super(target);
         instanceClass = FxAnimateFilterInstance;
@@ -100,7 +100,7 @@
     /**
      *  IBitmapFilter instance to apply and animate.
      */
-    public var bitmapFilter:IBitmapFilter;
+    public var bitmapFilter:IFlexBitmapFilter;

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 23247
Author:   cframpto@adobe.com
Date:     2011-12-20T19:21:13.134833Z

Log Message:
-----------
Remove ADOBE SYSTEMS license and replace with Apache license in headers - frameworks.  A 2nd pass will be needed to get the files not handled up by the scripts.

Modified Paths:
--------------
4959 paths were modified

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

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


Added a scrollYBy function to scrollList by y values

--- src/org/openPyro/controls/listClasses/ListBase.as
+++ src/org/openPyro/controls/listClasses/ListBase.as
@@ -543,6 +543,27 @@
 			}
 		}

+		public function scrollYBy(delta:Number):void{
+			/*
+			Right now the presence or absence of a
+			scrollbar is a metric of whether or not
+			the list is scrollable. This needs to be fixed for
+			cases for example when ScrollPolicy is set to None
+			*/
+			if(! this._verticalScrollBar) return;
+
+			_verticalScrollBar
+			var yval:Number = delta;
+			var percent:Number = yval/(_contentHeight-height);
+			percent += _verticalScrollBar.value;
+
+			percent = Math.min(percent, 1);
+			percent = Math.max(percent, 0);
+			_verticalScrollBar.value = percent;
+			_verticalScrollBar.visible = true;
+
+		}
+
 		public function setFocus():void{

 		}


Added Query.map() construct for applying aggregate functions to all tuples

git-svn-id: 6aa7ccb0a2048310a30f08a72aaff4ca39d980ed@199 91848ab2-c4ae-4e4f-8e6a-6a52ea0dccc3

--- flare/src/flare/query/Query.as
+++ flare/src/flare/query/Query.as
@@ -45,6 +45,7 @@
 		private var _where:Function;
 		private var _sort:Sort;
 		private var _aggrs:Array;
+		private var _map:Boolean = false;

 		/**
 		 * Creates a new Query.
@@ -123,6 +124,33 @@
 		public function groupby(...terms):Query
 		{
 			_groupby = (terms.length > 0 ? terms : null);
+			return this;
+		}
+
+		/**
+		 * Sets whether or not aggregate functions will be mapped to all
+		 * tuples in the data set. This allows the results of aggregate
+		 * operators to be applied for all tuples. For example, the
+		 * map directive allows queries of this form:
+		 *

+		 * var q:Query = select({a:div(a,sum(a))}).map().eval(...);
+		 *

+		 *
The result include normalized a values for
+		 * all tuples in the input data. Without the map directive, a
+		 * "group-by" for all data would be assumed and only a single tuple
+		 * would be returned in the result set (matching the normal behavior
+		 * of a SQL database). Map can also be specified with a
+		 * group-by clause, in which case the aggregate operators will be
+		 * handled separately for each group, but the result set will still
+		 * contain a result for every tuple in the input set.

+		 * @param value if true (the default), aggregate operators will be
+		 *  applied (mapped) to all tuples; if false, normal group-by semantics
+		 *  will be used.
+		 * @return this query object
+		 */
+		public function map(value:Boolean=true):Query
+		{
+			_map = value;
 			return this;
 		}

@@ -220,9 +248,12 @@
 				_sort.sort(results);
 			}

-			if (_select == null) return results;
-			if (_aggrs == null && _groupby==null) return project(results);
-			return group(results);
+			if (_select == null)
+				return results;
+			else if (_aggrs == null && _groupby==null)
+				return projectAll(results);
+			else
+				return aggregate(results);
 		}

 		/**
@@ -231,7 +262,7 @@
 		 * @param results the filtered query results array
 		 * @return query results array of projected objects
 		 */
-		protected function project(results:Array):Array
+		private function projectAll(results:Array):Array
 		{
 			for (var i:int=0; i<results.length; ++i) {
 				var item:Object = {};
@@ -252,9 +283,9 @@
 		 * @param items the filtered query results array
 		 * @return aggregated query results array
 		 */
-		protected function group(items:Array):Array
-		{
-			var i:int, item:Object;
+		private function aggregate(items:Array):Array
+		{
+			var h:int, i:int, j:int, item:Object;
 			var results:Array = [], props:Array = [];

 			// get group-by properties as key
@@ -268,15 +299,22 @@

 			// process all groups
 			reset(_aggrs);
-			for (i=1, item=items[0]; i<=items.length; ++i) {
+			for (i=1, h=0, item=items[0]; i<=items.length; ++i) {
 				// update the aggregate functions
 				for each (var aggr:AggregateExpression in _aggrs) {
 					aggr.aggregate(items[i-1]);
 				}
 				// handle change of group
-				if (i==items.length || !sameGroup(props, item, items[i])) {
-					results.push(endGroup(item));
-					item = items[i];
+				if (i==items.length ||
+					!(_groupby==null || sameGroup(props, item, items[i])))
+				{
+					if (_map) {
+						for (j=h; j<i; ++j)
+							results.push(project(items[j]));
+					} else {
+						results.push(project(item));
+					}
+					item = items[(h=i)];
 					reset(_aggrs);
 				}
 			}
@@ -291,7 +329,7 @@
 			}
 		}

-		private function endGroup(item:Object):Object
+		private function project(item:Object):Object
 		{
 			var result:Object = {};
 			for each (var pair:Object in _select) {


Added asserts to the introspection process that automatically exposes stuff to ExternalInterface. Wrapped those methods in a try/catch that returns Error objects to JS instead of throwing.

--- flash/org/windmill/Windmill.as
+++ flash/org/windmill/Windmill.as
@@ -21,26 +21,58 @@
   public class Windmill {
     public static var context:*; // May be Stage or Application
     public static var controllerMethods:Array = [];
+    public static var assertMethods:Array = [];
+    public static var packages:Object = {
+      controller: {
+        packageRef: org.windmill.WMController,
+        methodNames: []
+      },
+      assert: {
+        packageRef: org.windmill.WMAssert,
+        methodNames: []
+      }
+    };

     public function Windmill():void {}

     public static function init(config:Object):void {
+      var methodName:String;
+      var item:*;
+      var descr:XML;
+      // Returns a wrapped version of the method
+      // which returns the Error obj instead of throwing
+      var genExtFunc:Function = function (k:String,
+          m:String):Function {
+        return function (...args):* {
+          try {
+            return packages[k].packageRef[m].apply(null, args);
+          }
+          catch (e:Error) {
+            return e;
+          }
+        }
+      }
       // Search context for locators -- can be either
       // Stage or Application, but usually a Stage
       context = config.context;

-      // Introspect all the public controller methods
-      // to expose via ExternalInterface
-      var descr:XML = flash.utils.describeType(
-          org.windmill.WMController);
-      for each (var item:* in descr..method) {
-        controllerMethods.push(item.@name.toXMLString());
-      }
-      // Expose public methods via ExternalInterface
-      // 'dragDropOnCoords' becomes 'wm_dragDropOnCoords'
-      for each (var methodName:String in controllerMethods) {
-        ExternalInterface.addCallback('wm_' + methodName,
-            org.windmill.WMController[methodName]);
+      // controller, assert
+      for (var key:String in packages) {
+        // Introspect all the public packages
+        // to expose via ExternalInterface
+        descr = flash.utils.describeType(
+            packages[key].packageRef);
+        for each (item in descr..method) {
+          packages[key].methodNames.push(item.@name.toXMLString());
+        }
+        // Expose public packages via ExternalInterface
+        // 'dragDropOnCoords' becomes 'wm_dragDropOnCoords'
+        // The exposed method is wrapped in a try/catch
+        // that returns the Error obj to JS instead of throwing
+        for each (methodName in packages[key].methodNames) {
+          ExternalInterface.addCallback('wm_' + methodName,
+              genExtFunc(key, methodName));
+        }
       }
     }
   }


Update KrewMovieClip

Update KrewMovieClip

--- krew-framework/krewfw/builtin_actor/display/KrewMovieClip.as
+++ krew-framework/krewfw/builtin_actor/display/KrewMovieClip.as
@@ -21,14 +21,16 @@
          * Please call after init().
          *
          * @param infoList List of [imageName, durationSec]. Example:
+         * <pre>
          * [
          *     ['frame_1', 0.1],
          *     ['frame_2', 0.1],
          *     ['frame_3', 0.1],
          *     ...
          * ]
+         * </pre>
          */
-        public function setupMovieClip(infoList:Array, width:Number, height:Number,
+        public function setUpMovieClip(infoList:Array, width:Number, height:Number,
                                        x:Number=0, y:Number=0):void
         {
             _movieInfoList = infoList;
@@ -37,6 +39,16 @@
             _movieImage = getImage(imageName);
             addImage(_movieImage, width, height, x, y);
             _frameCount = 0;
+        }
+
+        public function changeClip(newInfoList:Array):void {
+            _movieInfoList = newInfoList;
+
+            _frameCount    = 0;
+            _framePlayTime = 0;
+
+            var imageName:String = _movieInfoList[_frameCount][0];
+            changeImage(_movieImage, imageName);
         }

         public function setRandomFrame():void {
@@ -53,7 +65,7 @@

         private function _updateMovieFrame(passedTime:Number):void {
             if (!_movieInfoList) { return; }
-            if (_movieInfoList.length == 0) { return; }
+            if (_movieInfoList.length <= 1) { return; }

             var nextDuration:Number = _movieInfoList[_frameCount][1];
             _framePlayTime += passedTime;


Better script tag firing.

Better script tag firing.

Debugging of script tag events.
General seek logic cleanup.

--- HLSPlugin/src/org/osmf/net/httpstreaming/HLSHTTPNetStream.as
+++ HLSPlugin/src/org/osmf/net/httpstreaming/HLSHTTPNetStream.as
@@ -1783,18 +1783,12 @@
 		private function insertScriptDataTag(tag:FLVTagScriptDataObject, first:Boolean = false):void
 		{
 			if (!_insertScriptDataTags)
-			{
 				_insertScriptDataTags = new Vector.<FLVTagScriptDataObject>();
-			}

 			if (first)
-			{
 				_insertScriptDataTags.unshift(tag);
-			}
 			else
-			{
 				_insertScriptDataTags.push(tag);
-			}
 		}

 		/**
@@ -1803,8 +1797,11 @@
 		 * Consumes all script data tags from the queue. Returns the number of bytes
 		 *
 		 */
-		private function consumeAllScriptDataTags(timestamp:Number):int
-		{
+		private function consumeAllScriptDataTags(timestamp:uint):int
+		{
+			if (_insertScriptDataTags == null)
+				return 0;
+
 			var processed:int = 0;
 			var index:int = 0;
 			var bytes:ByteArray = null;
@@ -1812,16 +1809,16 @@

 			for (index = 0; index < _insertScriptDataTags.length; index++)
 			{
+				tag = _insertScriptDataTags[index];
+
+				if (tag == null)
+					continue;
+
 				bytes = new ByteArray();
-				tag = _insertScriptDataTags[index];
-
-				if (tag != null)
-				{
-					tag.timestamp = timestamp;
-					tag.write(bytes);
-					attemptAppendBytes(bytes);
-					processed += bytes.length;
-				}
+				tag.timestamp = timestamp;
+				tag.write(bytes);
+				appendBytes(bytes);
+				processed += bytes.length;
 			}
 			_insertScriptDataTags.length = 0;
 			_insertScriptDataTags = null;
@@ -1897,18 +1894,17 @@
 		 * @private
 		 *
 		 * Helper function that calls consumeAllScriptDataTags and also
-		 * performs some logging
+		 * performs some logging. Note it does no timestamp comparisons
+		 * so you want to pass the unmodified uint timestamp from the FLV
+		 * tag rather than a "correct" time.
 		 */
 		private function doConsumeAllScriptDataTags(timestamp:uint):void
 		{
-			if (_insertScriptDataTags != null)
-			{
-				CONFIG::LOGGING
-				{
-					logger.debug("Consume all queued script data tags ( use timestamp = " + timestamp + " ).");
-				}
-				_flvParserProcessed += consumeAllScriptDataTags(timestamp);
-			}
+			CONFIG::LOGGING
+			{
+				logger.debug("Consume all queued script data tags ( use timestamp = " + timestamp + " ).");
+			}
+			_flvParserProcessed += consumeAllScriptDataTags(timestamp);
 		}

 		/**
@@ -1957,6 +1953,16 @@
 				}
 			}

+			if(_enhancedSeekTarget == Number.MAX_VALUE)
+			{
+				CONFIG::LOGGING
+				{
+					logger.debug("Left over enhanced seek-to-end, aborting (_seekTarget=" + _seekTarget + ").");
+				}
+				_enhancedSeekTarget = NaN;
+				_seekTarget = NaN;
+			}
+
 			var realTimestamp:int = wrapTagTimestampToFLVTimestamp(tag.timestamp);
 			var currentTime:Number = realTimestamp / 1000.0;

@@ -1966,6 +1972,26 @@
 			CONFIG::LOGGING
 			{
 				logger.debug("Saw tag @ " + realTimestamp + " timestamp=" + tag.timestamp + " currentTime=" + currentTime + " _seekTime=" + _seekTime + " _enhancedSeekTarget="+ _enhancedSeekTarget + " dataSize=" + tag.dataSize);
+			}
+
+			if (_playForDuration >= 0)
+			{
+				if (_initialTime >= 0)	// until we know this, we don't know where to stop, and if we're enhanced-seeking then we need that logic to be what sets this up
+				{
+					if (currentTime > (_initialTime + _playForDuration))
+					{
+
+						setState(HTTPStreamingState.STOP);
+						_flvParserDone = true;
+						if (_seekTime < 0)
+						{
+							_seekTime = _playForDuration + _initialTime;	// FMS behavior... the time is always the final time, even if we seek to past it
+							// XXX actually, FMS  actually lets exactly one frame though at that point and that's why the time gets to be what it is
+							// XXX that we don't exactly mimic that is also why setting a duration of zero doesn't do what FMS does (plays exactly that one still frame)
+						}
+						return false;
+					}
+				}
 			}

 			if (!isNaN(_enhancedSeekTarget))
@@ -2032,7 +2058,7 @@
 						var haveSeenVideoTag:Boolean = false;

 						// twiddle and dump
-						for (i=0; i<_enhancedSeekTags.length; i++)
+						for (var i:int=0; i<_enhancedSeekTags.length; i++)
 						{
 							var vTag:FLVTag = _enhancedSeekTags[i];

@@ -2055,7 +2081,7 @@

 							vTag.timestamp = tag.timestamp;

-							bytes = new ByteArray();
+							var bytes:ByteArray = new ByteArray();
 							vTag.write(bytes);
 							_flvParserProcessed += bytes.length;

@@ -2103,289 +2129,11 @@
 				return true;
 			} // enhanced seek

-			if(true)
-			{
-
-				var b:ByteArray = new ByteArray();
-				tag.write(b);
-				attemptAppendBytes(b);
-				_flvParserDone = true;
-				return false;
-			}
-
-
-			//------------------------------------------------
-			//------------------------------------------------
-			//------------------------------------------------
-
-			var i:int;
-
-
-			// Apply bump if present.
-			if(indexHandler && indexHandler.bumpedTime
-				&& (_enhancedSeekTarget > indexHandler.bumpedSeek
-					|| _seekTarget > indexHandler.bumpedSeek))
-			{
-				CONFIG::LOGGING
-				{
-					logger.debug("INDEX HANDLER REQUESTED TIME BUMP to " + indexHandler.bumpedSeek);
-				}
-				_seekTarget = indexHandler.bumpedSeek;
-				_enhancedSeekTarget = indexHandler.bumpedSeek;
-			}
-
-			if(_enhancedSeekTarget == Number.MAX_VALUE)
-			{
-				CONFIG::LOGGING
-				{
-					logger.debug("Left over enhanced seek-to-end, aborting (_seekTarget=" + _seekTarget + ").");
-				}
-				_enhancedSeekTarget = NaN;
-				_seekTarget = NaN;
-			}
-
-			if(indexHandler)
-				indexHandler.bumpedTime = false;
-
-			CONFIG::LOGGING
-			{
-				logger.debug("Saw tag @ " + realTimestamp + " timestamp=" + tag.timestamp + " currentTime=" + currentTime + " _seekTime=" + _seekTime + " _enhancedSeekTarget="+ _enhancedSeekTarget + " dataSize=" + tag.dataSize);
-			}
-
-			// Fix for http://bugs.adobe.com/jira/browse/FM-1544
-			// We need to take into account that flv tags' timestamps are 32-bit unsigned ints
-			// This means they will roll over, but the bootstrap times won't, since they are 64-bit unsigned ints
-			/*while (currentTime < _initialTime)
-			{
-				// Add 2^32 (4,294,967,296) milliseconds to the currentTime
-				// currentTime is in seconds so we divide that by 1000
-				currentTime += 4294967.296;
-			}*/
-
-			if (_playForDuration >= 0)
-			{
-				if (_initialTime >= 0)	// until we know this, we don't know where to stop, and if we're enhanced-seeking then we need that logic to be what sets this up
-				{
-					if (currentTime > (_initialTime + _playForDuration))
-					{
-
-						setState(HTTPStreamingState.STOP);
-						_flvParserDone = true;
-						if (_seekTime < 0)
-						{
-							_seekTime = _playForDuration + _initialTime;	// FMS behavior... the time is always the final time, even if we seek to past it
-							// XXX actually, FMS  actually lets exactly one frame though at that point and that's why the time gets to be what it is
-							// XXX that we don't exactly mimic that is also why setting a duration of zero doesn't do what FMS does (plays exactly that one still frame)
-						}
-						return false;
-					}
-				}
-			}
-
-			if (!isNaN(_enhancedSeekTarget))
-			{
-				if (currentTime < _enhancedSeekTarget)
-				{
-					CONFIG::LOGGING
-					{
-						logger.debug("Skipping FLV tag @ " + currentTime + " until " + _enhancedSeekTarget);
-					}
-					if (_enhancedSeekTags == null)
-					{
-						_enhancedSeekTags = new Vector.<FLVTag>();
-					}
-
-					if (tag is FLVTagVideo)
-					{
-						if (_flvParserIsSegmentStart)
-						{
-							// Generate client side seek tag.
-							var _muteTag:FLVTagVideo = new FLVTagVideo();
-							_muteTag.timestamp = tag.timestamp; // may get overwritten, ok
-							_muteTag.codecID = FLVTagVideo(tag).codecID; // same as in use
-							_muteTag.frameType = FLVTagVideo.FRAME_TYPE_INFO;
-							_muteTag.infoPacketValue = FLVTagVideo.INFO_PACKET_SEEK_START;
-
-							// and start saving, with this as the first...
-							_enhancedSeekTags.push(_muteTag);
-
-							_flvParserIsSegmentStart = false;
-
-						}
-
-						_enhancedSeekTags.push(tag);
-					}
-					//else is a data tag, which we are simply saving for later, or a
-					//FLVTagAudio, which we discard unless is a configuration tag
-					else if ((tag is FLVTagScriptDataObject) ||
-						(tag is FLVTagAudio && FLVTagAudio(tag).isCodecConfiguration))
-					{
-						_enhancedSeekTags.push(tag);
-					}
-				}
-				else
-				{
-					// We've reached the tag whose timestamp is greater
-					// than _enhancedSeekTarget, so we can stop seeking.
-					_enhancedSeekTarget = NaN;
-
-					// Update _seekTime even though it's not used.
-					if (_seekTime < 0)
-						_seekTime = currentTime;
-
-					// Update initial time with time of tag.
-					if(isNaN(_initialTime))
-						_initialTime = currentTime;
-
-					// Process any client side seek tags.
-					if (_enhancedSeekTags != null && _enhancedSeekTags.length > 0)
-					{
-						// We do this dance to get the NetStream into a clean state. If we don't
-						// do this, then we can get failed resume in some scenarios - ie, audio
-						// but no picture.
-						super.close();
-						super.play(null);
-						appendBytesAction(NetStreamAppendBytesAction.RESET_SEEK);
-
-						_initialTime = NaN;
-
-						var codecID:int;
-						var haveSeenVideoTag:Boolean = false;
-
-						// twiddle and dump
-						for (i=0; i<_enhancedSeekTags.length; i++)
-						{
-							var vTag:FLVTag = _enhancedSeekTags[i];
-
-							if (vTag.tagType == FLVTag.TAG_TYPE_VIDEO)
-							{
-								var vTagVideo:FLVTagVideo = vTag as FLVTagVideo;
-
-								if (vTagVideo.codecID == FLVTagVideo.CODEC_ID_AVC && vTagVideo.avcPacketType == FLVTagVideo.AVC_PACKET_TYPE_NALU)
-								{
-									// for H.264 we need to move the timestamp forward but the composition time offset backwards to compensate
-									var adjustment:int = wrapTagTimestampToFLVTimestamp(tag.timestamp) - wrapTagTimestampToFLVTimestamp(vTagVideo.timestamp); // how far we are adjusting
-									var compTime:int = vTagVideo.avcCompositionTimeOffset;
-									compTime -= adjustment; // do the adjustment
-									vTagVideo.avcCompositionTimeOffset = compTime;	// save adjustment
-								}
-
-								codecID = vTagVideo.codecID;
-								haveSeenVideoTag = true;
-							}
-
-							vTag.timestamp = tag.timestamp;
-
-							bytes = new ByteArray();
-							vTag.write(bytes);
-							_flvParserProcessed += bytes.length;
-
-							if(writeToMasterBuffer)
-								_masterBuffer.writeBytes(bytes);
-							appendBytes(bytes);
-						}
-
-						// Emit end of client seek tag if we started client seek.
-						if (haveSeenVideoTag)
-						{
-							trace("Writing end-of-seek tag");
-							var _unmuteTag:FLVTagVideo = new FLVTagVideo();
-							_unmuteTag.timestamp = tag.timestamp;  // may get overwritten, ok
-							_unmuteTag.codecID = codecID;
-							_unmuteTag.frameType = FLVTagVideo.FRAME_TYPE_INFO;
-							_unmuteTag.infoPacketValue = FLVTagVideo.INFO_PACKET_SEEK_END;
-							bytes = new ByteArray();
-							_unmuteTag.write(bytes);
-							_flvParserProcessed += bytes.length;
-
-							if(writeToMasterBuffer)
-								_masterBuffer.writeBytes(bytes);
-							appendBytes(bytes);
-						}
-
-						_enhancedSeekTags = null;
-
-						// Update the last written time so we don't RESET_SEEK inappropriately.
-						lastWrittenTime = wrapTagTimestampToFLVTimestamp(tag.timestamp) / 1000.0;
-
-						// We are safe to consume the script data tags now.
-						doConsumeAllScriptDataTags(wrapTagTimestampToFLVTimestamp(tag.timestamp));
-
-					}
-
-					// and append this one
-					bytes = new ByteArray();
-					tag.write(bytes);
-					_flvParserProcessed += bytes.length;
-
-					// Need to keep _initialTime up to date and we return below.
-					if (isNaN(_initialTime))
-					{
-						trace("Setting new _initialTime of " + currentTime);
-						_initialTime = currentTime;
-					}
-
-					attemptAppendBytes(bytes);
-
-					if (_playForDuration >= 0)
-					{
-						return true;	// need to continue seeing the tags, and can't shortcut because we're being dropped off mid-segment
-					}
-					_flvParserDone = true;
-					return false;	// and end of parsing (caller must dump rest, unparsed)
-				}
-
-				return true;
-			} // enhanced seek
-
-			if (isNaN(_initialTime))
-			{
-				trace("Setting new _initialTime of " + currentTime);
-				_initialTime = currentTime;
-			}
-
-			// Before appending the tag, trigger the consumption of all
-			// the script data tags, with this tag's timestamp
-			doConsumeAllScriptDataTags(tag.timestamp);
-
-			// finally, pass this one on to appendBytes...
-			var bytes:ByteArray = new ByteArray();
-			tag.write(bytes);
-
-			//logger.debug("[2] APPEND BYTES tag.timestamp=" + tag.timestamp + " length=" + bytes.length);
-			attemptAppendBytes(bytes);
-			_flvParserProcessed += bytes.length;
-
-			// probably done seeing the tags, unless we are in playForDuration mode...
-			if (_playForDuration >= 0)
-			{
-				// using fragment duration to let the parser start when we're getting close to the end
-				// of the play duration (FM-1440)
-				if (_source.fragmentDuration >= 0 && _flvParserIsSegmentStart)
-				{
-					// if the segmentDuration has been reported, it is possible that we might be able to shortcut
-					// but we need to be careful that this is the first tag of the segment, otherwise we don't know what duration means in relation to the tag timestamp
-
-					_flvParserIsSegmentStart = false; // also used by enhanced seek, but not generally set/cleared for everyone. be careful.
-					currentTime = (tag.timestamp / 1000.0);
-					if (currentTime + _source.fragmentDuration >= (_initialTime + _playForDuration))
-					{
-						// it stops somewhere in this segment, so we need to keep seeing the tags
-						return true;
-					}
-					else
-					{
-						// stop is past the end of this segment, can shortcut and stop seeing tags
-						_flvParserDone = true;
-						return false;
-					}
-				}
-				else
-				{
-					return true;	// need to continue seeing the tags because either we don't have duration, or started mid-segment so don't know what duration means
-				}
-			}
-			// else not in playForDuration mode...
+			// Simplest case - write tag and terminate FLV processing.
+			var b:ByteArray = new ByteArray();
+			tag.write(b);
+			attemptAppendBytes(b);
+
 			_flvParserDone = true;
 			return false;
 		}
@@ -2648,11 +2396,28 @@
 				CONFIG::LOGGING
 				{
 					logger.debug("Writing tag " + buffer.length + " bytes @ " + lastWrittenTime + "sec type=" + tag.tagType + (isTagAVCC(tag as FLVTagVideo) ? " avcc" : "") + (isTagIFrame(tag as FLVTagVideo) ? " iframe" : ""));
+
+					if(tag is FLVTagScriptDataObject)
+					{
+						try
+						{
+							var obj:Array = (tag as FLVTagScriptDataObject).objects;
+							for(var j:int=0; j<obj.length; j++)
+								logger.debug("SCRIPT: " + JSON.stringify(obj[j]));
+						}
+						catch(e:*)
+						{
+							logger.debug("FAILED TO PARSE SCRIPT");
+						}
+					}
 				}

 				if(writeToMasterBuffer)
 					_masterBuffer.writeBytes(buffer);
 				appendBytes(buffer);
+
+				// Fire any pending script tags immediately.
+				consumeAllScriptDataTags(tag.timestamp);
 			}

 			// Erase the consumed tags. Do it after to avoid costly array shifting.


Improved Backup Support Fixes and Modifications Made further improvements to the improved backup / URL error support, improving its effectiveness and allowing it to work in even more cases.

--- HLSPlugin/src/org/osmf/net/httpstreaming/HLSHTTPNetStream.as
+++ HLSPlugin/src/org/osmf/net/httpstreaming/HLSHTTPNetStream.as
@@ -844,12 +844,12 @@
 							}

 							// start the recovery process if we need to recover and our buffer is getting too low
-							if (needToRecover && bufferLength <= recoveryBufferMin)
+							if (recoveryBufferTimer && recoveryBufferTimer.currentCount >= 1 && bufferLength <= recoveryBufferMin)
 							{
 								if (hasGottenManifest)
 								{
 									seekToRecoverStream();
-									needToRecover = false;
+									recoveryBufferTimer.reset();
 								}
 								break;
 							}
@@ -904,8 +904,6 @@
 									{
 										errorSurrenderTimer.reset();
 										firstSeekForwardCount = -1;
-										recoveryStartTime = -1;
-										needToRecover = false;
 										recoveryStateNum = URLErrorRecoveryStates.IDLE;
 									}

@@ -1279,7 +1277,17 @@
 					// Attempt to recover from a URL Error
 					if (errorSurrenderTimer.currentCount < recognizeBadStreamTime)
 					{
-						needToRecover = true;
+						if (!recoveryBufferTimer)
+						{
+							recoveryBufferTimer = new Timer(bufferLength * 1000);// must convert seconds to miliseconds
+						}
+						else
+						{
+							recoveryBufferTimer.reset();
+							recoveryBufferTimer.delay = bufferLength * 1000;
+						}
+						recoveryBufferTimer.start();
+
 						attemptStreamRecovery();

 						return;
@@ -1303,8 +1311,8 @@
 					// Switch to a backup stream if available
 					if (currentStream)
 					{
+						hasGottenManifest = false;
 						indexHandler.switchToBackup(currentStream);
-						hasGottenManifest = false;
 					}
 					else
 						hasGottenManifest = true;
@@ -2106,13 +2114,12 @@

 			private var hasStarted:Boolean = false;// true after we have played once, checked before automatically switching to a default stream

-			private var needToRecover:Boolean = false;// if we ran into a URL error and need to try and recover the stream
 			private var retryAttemptCount:Number = 0;// this is how many times we have tried to recover from a URL error in a row. Used to assist in retry timing and scrubbing
 			private var seekForwardBuffer:Number = 0.5;// this is how far ahead of the next segment we should seek to in order to ensure we load that segment
 			private var lastErrorTime:Number = 0;// this is the last time there was an error. Used when determining if an error has been resolved
 			private var firstSeekForwardCount:int = -1;// the count of errorSurrenderTimer when we first try to seek forward
 			private var recoveryBufferMin:Number = 2;// how low the bufferTime can get in seconds before we start trying to recover a stream by seeking
-			private var recoveryStartTime:Number = -1;// the time at which we attempt to recover at in the case of a URL error
+			private var recoveryBufferTimer:Timer; // timer that will be set to the length of the buffer so that we can be guaranteed to recover

 			public static var currentStream:HLSManifestStream;// this is the manifest we are currently using. Used to determine how much to seek forward after a URL error
 			public static var indexHandler:HLSIndexHandler;// a reference to the active index handler. Used to update the quality list after a change.


Transferred from the Adobe Open Source Subversion Repository

Revision: 11247
Author:   klin@adobe.com
Date:     2009-10-28T21:59:11.963883Z

Log Message:
-----------
Fix for https://bugs.adobe.com/jira/browse/SDK-23184.

Updated a bunch of Style metadata ASDocs to describe different defaults between the Halo and Spark themes. Also, fixed a few typos along the way.

defaults.css - rearranged a few styles to be in alphabetical order
Button.as - removed extra emphasizedSkin style metadata
Panel.as - added spark theme to borderAlpha metadata

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/TileListItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ProgressBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ButtonBarButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateChooser.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Menu.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/halo/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/fl/video/NCManagerNative.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/SkinStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ColorPicker.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/BorderStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/FlexModuleFactory.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/treeClasses/TreeItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/TextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Application.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/LinkButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/menuClasses/MenuItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Tree.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Panel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Accordion.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/colorPickerClasses/SwatchPanel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Application.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/TileLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/PopUpMenuIcon.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/PaddingStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManagerProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/GapStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Label.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/fl/video/NCManagerDynamicStream.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/LinkBar.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/framework/src/mx/styles/metadata/FocusStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/supportClasses/AnimateTransformInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/BitmapImage.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/StrokedElement.as</path>

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

--- frameworks/projects/mx/src/mx/controls/LinkBar.as
+++ frameworks/projects/mx/src/mx/controls/LinkBar.as
@@ -83,7 +83,8 @@
  *  Color of links as you roll the mouse pointer over them.
  *  The default value is based on the current themeColor.
  *
- *  @default 0xEEFEE6 (light green)
+ *  The default value for the Halo theme is 0xB2E1FF.
+ *  The default value for the Spark theme is 0xCEDBEF.
  *
  *  @langversion 3.0
  *  @playerversion Flash 9
@@ -95,7 +96,8 @@
 /**
  *  Background color of the LinkButton control as you press it.
  *
- *  @default 0xCDFFC1
+ *  The default value for the Halo theme is 0x7FCEFF.
+ *  The default value for the Spark theme is 0xA8C6EE.
  *
  *  @langversion 3.0
  *  @playerversion Flash 9
@@ -143,7 +145,8 @@
 /**
  *  Text color of the link as you move the mouse pointer over it.
  *
- *  @default 0x2B333C
+ *  The default value for the Halo theme is 0x2B333C.
+ *  The default value for the Spark theme is 0x000000.
  *
  *  @langversion 3.0
  *  @playerversion Flash 9
@@ -155,7 +158,8 @@
 /**
  *  Text color of the link as you press it.
  *
- *  @default 0x000000
+ *  The default value for the Halo theme is 0x2B333C.
+ *  The default for the Spark theme is 0x000000.
  *
  *  @langversion 3.0
  *  @playerversion Flash 9


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

--- frameworks/projects/framework/src/mx/collections/ISortField.as
+++ frameworks/projects/framework/src/mx/collections/ISortField.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2005-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 mx.collections
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 3297
Author:   jimurphy@adobe.com
Date:     2008-09-22T17:59:53.303960Z

Log Message:
-----------
Merge 3.0.x revisions 3260,3262,3266,3271,3276,3282,3285,3292,3294 -> trunk

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/events/FaultEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ProgressBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/events/ResultEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/DirectHTTPChannel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/dragClasses/DragProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractInvoker.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/Operation.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/PopUpManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManagerProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/IFocusManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/messages/AbstractMessage.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/Fault.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ISWFBridgeProvider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ISWFBridgeGroup.as</path>

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

--- frameworks/projects/framework/src/mx/managers/IFocusManager.as
+++ frameworks/projects/framework/src/mx/managers/IFocusManager.as
@@ -223,11 +223,18 @@
      *  The direction of the move is specified
      *  with the direction argument.
      *
-     *  @param direction FORWARD moves to from the control
-     *  that currently has focus to controls with a higher tab index.
-     *  If more than one control has the is, the next control
+     *  @param direction FocusRequestDirection.FORWARD moves to
+     *  from the control that currently has focus to controls with a higher tab index.
+     *  If more than one control has the same index, the next control
      *  in the flow of the document is visited.
-     *  BACKWARD moves to controls with a lower tab index.
+     *  FocusRequestDirection.BACKWARD moves to controls with
+     *  a lower tab index.
+     *  FocusRequestDirection.TOP move the focus to the control
+     *  with the lowest tab index. If more than one control has the same index,
+     *  focus is moved to the first control in the flow of the document.
+     *  FocusRequestDirection.BOTTOM move the focus to the control
+     *  with the highest tab index. If more than one control has the same index,
+     *  focus is moved to the last control in the flow of the document.
      *
      *  @param fromDisplayObject The starting point from which focus is moved.
      *  If an object is provided, this overrides the default behavior
@@ -244,8 +251,9 @@
      *  or using different versions of a focus manager.
      *
      *  @param bridge The bridge to another focus manager.
-     */
-    function addSWFBridge(bridge:IEventDispatcher):void
+     *  @param owner The display object that owns the bridge.
+     */
+    function addSWFBridge(bridge:IEventDispatcher, owner:DisplayObject):void

     /**
      *  Removes a focus manager.


Transferred from the Adobe Open Source Subversion Repository

Revision: 12156
Author:   smgilson@adobe.com
Date:     2009-11-24T14:17:59.820020Z

Log Message:
-----------
Various ASDoc bug fixes:

- localization: FLEXDOCS-1122, FLEXDOCS-1123
- Remove stray references to 'Fx' FLEXDOCS-999

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/TweenEffect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/components/examples/SpinnerExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airspark/src/spark/components/WindowedApplication.as</path>

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

--- frameworks/projects/framework/src/mx/managers/SystemManager.as
+++ frameworks/projects/framework/src/mx/managers/SystemManager.as
@@ -2850,7 +2850,7 @@

     /**
      *  Attempts to notify the parent SWFLoader that the
-     *  Application's size has may have changed
+     *  Application's size has changed.
      *
      *  @langversion 3.0
      *  @playerversion Flash 10


Transferred from the Adobe Open Source Subversion Repository

Revision: 20482
Author:   dloverin@adobe.com
Date:     2011-02-28T17:16:14.975868Z

Log Message:
-----------
Add properties to control allowing domains for new RSLs.

Add two Boolean properties to the IFlexModuleFactory interface.
•        Add the allowDomainsInNewRSLs property to control applying the domains gathered from allowDomain() calls to new RSLs.

•        Add the allowInsecureDomainsInNewRSLs property to control applying the domains gathered from allowInsecureDomain() calls to new RSLs.

QE notes: None.
Doc notes: None.
Bugs:
Reviewer: Alex
Tests run: cyclone
Is noteworthy for integration: No.

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/modules/compiler/src/java/flex2/tools/PreLink.java</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/IFlexModuleFactory.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/FlexModuleFactory.as</path>

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

--- frameworks/projects/framework/src/mx/managers/SystemManager.as
+++ frameworks/projects/framework/src/mx/managers/SystemManager.as
@@ -596,6 +596,66 @@
     //--------------------------------------------------------------------------

     //----------------------------------
+    //  allowDomainsInNewRSLs
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _allowDomainsInNewRSLs:Boolean = true;
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Flex 4.5
+     */
+    public function get allowDomainsInNewRSLs():Boolean
+    {
+        return _allowDomainsInNewRSLs;
+    }
+
+    /**
+     *  @private
+     */
+    public function set allowDomainsInNewRSLs(value:Boolean):void
+    {
+        _allowDomainsInNewRSLs = value;
+    }
+
+    //----------------------------------
+    //  allowInsecureDomainsInNewRSLs
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _allowInsecureDomainsInNewRSLs:Boolean = true;
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Flex 4.5
+     */
+    public function get allowInsecureDomainsInNewRSLs():Boolean
+    {
+        return _allowInsecureDomainsInNewRSLs;
+    }
+
+    /**
+     *  @private
+     */
+    public function set allowInsecureDomainsInNewRSLs(value:Boolean):void
+    {
+        _allowInsecureDomainsInNewRSLs = value;
+    }
+
+    //----------------------------------
     //  application
     //----------------------------------


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/framework/src/mx/resources/LocaleSorter.as
+++ frameworks/projects/framework/src/mx/resources/LocaleSorter.as
@@ -242,6 +242,17 @@
 	//
 	//--------------------------------------------------------------------------

+	/**
+     *  @private
+     */
+	private static function appendElements(dest:Array, src:Array):void
+	{
+		for (var i:uint = 0, argc:uint = src.length; i < argc; i++)
+		{
+			dest.push(src[i]);
+		}
+	}
+
 	/**
      *  @private
      */
@@ -459,7 +470,7 @@
                                             lang, script);
 		}
 	}
-
+
 	/**
      *  @private
      */
@@ -467,7 +478,7 @@
     {
 		var stack:Array = [ lang ];

-        Array.prototype.push.apply(stack, extended_langs);
+        appendElements(stack, extended_langs);

         if (script != "")
             stack.push(script);
@@ -475,21 +486,21 @@
         if (region != "")
             stack.push(region);

-        Array.prototype.push.apply(stack, variants);
+        appendElements(stack, variants);

         for (var i:String in extensions)
         {
 			if (extensions.hasOwnProperty(i))
             {
 				stack.push(i);
-				Array.prototype.push.apply(stack, extensions[i]);
+				appendElements(stack, extensions[i]);
 			}
 		}

         if (privates.length > 0)
         {
 			stack.push("x");
-			Array.prototype.push.apply(stack, privates);
+			appendElements(stack, privates);
 		}

 		return stack.join("_");


INPROGRESS - FLEX-33949 Manage OS version in @media CSS implemented for iOS and desktop OS TODO:  Android version from system/build.prop

--- frameworks/projects/framework/src/mx/utils/MediaQueryParser.as
+++ frameworks/projects/framework/src/mx/utils/MediaQueryParser.as
@@ -103,6 +103,7 @@
                 applicationDpi = moduleFactory.info()["applicationDPI"];
         }
         osPlatform = getPlatform();
+        osVersion = getOSVersion(osPlatform);
     }

     /**
@@ -407,7 +408,29 @@
         // expression
         return s.toLowerCase();
     }
-
+
+    /** @private
+     * extract OS version information from os
+     * os is typically a non-numeric string (such as Windows,  iPhone OS, Android, etc...)  followed by a number.
+     * if no number is found, OS version is set to 0.
+     * os on ADL will return the host OS and not the device OS.
+     * That why we need to check for a specific sequence for iOS and Android
+     * */
+    private function getOSVersion(osPlatform: String ):Number {
+
+        //TODO (mamsellem)  retrieve  os version for Android, reading  system/build.prop
+
+        var os: String = Capabilities.os;
+        var osMatch: Array;
+        if (osPlatform == "ios"){
+            osMatch = os.match(/iPhone OS\s([\d\.]+)/);
+        }
+        else {
+            osMatch = os.match(/[A-Za-z\s]+([\d\.]+)/);
+        }
+       return osMatch ? Number(osMatch [1]) : 0.0;
+    }
+
     // the type of the media
     public var type:String = "screen";

@@ -416,6 +439,9 @@

     // the platform of the media
     public var osPlatform:String;
+
+    // the platform os version of the media
+    public var osVersion: Number;

 }


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

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

 package mx.charts
 {


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

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

 package mx.effects
 {