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

--- frameworks/projects/rpc/src/mx/messaging/Channel.as
+++ frameworks/projects/rpc/src/mx/messaging/Channel.as
@@ -0,0 +1,1514 @@
+/*************************************************************************
+ *
+ * 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.EventDispatcher;
+import flash.events.TimerEvent;
+import flash.utils.Timer;
+
+import mx.collections.ArrayCollection;
+import mx.core.IMXMLObject;
+import mx.core.mx_internal;
+import mx.events.PropertyChangeEvent;
+import mx.logging.ILogger;
+import mx.logging.Log;
+import mx.messaging.config.LoaderConfig;
+import mx.messaging.config.ServerConfig;
+import mx.messaging.errors.InvalidDestinationError;
+import mx.messaging.events.ChannelEvent;
+import mx.messaging.events.ChannelFaultEvent;
+import mx.messaging.messages.AbstractMessage;
+import mx.messaging.messages.CommandMessage;
+import mx.messaging.messages.IMessage;
+import mx.resources.IResourceManager;
+import mx.resources.ResourceManager;
+import mx.utils.URLUtil;
+
+use namespace mx_internal;
+
+/**
+ *  Dispatched after the channel has connected to its endpoint.
+ *
+ *  @eventType mx.messaging.events.ChannelEvent.CONNECT
+ */
+[Event(name="channelConnect", type="mx.messaging.events.ChannelEvent")]
+
+/**
+ *  Dispatched after the channel has disconnected from its endpoint.
+ *
+ *  @eventType mx.messaging.events.ChannelEvent.DISCONNECT
+ */
+[Event(name="channelDisconnect", type="mx.messaging.events.ChannelEvent")]
+
+/**
+ *  Dispatched after the channel has faulted.
+ *
+ *  @eventType mx.messaging.events.ChannelFaultEvent.FAULT
+ */
+[Event(name="channelFault", type="mx.messaging.events.ChannelFaultEvent")]
+
+/**
+ *  Dispatched when a channel receives a message from its endpoint.
+ *
+ *  @eventType mx.messaging.events.MessageEvent.MESSAGE
+ */
+[Event(name="message", type="mx.messaging.events.MessageEvent")]
+
+/**
+ *  Dispatched when a property of the channel changes.
+ *
+ *  @eventType mx.events.PropertyChangeEvent.PROPERTY_CHANGE
+ */
+[Event(name="propertyChange", type="mx.events.PropertyChangeEvent")]
+
+[ResourceBundle("messaging")]
+
+/**
+ *  The Channel class is the base message channel class that all channels in the messaging
+ *  system must extend.
+ *
+ *
Channels are specific protocol-based conduits for messages sent between
+ *  MessageAgents and remote destinations.
+ *  Preconfigured channels are obtained within the framework using the
+ *  ServerConfig.getChannel() method.
+ *  You can create a Channel directly using the new operator and
+ *  add it to a ChannelSet directly.

+ *
+ *

+ *  Channels represent a physical connection to a remote endpoint.
+ *  Channels are shared across destinations by default.
+ *  This means that a client targetting different destinations may use
+ *  the same Channel to communicate with these destinations.
+ *

+ *
+ *
Note: This class is for advanced use only.
+ *  Use this class for creating custom channels like the existing RTMPChannel,
+ *  AMFChannel, and HTTPChannel.

+ */
+public class Channel extends EventDispatcher implements IMXMLObject
+{
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  Constructs an instance of a generic Channel that connects to the
+	 *  specified endpoint URI.
+     *
+	 *  Note: The Channel type should not be constructed directly. Instead
+	 *  create instances of protocol specific subclasses such as RTMPChannel or
+	 *  AMFChannel.
+     *
+	 *  @param id The id of this channel.
+	 *
+	 *  @param uri The endpoint URI for this channel.
+	 */
+	public function Channel(id:String = null, uri:String = null)
+	{
+		super();
+
+		_log = Log.getLogger("mx.messaging.Channel");
+		_connecting = false;
+		_failoverIndex = -1;
+	    this.id = id;
+		_primaryURI = uri;
+		_shouldBeConnected = false;
+		this.uri = uri; // Current URI
+
+        // Don't know the authorization state in the beginning.  Assume true
+        // so that a logout can be done at the start.
+        authenticating = false;
+	}
+
+    /**
+     * @private
+     */
+    public function initialized(document:Object, id:String):void
+    {
+        this.id = id;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 *  Used to prevent multiple logouts.
+	 */
+	mx_internal var authenticating:Boolean;
+
+    /**
+     *  @private
+     *  The credentials string that is passed via a CommandMessage to the server when the
+     *  Channel connects. Channels inherit the credentials of connected ChannelSets that
+     *  inherit their credentials from connected MessageAgents.
+     *  MessageAgent.setCredentials(username, password) is generally used
+     *  to set credentials.
+     */
+    protected var credentials:String;
+
+    /**
+     * @private
+     * A channel specific override to determine whether small messages should
+     * be used. If set to false, small messages will not be used even if they
+     * are supported by an endpoint.
+     */
+    public var enableSmallMessages:Boolean = true;
+
+	/**
+	 *  @private
+	 *  Provides access to a logger for this channel.
+	 */
+	protected var _log:ILogger;
+
+    /**
+     *  @private
+     *  Flag indicating whether the Channel is in the process of connecting.
+     */
+    protected var _connecting:Boolean;
+
+    /**
+     *  @private
+     *  Timer to track connect timeouts.
+     */
+    private var _connectTimer:Timer;
+
+	/**
+	 *  @private
+	 *  Current index into failover URIs during a failover attempt.
+	 *  When not failing over, this variable is reset to a sentinal
+	 *  value of -1.
+	 */
+	private var _failoverIndex:int;
+
+    /**
+     * @private
+     * Flag indicating whether the endpoint has been calculated from the uri.
+     */
+    private var _isEndpointCalculated:Boolean = false;
+
+    /**
+     * @private
+     * The messaging version implies which features are enabled on this client
+     * channel. Channel endpoints exchange this information through headers on
+     * the ping CommandMessage exchanged during the connection handshake.
+     */
+    protected var messagingVersion:Number = 1.0;
+
+    /**
+     *  @private
+     *  Flag indicating whether this Channel owns the wait guard for managing initial connect attempts.
+     */
+    private var _ownsWaitGuard:Boolean = false;
+
+	/**
+	 *  @private
+	 *  Primary URI; the initial URI for this channel.
+	 */
+	private var _primaryURI:String
+
+    /**
+     *  @private
+     */
+    private var resourceManager:IResourceManager = ResourceManager.getInstance();
+
+	/**
+	 *  @private
+	 *  Indicates whether this channel should be connected to its endpoint.
+	 *  This flag is used to control when fail over should be attempted.
+	 */
+	private var _shouldBeConnected:Boolean;
+
+
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    //
+    //--------------------------------------------------------------------------
+
+	//----------------------------------
+	//  channelSets
+	//----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _channelSets:Array = [];
+
+    /**
+     *  Provides access to the ChannelSets connected to the Channel.
+     */
+    public function get channelSets():Array
+    {
+        return _channelSets;
+    }
+
+	//----------------------------------
+	//  connected
+	//----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _connected:Boolean = false;
+
+    [Bindable(event="propertyChange")]
+	/**
+	 *  Indicates whether this channel has established a connection to the
+	 *  remote destination.
+	 */
+	public function get connected():Boolean
+	{
+	    return _connected;
+	}
+
+	/**
+	 *  @private
+	 */
+	protected function setConnected(value:Boolean):void
+	{
+	    if (_connected != value)
+	    {
+	        var event:PropertyChangeEvent = PropertyChangeEvent.createUpdateEvent(this, "connected", _connected, value)
+	        _connected = value;
+	        dispatchEvent(event);
+	        if (!value)
+	            setAuthenticated(false);
+        }
+	}
+
+	//----------------------------------
+	//  connectTimeout
+	//----------------------------------
+
+    /**
+	 *  @private
+	 */
+	private var _connectTimeout:int = -1;
+
+	/**
+     *  Provides access to the connect timeout in seconds for the channel.
+     *  A value of 0 or below indicates that a connect attempt will never
+     *  be timed out on the client.
+     *  For channels that are configured to failover, this value is the total
+     *  time to wait for a connection to be established.
+     *  It is not reset for each failover URI that the channel may attempt
+     *  to connect to.
+     */
+    public function get connectTimeout():int
+    {
+        return _connectTimeout;
+    }
+
+	/**
+	 *  @private
+	 */
+	public function set connectTimeout(value:int):void
+	{
+	    _connectTimeout = value;
+    }
+
+	//----------------------------------
+	//  endpoint
+	//----------------------------------
+
+    /**
+     *  @private
+     */
+	private var _endpoint:String;
+
+	/**
+	 *  Provides access to the endpoint for this channel.
+	 *  This value is calculated based on the value of the uri
+	 *  property.
+	 */
+	public function get endpoint():String
+	{
+	    if (!_isEndpointCalculated)
+    	    calculateEndpoint();
+	    return _endpoint;
+	}
+
+	//----------------------------------
+	//  loginAfterDisconnect
+	//----------------------------------
+
+    /**
+     *  @private
+     */
+    protected var _loginAfterDisconnect:Boolean = false;
+
+    mx_internal function get loginAfterDisconnect():Boolean
+    {
+    	return _loginAfterDisconnect;
+    }
+
+	//----------------------------------
+	//  recordMessageTimes
+	//----------------------------------
+
+    /**
+     * @private
+     *
+     * Channel property determines the level of performance information injection - whether
+     * we inject timestamps or not
+     */
+    protected var _recordMessageTimes:Boolean = false;
+
+    public function get recordMessageTimes():Boolean
+    {
+    	return _recordMessageTimes;
+    }
+
+	//----------------------------------
+	//  recordMessageSizes
+	//----------------------------------
+
+    /**
+     * @private
+     *
+     * Channel property determines the level of performance information injection - whether
+     * we inject message sizes or not
+     */
+    protected var _recordMessageSizes:Boolean = false;
+
+    public function get recordMessageSizes():Boolean
+    {
+    	return _recordMessageSizes;
+    }
+
+	//----------------------------------
+	//  reconnecting
+	//----------------------------------
+
+	/**
+	 *  @private
+	 */
+	private var _reconnecting:Boolean = false;
+
+    [Bindable(event="propertyChange")]
+    /**
+     *  Indicates whether this channel is in the process of reconnecting to an
+     *  alternate endpoint.
+     */
+    public function get reconnecting():Boolean
+    {
+        return _reconnecting;
+    }
+
+    private function setReconnecting(value:Boolean):void
+    {
+        if (_reconnecting != value)
+	    {
+	        var event:PropertyChangeEvent = PropertyChangeEvent.createUpdateEvent(this, "reconnecting", _reconnecting, value);
+	        _reconnecting = value;
+	        dispatchEvent(event);
+        }
+    }
+
+	//----------------------------------
+	//  failoverURIs
+	//----------------------------------
+
+	/**
+	 *  @private
+	 */
+	private var _failoverURIs:Array;
+
+	/**
+     *  Provides access to the set of endpoint URIs that this channel can
+	 *  attempt to failover to if the endpoint is clustered.
+     */
+    public function get failoverURIs():Array
+    {
+        return (_failoverURIs != null) ? _failoverURIs : [];
+    }
+
+	/**
+	 *  @private
+	 */
+	public function set failoverURIs(value:Array):void
+	{
+	    if (value != null)
+	    {
+	        _failoverURIs = value;
+	        _failoverIndex = -1; // Reset the index, because URIs have changed
+	    }
+    }
+
+	//----------------------------------
+	//  id
+	//----------------------------------
+
+	/**
+	 *  @private
+	 */
+	private var _id:String;
+
+	/**
+	 *  Provides access to the id of this channel.
+	 */
+	public function get id():String
+	{
+	    return _id;
+	}
+
+	public function set id(value:String):void
+	{
+	    if (_id != value)
+	        _id = value;
+	}
+
+	//----------------------------------
+	//  authenticated
+	//----------------------------------
+
+    private var _authenticated:Boolean = false;
+
+    [Bindable(event="propertyChange")]
+	/**
+	 *  Indicates if this channel is authenticated.
+     */
+	public function get authenticated():Boolean
+	{
+	    return _authenticated;
+	}
+
+	mx_internal function setAuthenticated(value:Boolean):void
+	{
+	    if (value != _authenticated)
+	    {
+	        var event:PropertyChangeEvent = PropertyChangeEvent.createUpdateEvent(this, "authenticated", _authenticated, value);
+	        _authenticated = value;
+
+	        if (!_authenticated)
+	            credentials = null;
+
+	        var cs:ChannelSet;
+	        for (var i:int = 0; i < _channelSets.length; i++)
+	        {
+	            cs = ChannelSet(_channelSets[i]);
+	            cs.mx_internal::setAuthenticated(authenticated, credentials)
+	        }
+
+	        dispatchEvent(event);
+	    }
+	}
+
+	//----------------------------------
+	//  protocol
+	//----------------------------------
+
+    /**
+     *  Provides access to the protocol that the channel uses.
+     *
+     *
Note: Subclasses of Channel must override this method and return
+     *  a string that represents their supported protocol.
+     *  Examples of supported protocol strings are "rtmp", "http" or "https".
+     *

+     */
+    public function get protocol():String
+    {
+        throw new IllegalOperationError("Channel subclasses must override "
+            + "the get function for 'protocol' to return the proper protocol "
+            + "string.");
+    }
+
+	//----------------------------------
+	//  realtime
+	//----------------------------------
+
+    /**
+     *  @private
+     *  Returns true if the channel supports realtime behavior via server push or client poll.
+     */
+    mx_internal function get realtime():Boolean
+    {
+        return false;
+    }
+
+	//----------------------------------
+	//  requestTimeout
+	//----------------------------------
+
+    /**
+	 *  @private
+	 */
+	private var _requestTimeout:int = -1;
+
+	/**
+     *  Provides access to the default request timeout in seconds for the
+     *  channel. A value of 0 or below indicates that outbound requests will
+     *  never be timed out on the client.
+     *
Request timeouts are most useful for RPC style messaging that
+     *  requires a response from the remote destination.

+     */
+    public function get requestTimeout():int
+    {
+        return _requestTimeout;
+    }
+
+	/**
+	 *  @private
+	 */
+	public function set requestTimeout(value:int):void
+	{
+	    _requestTimeout = value;
+    }
+
+	//----------------------------------
+	//  uri
+	//----------------------------------
+
+	/**
+     *  @private
+     */
+	private var _uri:String;
+
+	/**
+	 *  Provides access to the URI used to create the whole endpoint URI for this channel.
+	 *  The URI can be a partial path, in which case the full endpoint URI is computed as necessary.
+	 */
+	public function get uri():String
+	{
+	    return _uri;
+	}
+
+    public function set uri(value:String):void
+    {
+        if (value != null)
+        {
+            _uri = value;
+            calculateEndpoint();
+        }
+    }
+
+	/**
+	 * @private
+	 * This alternate property for an endpoint URL is provided to match the
+	 * endpoint configuration attribute "url". This property is
+	 * equivalent to the uri property.
+	 */
+	public function get url():String
+	{
+	    return uri;
+	}
+
+    /**
+     * @private
+     */
+    public function set url(value:String):void
+    {
+        uri = value;
+    }
+
+	//----------------------------------
+	//  useSmallMessages
+	//----------------------------------
+
+    /**
+     * @private
+     */
+    private var _smallMessagesSupported:Boolean;
+
+    /**
+     * This flag determines whether small messages should be sent if the
+     * alternative is available. This value should only be true if both the
+     * client channel and the server endpoint have successfully advertised that
+     * they support this feature.
+     * @private
+     */
+    public function get useSmallMessages():Boolean
+    {
+        return _smallMessagesSupported && enableSmallMessages;
+    }
+
+    /**
+     * @private
+     */
+    public function set useSmallMessages(value:Boolean):void
+    {
+        _smallMessagesSupported = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Subclasses should override this method to apply any settings that may be
+     *  necessary for an individual channel.
+     *  Make sure to call super.applySettings() to apply common settings for the channel.
+     *
+     *  @param settings XML fragment of the services-config.xml file for this channel.
+     *  The following fragement includes the <channel> tag with
+     *  all of its configuration settings:
+     *

+     *  <channel id="my-amf" type="mx.messaging.channels.AMFChannel">
+     *    <endpoint uri="/dev/messagebroker/amf" type="flex.messaging.endpoints.AmfEndpoint"/>
+     *    <properties>
+     *      <polling-enabled>false</polling-enabled>
+     *    </properties>
+     *  </channel>
+     *

+     */
+	public function applySettings(settings:XML):void
+	{
+	    if (Log.isInfo())
+	        _log.info("'{0}' channel settings are:\n{1}", id, settings);
+	    // Process connect-timeout-seconds property.
+	    if (settings.properties.length())
+        {
+            var props:XML = settings.properties[0];
+            if (props["connect-timeout-seconds"].length())
+                connectTimeout = props["connect-timeout-seconds"].toString();
+           	if (props["record-message-times"].length())
+           		_recordMessageTimes = props["record-message-times"].toString()=="true";
+           	if (props["record-message-sizes"].length())
+           		_recordMessageSizes = props["record-message-sizes"].toString()=="true";
+            var serializationProps:XMLList = props["serialization"];
+           	if (serializationProps.length() > 0)
+           	{
+           	    if (serializationProps["enable-small-messages"].toString()=="false")
+           		    enableSmallMessages = false;
+           	}
+        }
+	}
+
+	/**
+	 *  Connects the ChannelSet to the Channel. If the Channel has not yet
+	 *  connected to its endpoint, it attempts to do so.
+	 *  Channel subclasses must override the internalConnect()
+	 *  method, and call the connectSuccess() method once the
+	 *  underlying connection is established.
+	 *
+	 *  @param channelSet The ChannelSet to connect to the Channel.
+	 */
+	final public function connect(channelSet:ChannelSet):void
+	{
+	    var exists:Boolean = false;
+		var n:int = _channelSets.length;
+		for (var i:int = 0; i < _channelSets.length; i++)
+        {
+            if (_channelSets[i] == channelSet)
+            {
+                exists = true;
+                break;
+            }
+        }
+
+		_shouldBeConnected = true;
+		if (!exists)
+		{
+			_channelSets.push(channelSet);
+			// Wire up ChannelSet's channel event listeners.
+	        addEventListener(ChannelEvent.CONNECT, channelSet.channelConnectHandler);
+	        addEventListener(ChannelEvent.DISCONNECT, channelSet.channelDisconnectHandler);
+	        addEventListener(ChannelFaultEvent.FAULT, channelSet.channelFaultHandler);
+        }
+        // If we are already connected, notify the ChannelSet. Otherwise connect
+        // if necessary.
+        if (connected)
+        {
+            channelSet.channelConnectHandler(ChannelEvent.createEvent(ChannelEvent.CONNECT, this, false, false, connected));
+        }
+        else if (!_connecting)
+        {
+            _connecting = true;
+
+            // If a connect timeout is defined, start the corresponding timer.
+            if (connectTimeout > 0)
+            {
+                _connectTimer = new Timer(connectTimeout * 1000, 1);
+                _connectTimer.addEventListener(TimerEvent.TIMER, connectTimeoutHandler);
+                _connectTimer.start();
+            }
+
+            // We have to prevent a race between multipe Channel instances attempting to connect concurrently
+            // at application startup. We detect this situation by testing whether the FlexClient Id has been assigned or not.
+            if (FlexClient.getInstance().id == null)
+            {
+                var flexClient:FlexClient = FlexClient.getInstance();
+                if (!flexClient.waitForFlexClientId)
+                {
+                    flexClient.waitForFlexClientId = true;
+                    // This will cause other Channels to wait to attempt to connect.
+                    // This Channel can continue its attempt.
+                    _ownsWaitGuard = true;
+                    internalConnect();
+                }
+                else
+                {
+                    // This Channel should wait to attempt to connect.
+                    flexClient.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, flexClientWaitHandler);
+                }
+            }
+            else
+            {
+                // Another Channel has connected and we have an assigned FlexClient Id.
+                internalConnect();
+            }
+        }
+	}
+
+	/**
+	 *  Disconnects the ChannelSet from the Channel. If the Channel is connected
+	 *  to its endpoint and it has no more connected ChannelSets it will
+	 *  internally disconnect.
+	 *
+	 *
Channel subclasses need to override the
+	 *  internalDisconnect() method, and call the
+	 *  disconnectSuccess() method when the underlying connection
+	 *  has been terminated.

+	 *
+	 *  @param channelSet The ChannelSet to disconnect from the Channel.
+	 */
+	final public function disconnect(channelSet:ChannelSet):void
+	{
+	    // If we own the wait guard for initial Channel connects release it.
+	    // This will only be true if this Channel is the first to attempt to connect
+	    // but its connect attempt is still pending when disconnect() is invoked.
+	    if (_ownsWaitGuard)
+	    {
+	        _ownsWaitGuard = false;
+	        FlexClient.getInstance().waitForFlexClientId = false; // Allow other Channels to connect.
+	    }
+
+	    // Disconnect the channelSet.
+	    var i:int = channelSet != null ? _channelSets.indexOf(channelSet) : -1;
+        if (i != -1)
+        {
+            _channelSets.splice(i, 1);
+            // Remove the ChannelSet as a listener to this Channel.
+            removeEventListener(ChannelEvent.CONNECT, channelSet.channelConnectHandler, false);
+            removeEventListener(ChannelEvent.DISCONNECT, channelSet.channelDisconnectHandler, false);
+            removeEventListener(ChannelFaultEvent.FAULT, channelSet.channelFaultHandler, false);
+
+            // Notify the ChannelSet of the disconnect.
+            if (connected)
+            {
+                channelSet.channelDisconnectHandler(ChannelEvent.createEvent(ChannelEvent.DISCONNECT, this, false));
+            }
+
+    	    // Shut down the underlying connection if this Channel has no more
+    	    // ChannelSets using it.
+            if (_channelSets.length == 0)
+            {
+                _shouldBeConnected = false;
+                if (connected)
+                    internalDisconnect();
+            }
+        }
+	}
+
+	/**
+	 *  Sends a CommandMessage to the server to logout if the Channel is connected.
+	 *  Current credentials are cleared.
+	 *
+	 *  @param agent The MessageAgent to logout.
+	 */
+	public function logout(agent:MessageAgent):void
+    {
+        if ((connected && authenticated && credentials) || (authenticating && credentials))
+        {
+            var msg:CommandMessage = new CommandMessage();
+            msg.operation = CommandMessage.LOGOUT_OPERATION;
+            internalSend(new AuthenticationMessageResponder(agent, msg, this, _log));
+            authenticating = true;
+        }
+        credentials = null;
+    }
+
+	/**
+	 *  Sends the specified message to its target destination.
+	 *  Subclasses must override the internalSend() method to
+	 *  perform the actual send.
+     *
+	 *  @param agent The MessageAgent that is sending the message.
+	 *
+	 *  @param message The Message to send.
+	 *
+	 *  @throws mx.messaging.errors.InvalidDestinationError If neither the MessageAgent nor the
+	 *                                  message specify a destination.
+	 */
+	public function send(agent:MessageAgent, message:IMessage):void
+	{
+        // Set the destination header of the message if it is not already set.
+        if (message.destination.length == 0)
+        {
+            if (agent.destination.length == 0)
+			{
+				var msg:String = resourceManager.getString(
+					"messaging", "noDestinationSpecified");
+                throw new InvalidDestinationError(msg);
+			}
+            message.destination = agent.destination;
+        }
+
+        if (Log.isDebug())
+            _log.debug("'{0}' channel sending message:\n{1}", id, message.toString());
+
+        // Tag the message with a header indicating the Channel/Endpoint used for transport.
+        message.headers[AbstractMessage.ENDPOINT_HEADER] = id;
+
+        var responder:MessageResponder = getMessageResponder(agent, message);
+        initializeRequestTimeout(responder);
+        internalSend(responder);
+	}
+
+	/**
+	 *  Sets the credentials to the specified value.
+	 *  If the credentials are non-null and the Channel is connected, this method also
+	 *  sends a CommandMessage to the server to login using the credentials.
+	 *
+	 *  @param credentials The credentials string.
+	 *  @param agent The MessageAgent to login, that will handle the login result.
+     *  @param charset The character set encoding used while encoding the
+     *  credentials. The default is null, which implies the legacy charset of
+     *  ISO-Latin-1.
+	 *
+	 *  @throws flash.errors.IllegalOperationError in two situations; if credentials
+	 *  have already been set and an authentication is in progress with the remote
+	 *  detination, or if authenticated and the credentials specified don't match
+	 *  the currently authenticated credentials.
+	 */
+	public function setCredentials(credentials:String, agent:MessageAgent=null, charset:String=null):void
+	{
+	    var changedCreds:Boolean = this.credentials !== credentials;
+
+	    if (authenticating && changedCreds)
+	        throw new IllegalOperationError("Credentials cannot be set while authenticating or logging out.");
+
+	    if (authenticated && changedCreds)
+	        throw new IllegalOperationError("Credentials cannot be set when already authenticated. Logout must be performed before changing credentials.");
+
+	    this.credentials = credentials;
+	    if (connected && changedCreds && credentials != null)
+	    {
+            authenticating = true;
+	        var msg:CommandMessage = new CommandMessage();
+	        msg.operation = CommandMessage.LOGIN_OPERATION;
+	        msg.body = credentials;
+	        if (charset != null)
+	            msg.headers[CommandMessage.CREDENTIALS_CHARSET_HEADER] = charset;
+    	    internalSend(new AuthenticationMessageResponder(agent, msg, this, _log));
+	    }
+	}
+
+    /**
+     * @private
+     * Should we record any performance metrics
+     */
+    public function get mpiEnabled():Boolean
+    {
+    	return _recordMessageSizes || _recordMessageTimes;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Internal Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Internal hook for ChannelSet to assign credentials when it has authenticated
+     *  successfully via a direct login(...) call to the server.
+     */
+    mx_internal function internalSetCredentials(credentials:String):void
+    {
+        this.credentials = credentials;
+    }
+
+    /**
+     *  @private
+     *  This is a hook for ChannelSet (not a MessageAgent) to send requests for
+     *  clustered endpoints for a clustered destination and provide its own
+     *  custom responder, rather than relying on the generic responders used by
+     *  Channel implemenations.
+     *
+     *  @param msgResp The message responder to use for the cluster request response.
+     */
+	mx_internal function sendClusterRequest(msgResp:MessageResponder):void
+	{
+	    internalSend(msgResp);
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    // Protected Methods
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  Processes a failed internal connect and dispatches the
+	 *  FAULT event for the channel.
+	 *  If the Channel has failoverURI values, it will
+	 *  attempt to reconnect automatically by trying these URI values in order until
+	 *  a connection is established or the available values are exhausted.
+	 *
+	 *  @param event The ChannelFaultEvent for the failed connect.
+	 */
+	protected function connectFailed(event:ChannelFaultEvent):void
+	{
+	    shutdownConnectTimer();
+	    setConnected(false);
+
+	    if (Log.isError())
+            _log.error("'{0}' channel connect failed.", id);
+
+        if (!event.rejected && shouldAttemptFailover())
+        {
+            _connecting = true;
+	        failover();
+        }
+        else // Not attempting failover.
+        {
+    	    // If we own the wait guard for initial Channel connects release it.
+    	    if (_ownsWaitGuard)
+    	    {
+    	        _ownsWaitGuard = false;
+    	        FlexClient.getInstance().waitForFlexClientId = false; // Allow other Channels to connect.
+    	    }
+
+            _connecting = false;
+        }
+
+        if (reconnecting)
+            event.reconnecting = true;
+        dispatchEvent(event);
+	}
+
+	/**
+	 *  Processes a successful internal connect and dispatches the
+	 *  CONNECT event for the Channel.
+	 */
+	protected function connectSuccess():void
+	{
+	    // If we own the wait guard for initial Channel connects release it.
+	    if (_ownsWaitGuard)
+	    {
+	        _ownsWaitGuard = false;
+	        FlexClient.getInstance().waitForFlexClientId = false; // Allow other Channels to connect.
+	    }
+
+	    shutdownConnectTimer();
+	    _connecting = false;
+
+        // if there were any attached agents that needed configuration they
+        // should be reset
+        if (ServerConfig.fetchedConfig(endpoint))
+        {
+    		for (var i:int = 0; i < channelSets.length; i++)
+            {
+                var messageAgents:Array = ChannelSet(channelSets[i]).messageAgents;
+                for (var j:int = 0; j < messageAgents.length; j++)
+				{
+                    messageAgents[j].needsConfig = false;
+				}
+            }
+        }
+
+	    setConnected(true);
+	    _failoverIndex = -1;
+
+	    if (Log.isInfo())
+	        _log.info("'{0}' channel is connected.", id);
+
+	    dispatchEvent(ChannelEvent.createEvent(ChannelEvent.CONNECT, this, reconnecting));
+
+        setReconnecting(false);
+	}
+
+	/**
+	 *  Handles a connect timeout by dispatching a ChannelFaultEvent.
+	 *  Subtypes may overide this to shutdown the current connect attempt but must
+	 *  call super.connectTimeoutHandler(event).
+	 *
+	 *  @param event The timer event indicating that the connect timeout has been reached.
+	 */
+	protected function connectTimeoutHandler(event:TimerEvent):void
+	{
+	    shutdownConnectTimer();
+	    if (!connected)
+	    {
+    	    _shouldBeConnected = false;
+    	    var errorText:String = resourceManager.getString(
+				"messaging", "connectTimedOut");
+    	    var faultEvent:ChannelFaultEvent = ChannelFaultEvent.createEvent(this, false, "Channel.Connect.Failed", "error", errorText);
+    	    connectFailed(faultEvent);
+    	}
+	}
+
+	/**
+	 *  Processes a successful internal disconnect and dispatches the
+	 *  DISCONNECT event for the Channel.
+	 *  If the disconnect is due to a network failure and the Channel has
+	 *  failoverURI values, it will attempt to reconnect automatically
+	 *  by trying these URI values in order until a connection is established or the
+	 *  available values are exhausted.
+	 *
+	 *  @param rejected True if the disconnect should skip any
+	 *         failover processing that would otherwise be attempted; false
+	 *         if failover processing should be allowed to run.
+	 */
+	protected function disconnectSuccess(rejected:Boolean = false):void
+	{
+	    setConnected(false);
+
+        if (Log.isInfo())
+		    _log.info("'{0}' channel disconnected.", id);
+
+		if (!rejected && shouldAttemptFailover())
+		{
+		    _connecting = true;
+	        failover();
+	    }
+	    else
+	    {
+	        _connecting = false;
+	    }
+
+		dispatchEvent(ChannelEvent.createEvent(ChannelEvent.DISCONNECT, this,
+		                                    reconnecting, rejected));
+	}
+
+	/**
+	 *  Processes a failed internal disconnect and dispatches the
+	 *  FAULT event for the channel.
+	 *
+	 *  @param event The ChannelFaultEvent for the failed disconnect.
+	 */
+	protected function disconnectFailed(event:ChannelFaultEvent):void
+	{
+	    _connecting = false;
+	    setConnected(false);
+
+	    if (Log.isError())
+	        _log.error("'{0}' channel disconnect failed.", id);
+
+	    if (reconnecting)
+	    {
+	        resetToPrimaryURI();
+	        event.reconnecting = false;
+	    }
+	    dispatchEvent(event);
+	}
+
+	/**
+	 *  Handles a change to the guard condition for managing initial Channel connect for the application.
+	 *  When this is invoked it means that this Channel is waiting to attempt to connect.
+	 *
+	 *  @param event The PropertyChangeEvent dispatched by the FlexClient singleton.
+	 */
+	protected function flexClientWaitHandler(event:PropertyChangeEvent):void
+	{
+	    if (event.property == "waitForFlexClientId")
+	    {
+	        var flexClient:FlexClient = event.source as FlexClient;
+	        if (flexClient.waitForFlexClientId == false) // The wait is over, claim it and attempt to connect.
+	        {
+	            flexClient.removeEventListener(PropertyChangeEvent.PROPERTY_CHANGE, flexClientWaitHandler);
+	            flexClient.waitForFlexClientId = true;
+	            // This will cause other Channels to wait to attempt to connect.
+                // This Channel can continue its attempt.
+                _ownsWaitGuard = true;
+	            internalConnect();
+	        }
+	    }
+	}
+
+    /**
+     *  Returns the appropriate MessageResponder for the Channel's
+     *  send() method.
+     *  Must be overridden.
+     *
+     *  @param agent The MessageAgent sending the message.
+     *
+     *  @param message The Message to send.
+     *
+     *  @return The MessageResponder to handle the result or fault.
+     *
+     *  @throws flash.errors.IllegalOperationError If the Channel subclass does not override
+     *                                this method.
+     */
+    protected function getMessageResponder(agent:MessageAgent,
+                                            message:IMessage):MessageResponder
+    {
+        throw new IllegalOperationError("Channel subclasses must override "
+                                                + " getMessageResponder().");
+    }
+
+    /**
+     *  Connects the Channel to its endpoint.
+     *  Must be overridden.
+     */
+    protected function internalConnect():void {}
+
+    /**
+     *  Disconnects the Channel from its endpoint.
+     *  Must be overridden.
+     *
+     *  @param rejected True if the disconnect was due to a connection rejection or timeout
+     * 					and reconnection should not be attempted automatically; otherwise false.
+     */
+    protected function internalDisconnect(rejected:Boolean = false):void {}
+
+    /**
+     *  Sends the Message out over the Channel and routes the response to the
+     *  responder.
+     *  Must be overridden.
+     *
+     *  @param messageResponder The MessageResponder to handle the response.
+     */
+    protected function internalSend(messageResponder:MessageResponder):void {}
+
+    /**
+     * @private
+     * Utility method to examine the reported server messaging version and
+     * thus determine which features are available.
+     */
+    protected function handleServerMessagingVersion(version:Number):void
+    {
+        useSmallMessages = version >= messagingVersion;
+    }
+
+    /**
+     *  @private
+     *  Utility method used to assign the FlexClient Id value to outbound messages.
+     *
+     *  @param message The message to set the FlexClient Id on.
+     */
+    protected function setFlexClientIdOnMessage(message:IMessage):void
+    {
+        var id:String = FlexClient.getInstance().id;
+        message.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER] = (id != null) ? id : FlexClient.NULL_FLEXCLIENT_ID;
+    }
+
+
+    //--------------------------------------------------------------------------
+    //
+    // Private Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  This method calculates the endpoint value based on the current
+     *  uri.
+     */
+    private function calculateEndpoint():void
+    {
+        var uriCopy:String = uri;
+        var proto:String = URLUtil.getProtocol(uriCopy);
+
+        if (proto.length == 0)
+            uriCopy = URLUtil.getFullURL(LoaderConfig.url, uriCopy);
+
+        if (!URLUtil.hasUnresolvableTokens())
+        {
+            _isEndpointCalculated = false;
+            return;
+        }
+
+        uriCopy = URLUtil.replaceTokens(uriCopy);
+
+        // Now, check for a final protocol after relative URLs and tokens
+        // have been replaced
+        proto = URLUtil.getProtocol(uriCopy);
+
+        if (proto.length > 0)
+            _endpoint = URLUtil.replaceProtocol(uriCopy, protocol);
+        else
+            _endpoint = protocol + ":" + uriCopy;
+
+        _isEndpointCalculated = true;
+
+        if (Log.isInfo())
+            _log.info("'{0}' channel endpoint set to {1}", id, _endpoint);
+    }
+
+    /**
+     *  @private
+     *  Initializes the request timeout for this message if the outbound message
+     *  defines a REQUEST_TIMEOUT_HEADER value.
+     *  If this header is not set and the default requestTimeout for the
+     *  channel is greater than 0, the channel default is used.
+     *  Otherwise, no request timeout is enforced on the client.
+     *
+     *  @param messageResponder The MessageResponder to handle the response and monitor the outbound
+     *                          request for a timeout.
+     */
+    private function initializeRequestTimeout(messageResponder:MessageResponder):void
+    {
+        var message:IMessage = messageResponder.message;
+        // Turn on request timeout machinery if the message defines it.
+        if (message.headers[AbstractMessage.REQUEST_TIMEOUT_HEADER] != null)
+        {
+            messageResponder.startRequestTimeout(message.headers[AbstractMessage.REQUEST_TIMEOUT_HEADER]);
+        }
+        else if (requestTimeout > 0) // Use the channel default.
+        {
+            messageResponder.startRequestTimeout(requestTimeout);
+        }
+    }
+
+    /**
+     *  @private
+     *  Convenience method to test whether the Channel should attempt to
+     *  failover.
+     *
+     *  @return true if the Channel should try to failover;
+     *          otherwise false.
+     */
+    private function shouldAttemptFailover():Boolean
+    {
+        return (_shouldBeConnected && (_failoverURIs != null) &&
+	                (_failoverURIs.length > 0));
+    }
+
+    /**
+     *  @private
+     *  This method attempts to fail the Channel over to the next available URI.
+     */
+    private function failover():void
+    {
+        ++_failoverIndex;
+        if ((_failoverIndex + 1) <= failoverURIs.length)
+        {
+	        setReconnecting(true);
+            uri = failoverURIs[_failoverIndex];
+
+            if (Log.isInfo())
+            {
+		        _log.info("'{0}' channel attempting to connect to {1}.", id, endpoint);
+            }
+            // NetConnection based channels may have their underlying resources
+            // GC'ed at the end of the execution of the handler that has
+            // invoked this method, which means that the results of a call to
+            // internalConnect() for these channels may magically vanish once
+            // the handler exits.
+            // A timer introduces a slight delay in the reconnect attempt to
+            // give the handler time to finish executing, at which point the
+            // internals of a NetConnection channel will be stable and we can
+            // attempt to connect successfully.
+            // This timer is applied to all channels but the impact is small
+            // enough and the failover scenario rare enough that special casing
+            // this for only NetConnection channels is more trouble than it's
+            // worth.
+            var timer:Timer = new Timer(1, 1);
+            timer.addEventListener(TimerEvent.TIMER, reconnect);
+            timer.start();
+        }
+        else
+        {
+            if (Log.isInfo())
+            {
+		        _log.info("'{0}' channel has exhausted failover options and has reset to its primary endpoint.", id);
+		    }
+            // Nothing left to failover to; reset to primary.
+            resetToPrimaryURI();
+        }
+    }
+
+    /**
+     *  @private
+     *  This method is invoked by a timer from failover() and it works around a
+     *  reconnect issue with NetConnection based channels by invoking
+     *  internalConnect() after a slight delay.
+     */
+    private function reconnect(event:TimerEvent):void
+    {
+        internalConnect();
+    }
+
+    /**
+     *  @private
+     *  This method resets the channel back to its primary URI after
+     *  exhausting all failover URIs.
+     */
+    private function resetToPrimaryURI():void
+    {
+        _connecting = false;
+        setReconnecting(false);
+        uri = _primaryURI;
+        _failoverIndex = -1;
+    }
+
+    /**
+     *  @private
+     *  Shuts down and nulls out the connect timer.
+     */
+    private function shutdownConnectTimer():void
+    {
+        if (_connectTimer != null)
+        {
+            _connectTimer.stop();
+    	    _connectTimer = null;
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Static Constants
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @private
+     */
+    public static const SMALL_MESSAGES_FEATURE:String = "small_messages";
+
+    /**
+     *  @private
+     *  Creates a compile time dependency on ArrayCollection to ensure
+     *  it is present for response data containing collections.
+     */
+    private static const dep:ArrayCollection = null;
+}
+
+}
+
+//------------------------------------------------------------------------------
+//
+// Private Classes
+//
+//------------------------------------------------------------------------------
+
+import mx.core.mx_internal;
+import mx.logging.ILogger;
+import mx.logging.Log;
+import mx.messaging.Channel;
+import mx.messaging.MessageAgent;
+import mx.messaging.MessageResponder;
+import mx.messaging.events.ChannelEvent;
+import mx.messaging.events.ChannelFaultEvent;
+import mx.messaging.messages.CommandMessage;
+import mx.messaging.messages.ErrorMessage;
+import mx.messaging.messages.IMessage;
+import mx.events.PropertyChangeEvent;
+
+/**
+ *  @private
+ *  Responder for processing channel authentication responses.
+ */
+class AuthenticationMessageResponder extends MessageResponder
+{
+	//--------------------------------------------------------------------------
+	//
+	// Constructor
+	//
+	//--------------------------------------------------------------------------
+
+    public function AuthenticationMessageResponder(agent:MessageAgent,
+                                message:IMessage, channel:Channel, log:ILogger)
+    {
+	    super(agent, message, channel);
+	    _log = log;
+    }
+
+	//--------------------------------------------------------------------------
+	//
+	// Variables
+	//
+	//--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Reference to the logger for the associated Channel.
+     */
+    private var _log:ILogger;
+
+    //--------------------------------------------------------------------------
+    //
+    // Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Handles an authentication result.
+     *
+     *  @param msg The result Message.
+     */
+    override protected function resultHandler(msg:IMessage):void
+    {
+        var cmd:CommandMessage = message as CommandMessage;
+        channel.mx_internal::authenticating = false;
+        if (cmd.operation == CommandMessage.LOGIN_OPERATION)
+        {
+            if (Log.isDebug())
+                _log.debug("Login successful");
+
+            // we want to set the authenticated property last as it will dispatch
+            // an event in this case and handler code shouldn't get called
+            // util the system is stable.
+            channel.mx_internal::setAuthenticated(true);
+        }
+        else // Logout operation.
+        {
+            if (Log.isDebug())
+                _log.debug("Logout successful");
+
+            channel.mx_internal::setAuthenticated(false);
+        }
+    }
+
+    /**
+     *  Handles an authentication failure.
+     *
+     *  @param msg The failure Message.
+     */
+    override protected function statusHandler(msg:IMessage):void
+    {
+        var cmd:CommandMessage = CommandMessage(message);
+
+        if (Log.isDebug())
+        {
+            _log.debug("{1} failure: {0}", msg.toString(),
+                        cmd.operation == CommandMessage.LOGIN_OPERATION ? "Login" : "Logout");
+        }
+
+        channel.mx_internal::authenticating = false;
+        channel.mx_internal::setAuthenticated(false);
+
+        if (agent != null && agent.hasPendingRequestForMessage(message))
+        {
+            agent.fault(ErrorMessage(msg), message);
+        }
+        else
+        {
+            var errMsg:ErrorMessage = ErrorMessage(msg);
+            var channelFault:ChannelFaultEvent =
+                                        ChannelFaultEvent.createEvent(channel, false,
+                                        "Channel.Authentication.Error", "warn",
+                                        errMsg.faultString);
+            channelFault.rootCause = errMsg;
+            channel.dispatchEvent(channelFault);
+        }
+    }
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 6215
Author:   smgilson@adobe.com
Date:     2009-04-23T17:12:57.259499Z

Log Message:
-----------
ASDoc updates for effect classes

Checkintests: passed

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/RemoveAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/SimpleMotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Rotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Fade.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Resize.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/KeyFrame.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Wipe.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/WipeDirection.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Move.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/CallAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/CrossFade.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransform.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateShaderTransition.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/MotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/SetAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate.as</path>

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

--- frameworks/projects/spark/src/spark/effects/Fade.as
+++ frameworks/projects/spark/src/spark/effects/Fade.as
@@ -16,6 +16,23 @@
 import mx.effects.IEffectInstance;

 /**
+ *  The Fade effect animates the alpha property of a component.
+ *
+ *  @mxml
+ *
+ *
The <mx:Fade> tag
+ *  inherits the tag attributes of its superclass,
+ *  and adds the following tag attributes:

+ *
+ *

+ *  <mx:Fade
+ *    id="ID"
+ *    alphaFrom="val"
+ *    alphaTo="val"
+ *  />
+ *

+ *
+ *  @see spark.effects.supportClasses.FadeInstance
  *
  *  @includeExample examples/FadeEffectExample.mxml
  *
@@ -26,6 +43,16 @@
  */
 public class Fade extends Animate
 {
+   /**
+    *  Constructor.
+    *
+    *  @param target The Object to animate with this effect.
+    *
+    *  @langversion 3.0
+    *  @playerversion Flash 10
+    *  @playerversion AIR 1.5
+    *  @productversion Flex 4
+    */
     public function Fade(target:Object=null)
     {
         super(target);
@@ -45,7 +72,7 @@
     [Inspectable(category="General", defaultValue="undefined")]

     /**
-     *  Initial transparency level between 0.0 and 1.0,
+     *  Initial value of the alpha property, between 0.0 and 1.0,
      *  where 0.0 means transparent and 1.0 means fully opaque.
      *
      *
If the effect causes the target component to disappear,
@@ -68,7 +95,7 @@
     [Inspectable(category="General", defaultValue="NaN")]

     /**
-     *  Final transparency level,
+     *  Final value of the alpha property, between 0.0 and 1.0,
      *  where 0.0 means transparent and 1.0 means fully opaque.
      *
      *
If the effect causes the target component to disappear,
@@ -111,6 +138,9 @@
         return ["alpha", "visible", "parent"];
     }

+    /**
+     *  @private
+     */
     override protected function applyValueToTarget(target:Object,
                                                    property:String,
                                                    value:*,


gateway password change

gateway password change

--- src/tiramisu.as
+++ src/tiramisu.as
@@ -366,7 +366,7 @@
     if ((sconf.data.password != '') && (config.server.@services == 'true')) {
         swrite('PASS '+sconf.data.password);
     } else if (config.server.@gateway == 'true') {
-        swrite('PASS mehasadragon');
+        swrite('PASS gatewaypassword');
     }
     mynick = sconf.data.nickname;
     swrite('NICK '+mynick);


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

--- frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkApplicationAutomationImpl.as
+++ frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkApplicationAutomationImpl.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  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.
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////


Transferred from the Adobe Open Source Subversion Repository

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

--- frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkGroupBaseAutomationImpl.as
+++ frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkGroupBaseAutomationImpl.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  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.
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////


npc greetings now load correctly

npc greetings now load correctly

--- flexEditor/src/org/arisgames/editor/util/AppUtils.as
+++ flexEditor/src/org/arisgames/editor/util/AppUtils.as
@@ -313,7 +313,7 @@
             npc.npcId = data.npc_id;
             npc.name = data.name;
             npc.description = data.description;
-            npc.greeting = data.greeting;
+            npc.greeting = data.text;
             npc.mediaId = data.media_id;

             return npc;


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

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

 package mx.core
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 12850
Author:   jimurphy@adobe.com
Date:     2009-12-11T14:57:14.623098Z

Log Message:
-----------
add 6 new DMV projects to the SDK:
automation
automation_air
automation_dmv
automation_flashflexkit
automation_spark
datavisualization

These projects are setup to build in an ant main call.  There are currently several warnings in the datavisualization project that will be cleaned up.  No checkintests exist for these projects as of yet.

I also modified the exisitng projects build files for easier management of the localization targets, bundle and fat-swc. If the projects that I updated:airframework,airspark,framework,playerglobal,rpc,and spark.  All the new projects have been implemented this same way.

QE notes: DMV folks should run through their tests
Doc notes: probably
Bugs: nope
Reviewer:
Tests run: ran the following targets: compile,checkintests,other.locales and doc
Is noteworthy for integration: no

Modified Paths:
--------------
1404 paths were modified

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

--- frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkToggleButtonBaseAutomationImpl.as
+++ frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkToggleButtonBaseAutomationImpl.as
@@ -0,0 +1,66 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+	import flash.display.DisplayObject;
+
+	import mx.automation.Automation;
+	import mx.core.mx_internal;
+
+	import spark.components.supportClasses.ToggleButtonBase;
+
+	use namespace mx_internal;
+
+	[Mixin]
+	/**
+	 *
+	 *  Defines methods and properties required to perform instrumentation for the
+	 *  ToggleButtonBase control.
+	 *
+	 *  @see spark.components.supportClasses.ToggleButtonBase
+	 *
+	 */
+	public class SparkToggleButtonBaseAutomationImpl extends SparkButtonBaseAutomationImpl
+	{
+
+		include "../../../../core/Version.as";
+
+		//--------------------------------------------------------------------------
+		//
+		//  Class methods
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Registers the delegate class for a component class with automation manager.
+		 *
+		 *  @param root The SystemManger of the application.
+		 */
+		public static function init(root:DisplayObject):void
+		{
+			Automation.registerDelegateClass(spark.components.supportClasses.ToggleButtonBase, SparkToggleButtonBaseAutomationImpl);
+		}
+
+		/**
+		 *  Constructor.
+		 * @param obj ToggleButtonBase object to be automated.
+		 */
+		public function SparkToggleButtonBaseAutomationImpl(obj:spark.components.supportClasses.ToggleButtonBase)
+		{
+			super(obj);
+
+		}
+
+
+	}
+
+}


added documentation

added documentation

--- WeaveData/src/weave/data/CSVParser.as
+++ WeaveData/src/weave/data/CSVParser.as
@@ -27,7 +27,6 @@
 	import weave.api.data.ICSVParser;
 	import weave.api.getCallbackCollection;
 	import weave.utils.AsyncSort;
-	import weave.utils.createCSV;

 	/**
 	 * Parses and generates CSV-encoded data.
@@ -94,6 +93,9 @@

 		private function parseIterate(stopTime:int):Number
 		{
+			// This isn't actually asynchronous at the moment, but moving the code to
+			// FlasCC made it so much faster that it won't matter most of the time.
+			// The async code structure is kept in case we want to make it asynchronous again in the future.
 			weave.utils.parseCSV(csvData, delimiter, quote, removeBlankLines, parseTokens, csvDataArray);
 			csvData = null;
 			return 1;


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

--- frameworks/projects/mx/src/mx/effects/effectClasses/AddItemActionInstance.as
+++ frameworks/projects/mx/src/mx/effects/effectClasses/AddItemActionInstance.as
@@ -24,6 +24,11 @@
  *  effect; you do not create one yourself.
  *
  *  @see mx.effects.AddItemAction
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class AddItemActionInstance extends ActionEffectInstance
 {
@@ -39,6 +44,11 @@
      *  Constructor.
      *
      *  @param target The Object to animate with this effect.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function AddItemActionInstance(target:Object)
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 12978
Author:   chaase@adobe.com
Date:     2009-12-16T01:12:29.887362Z

Log Message:
-----------
Fix for possible null deref in Effect.captureMoreStartValues(). Seems unlikely to ever occur since the function is not really there for random calling outside of data effects, but the fix was simple.

QE notes: none
Doc notes: none
Bugs: sdk-16451
Reviewer: Jason
Tests run: checkintests, Mustella mx/effects, mx/ListDataEffects
Is noteworthy for integration: no

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.as

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

--- frameworks/projects/framework/src/mx/effects/Effect.as
+++ frameworks/projects/framework/src/mx/effects/Effect.as
@@ -1387,8 +1387,9 @@
             // make temporary PropertyChangesArray
             var additionalPropertyChangesArray:Array = captureValues(null, true);

-            propertyChangesArray =
-                propertyChangesArray.concat(additionalPropertyChangesArray);
+            propertyChangesArray = (propertyChangesArray != null) ?
+                propertyChangesArray.concat(additionalPropertyChangesArray) :
+                additionalPropertyChangesArray;
         }
     }


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

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

 package mx.effects
 {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

--- frameworks/projects/spark/src/spark/components/List.as
+++ frameworks/projects/spark/src/spark/components/List.as
@@ -9,20 +9,21 @@
 //
 ////////////////////////////////////////////////////////////////////////////////

-package flex.component
+package mx.components
 {
 import flash.display.DisplayObject;
 import flash.events.MouseEvent;

-import flex.events.ItemExistenceChangedEvent;
-import flex.skin.DefaultItemRenderer;
+import mx.events.ItemExistenceChangedEvent;
+import mx.skins.spark.FxDefaultItemRenderer;

 import mx.core.ClassFactory;
+import mx.components.baseClasses.FxSelector;

 /**
  *  The List class.
  */
-public class List extends Selector
+public class FxList extends FxSelector
 {
     include "../core/Version.as";

@@ -41,10 +42,10 @@
     /**
      *  Constructor.
      */
-    public function List()
+    public function FxList()
     {
         super();
-        itemRenderer = new ClassFactory(DefaultItemRenderer);
+        itemRenderer = new ClassFactory(FxDefaultItemRenderer);
     }

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 5220
Author:   chaase@adobe.com
Date:     2009-03-10T15:55:06.496289Z

Log Message:
-----------
New Transform effects to handle correctly doing Move, Rotate, and Scale operations simultaneously. Also, added keyframe capabilities to new effects system (necessary for the transform effects, shouldn't affect operation of other effects). Fixed various issues with effects/transition infrastructure as necessary. Added transform utility functions to UIComponent, AdvancedLayoutFeatures, and GraphicElement.

QE Notes: This will break existing new effects tests due to changes in core Animation and AnimationEvent classes, QE is disabling them for now and will add them back in as changes are made.
Doc Notes: None
Bugs:
Reviewer: Ely (transform utilities) and Jason (the rest)
tests: checkintests, Mustella tests/Effects, tests/ListDataEffects

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/TransformOffsets.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/CompositeEffect.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/KeyFrame.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimate3DInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/PropertyChanges.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimate3D.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/effectClasses</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateColorInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimate.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxRotate3DInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxRotate3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxRotateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/baseClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxMoveInstance.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/effectClasses/AnimateTransformInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/events/AnimationEvent.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransform.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate3D.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/MotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/Animation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/AnimationProperty.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove3D.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/AdvancedLayoutFeatures.as</path>

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

--- frameworks/projects/spark/src/spark/effects/Scale3D.as
+++ frameworks/projects/spark/src/spark/effects/Scale3D.as
@@ -0,0 +1,97 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.effects
+{
+import mx.effects.IEffectInstance;
+
+import spark.effects.effectClasses.AnimateTransformInstance;
+
+/**
+ * This class is a utility wrapper around the AnimateTransform effect, exposing the
+ * properties that make sense for someone wishing to merely scale a target object
+ * in 3D around some transform center.
+ *
+ *
Like all AnimateTransform-based effects, this effect will only work on subclasses
+ * of UIComponent and GraphicElement, as these effects depend on specific
+ * transform functions in those classes. Also, all of these effects run one single
+ * effect instance on any given target at a time, which means that they will
+ * share the transform center set by any of the contributing effects.

+ */
+public class AnimateTransformScale3D extends AnimateTransformScale
+{
+    include "../../mx/core/Version.as";
+
+    public function AnimateTransformScale3D(target:Object=null)
+    {
+        super(target);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  scaleZFrom
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="NaN")]
+
+    /**
+     * The starting scale factor in the z direction.
+     */
+    public var scaleZFrom:Number;
+
+    //----------------------------------
+    //  scaleZTo
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="NaN")]
+
+    /**
+     * The ending scale factor in the z direction.
+     */
+    public var scaleZTo:Number;
+
+    //----------------------------------
+    //  scaleZBy
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="NaN")]
+
+    /**
+     * The factor by which to scale the object in the z direction.
+     * This is an optional parameter that can be used instead of one
+     * of the other from/to values to specify the delta to add to the
+     * from value or to derive the from value by subtracting from the
+     * to value.
+     */
+    public var scaleZBy:Number;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @private
+     */
+    override protected function initInstance(instance:IEffectInstance):void
+    {
+        addMotionPath("scaleZ", scaleZFrom, scaleZTo, scaleZBy);
+        super.initInstance(instance);
+    }
+
+}
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 13208
Author:   chaase@adobe.com
Date:     2009-12-23T21:49:14.524642Z

Log Message:
-----------
Dealt with my FIXMEs in the code. Some went away (no longer issues), some became TODOs (still issues, but nothing that we have to solve in this release), a couple were actually resolved in this change (like the bug filed/fixed: 24848).

QE notes: 10 failures in Mustella of tests that need to be changed. They're excluded for now and QE has local fixes.
Doc notes: None
Bugs: SDK-24848
Reviewer: Jason
Tests run: checkintests, Mustella (spark/effects, mx/effects)
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/supportClasses/AnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Move3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/animation/Animation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Rotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/supportClasses/AnimateTransitionShaderInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/CompositeEffect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/animation/MotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Move.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/PropertyChanges.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateTransform.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Scale3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Rotate3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/animation/Timeline.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/supportClasses/MoveInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AddAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Scale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/SequenceInstance.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/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/EffectTargetFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/RemoveAction.as</path>

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

--- frameworks/projects/spark/src/spark/effects/Scale3D.as
+++ frameworks/projects/spark/src/spark/effects/Scale3D.as
@@ -303,6 +303,11 @@
         return AFFECTED_PROPERTIES;
     }

+    // TODO (chaase): Should try to remove this override. At a minimum, we could
+    // put the motionPaths creation at the start of initInstance(). Ideally, we'd
+    // remove that logic entirely, but there's a need to create motionPaths fresh
+    // for every call to create/initInstance() or else multi-instance effects
+    // will inherit the one motionPaths object created elsewhere.
     /**
      * @private
      */