Transferred from the Adobe Open Source Subversion Repository

Revision: 6769
Author:   jszeto@adobe.com
Date:     2009-05-08T19:55:04.565969Z

Log Message:
-----------
DropDownList Bug Fixes

http://bugs.adobe.com/jira/browse/SDK-20892 - Using navigation keys don’t work when the DropDownList is closed

We have improved keyboard navigation for layouts, but this unfortunately broke keyboard navigation for DropDownList while it is closed. Since neither the layout or the dataGroup is available when the DropDownList is closed, I’ve decided to go back to handling the keyboard navigation directly in DDL. Previously, it had been using List’s keyboard handling (which in turn, relies on layout).

Keyboard navigation now works similar to vertical layout’s keyboard nav. UP and DOWN keys change the selectedIndex up or down. HOME sets selectedIndex to 0. END sets it to the last item. PAGE_UP moves the selectedIndex up 5 spots, while PAGE_DOWN moves it down 5 spots. The page size is defined by an mx_internal static property.

http://bugs.adobe.com/jira/browse/SDK-20908 - inconsistent naming of "popup" in Spark DropDownList skin

http://bugs.adobe.com/jira/browse/SDK-20935 - Spark DropDownList button skin should handle line breaks the same as Spark Button skin

QE Notes: Keyboard navigation has changed slightly. PAGE_UP and PAGE_DOWN have slightly different behavior than before.
Doc Notes: none
Bugs: SDK-20892, SDK-20908, SDK-20935
Reviewer: Glenn

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DropDownList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/default/DropDownListSkin.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/DropDownList.as
+++ frameworks/projects/spark/src/spark/components/DropDownList.as
@@ -43,6 +43,7 @@
 import spark.components.supportClasses.ButtonBase;
 import spark.components.supportClasses.DropDownController;
 import spark.components.supportClasses.ListBase;
+import spark.core.NavigationUnit;
 import spark.events.DropDownEvent;
 import spark.layouts.VerticalLayout;
 import spark.layouts.supportClasses.LayoutBase;
@@ -182,6 +183,7 @@
     private var labelChanged:Boolean = false;
     // TODO (jszeto) Should this be protected?
     private var proposedSelectedIndex:Number = -1;
+    mx_internal static var PAGE_SIZE:int = 5;

 	//--------------------------------------------------------------------------
     //
@@ -369,22 +371,6 @@
     	invalidateProperties();
     }

-    //----------------------------------
-    //  layout
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    override public function get layout():LayoutBase
-    {
-    	// Since the dataGroup is optional, if it doesn't exist yet,
-    	// then just default to using a VerticalLayout so that keyboard
-        // navigation will still work.
-        return (dataGroup)
-            ? super.layout
-            : new VerticalLayout();
-    }

     //----------------------------------
     //  selectedIndices
@@ -576,10 +562,13 @@

         if (!dropDownController.processKeyDown(event))
         {
+        	var navigationUnit:uint;
+        	var proposedNewIndex:int = -1;
+
 			if (dropDownController.isOpen)
 			{
-	        	var navigationUnit:uint = mapEventToNavigationUnit(event);
-	        	var proposedNewIndex:int = layout.getDestinationIndex(navigationUnit, proposedSelectedIndex)
+	        	navigationUnit = mapEventToNavigationUnit(event);
+	        	proposedNewIndex = layout.getDestinationIndex(navigationUnit, proposedSelectedIndex)

 	        	if (proposedNewIndex != -1)
 	        	{
@@ -589,10 +578,45 @@
 	        		ensureItemIsVisible(proposedSelectedIndex);
 	        	}
 	   		}
-	   		else
+	   		else if (dataProvider)
 	   		{
-	   			super.keyDownHandler(event);
-	   		}
+	   			navigationUnit = mapEventToNavigationUnit(event);
+
+	   			switch (navigationUnit)
+		        {
+		            case NavigationUnit.UP:
+		               proposedNewIndex = selectedIndex - 1;
+		               break;
+
+		            case NavigationUnit.DOWN:
+		               proposedNewIndex = selectedIndex + 1;
+		               break;
+
+		            case NavigationUnit.PAGE_UP:
+		               proposedNewIndex = selectedIndex == -1 ?
+		               						-1 : Math.max(selectedIndex - mx_internal::PAGE_SIZE, 0);
+		               break;
+
+			   		case NavigationUnit.PAGE_DOWN:
+		               proposedNewIndex = selectedIndex + mx_internal::PAGE_SIZE;
+		               break;
+
+            		case NavigationUnit.HOME:
+		               proposedNewIndex = 0;
+		               break;
+
+             		case NavigationUnit.END:
+		               proposedNewIndex = dataProvider.length - 1;
+		               break;
+
+
+		        }
+
+		        proposedNewIndex = Math.min(proposedNewIndex, dataProvider.length - 1);
+
+		        if (proposedNewIndex >= 0)
+		        	selectedIndex = proposedNewIndex;
+		    }
         }

 	}


Transferred from the Adobe Open Source Subversion Repository

Revision: 17331
Author:   jasonsj@adobe.com
Date:     2010-08-16T17:37:24.374535Z

Log Message:
-----------
Added DiscouragedForProfile metadata for use with FB mobile projects.

QE notes: DiscouragedForProfile features should now be visible in FB
Doc notes: ASDoc content omitted for DiscouragedForProfile where the boilerplate comment is desired
Bugs:
Reviewer: gruehle
Tests run: checkintests
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/VSlider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/ComboBox.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/TitleWindow.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/ToggleButton.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Spinner.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/BorderContainer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/FormHeading.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/VideoPlayer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DropDownList.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/HSlider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/TabBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/VideoDisplay.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Panel.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/ButtonBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Form.as</path>

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

--- frameworks/projects/spark/src/spark/components/VideoDisplay.as
+++ frameworks/projects/spark/src/spark/components/VideoDisplay.as
@@ -149,6 +149,14 @@
 [ResourceBundle("osmf")]

 [IconFile("VideoDisplay.png")]
+
+/**
+ * Because this component does not define a skin for the mobile theme, Adobe
+ * recommends that you not use it in a mobile application. Alternatively, you
+ * can define your own mobile skin for the component. For more information,
+ * see Spark Skinning.
+ */
+[DiscouragedForProfile("mobileDevice")]

 /**
  *  The VideoDisplay class is chromeless video player that supports


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

--- frameworks/projects/spark/src/spark/components/VideoDisplay.as
+++ frameworks/projects/spark/src/spark/components/VideoDisplay.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 spark.components
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 22479
Author:   jszeto@adobe.com
Date:     2011-09-09T22:12:14.047583Z

Log Message:
-----------
SpinnerList click bug fix

SDK-31493 - SpinnerList animates in the wrong direction when going from the last item to the first item

Compare the distance from 3 indices, to cover all use cases

QE notes: none
Doc notes: none
Bugs: SDK-31493
Reviewer: Tom K
Tests run: checkintests, cyclone
Is noteworthy for integration: no

Modified Paths:
--------------
/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/layouts/VerticalSpinnerLayout.as

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

--- frameworks/projects/mobilecomponents/src/spark/layouts/VerticalSpinnerLayout.as
+++ frameworks/projects/mobilecomponents/src/spark/layouts/VerticalSpinnerLayout.as
@@ -447,13 +447,20 @@
             // Get unwrapped middle index
             var centerIndex:int = getElementNearestScrollPosition(new Point(0, midVSP), "center");

-            // Get the unwrapped index before and after the center index
+            // Get the unwrapped indicies near the center index
             var prevIndex:int = index + (wrapCount - 1) * target.numElements;
-            var nextIndex:int = prevIndex + target.numElements;
+            var midIndex:int = prevIndex + target.numElements;
+            var nextIndex:int = midIndex + target.numElements;
+
+            var prevDistance:int = Math.abs(centerIndex - prevIndex);
+            var midDistance:int = Math.abs(midIndex - centerIndex);
+            var nextDistance:int = Math.abs(nextIndex - centerIndex)

             // Figure out which index is closer to the centerIndex and return that value
-            if (Math.abs(centerIndex - prevIndex) < Math.abs(nextIndex - centerIndex))
-                index = prevIndex;
+            if (prevDistance < midDistance)
+                index = prevIndex;
+            else if (midDistance < nextDistance)
+                index = midIndex;
             else
                 index = nextIndex;
         }


Transferred from the Adobe Open Source Subversion Repository

Revision: 10828
Author:   jszeto@adobe.com
Date:     2009-10-02T17:41:48.523309Z

Log Message:
-----------
FXG stroke and fill translation fix

http://bugs.adobe.com/jira/browse/SDK-23257 - Gradient translation should occur from 0,0, not the upper left bounds

The current API only passes in the shape's bounds. I have added a new targetOrigin parameter to IFill.begin, IStroke.apply and IStroke.createGraphicsStroke of type Point. It is the origin (0,0) of the shape in the target graphic's coordinate space.

Changed the logic in the gradient stroke and fills. The x and y transform properties are now positioned relative to the origin instead of to the top left corner of the bounds. If no x and y are set, then the default behavior remains the same.

Removed the centering logic in LinearGradientStroke when scaleX was set.

This API change has been approved by PARB.

QE notes: Need to add tests that exercise this logic
Doc notes: Need to document additions to the API
Bugs: SDK-23257
Reviewer: Deepa
Tests run: spark/primitives, gumbo/components
Is noteworthy for integration: Yes, modifications to the API

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/FilledElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/IFill.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/IStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/LinearGradientStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/SolidColorStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/Line.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/RadialGradientStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/BitmapFill.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/GradientStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/Path.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/LinearGradient.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/SolidColor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/StrokedElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/RadialGradient.as</path>

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

--- frameworks/projects/spark/src/spark/primitives/supportClasses/StrokedElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/StrokedElement.as
@@ -12,21 +12,15 @@
 package spark.primitives.supportClasses
 {
 import flash.display.Graphics;
-import flash.display.Shape;
+import flash.display.LineScaleMode;
 import flash.display.Sprite;
-import flash.events.Event;
 import flash.events.EventDispatcher;
+import flash.geom.Point;
 import flash.geom.Rectangle;
-
-import spark.primitives.supportClasses.GraphicElement;

 import mx.core.mx_internal;
 import mx.events.PropertyChangeEvent;
-import mx.filters.BaseFilter;
-import mx.filters.IBitmapFilter;
 import mx.graphics.IStroke;
-import flash.geom.Point;
-import flash.display.LineScaleMode;

 use namespace mx_internal;

@@ -172,7 +166,8 @@
             stroke.apply(g,new Rectangle(drawX + measuredX,
             						    drawY + measuredY,
             						    Math.max(width, stroke.weight),
-            						    Math.max(height, stroke.weight)));
+            						    Math.max(height, stroke.weight)),
+                         new Point(drawX, drawY));
         else
             g.lineStyle();


add Matrix4x4.getRotationQuaternion() method

--- src/aerys/minko/type/math/Matrix4x4.as
+++ src/aerys/minko/type/math/Matrix4x4.as
@@ -6,6 +6,7 @@
 	import aerys.minko.type.binding.IWatchable;

 	import flash.geom.Matrix3D;
+	import flash.geom.Orientation3D;
 	import flash.geom.Utils3D;
 	import flash.geom.Vector3D;

@@ -573,6 +574,17 @@
 				_changed.execute(this);

 			return this;
+		}
+
+		public function getRotationQuaternion(output : Vector4 = null) : Vector4
+		{
+			var components 	: Vector.<Vector3D>	= _matrix.decompose(Orientation3D.QUATERNION);
+			var rotation	: Vector3D			= components[1];
+
+			output ||= new Vector4();
+			output.set(rotation.x, rotation.y, rotation.z, rotation.w);
+
+			return output;
 		}

 		public function getScale(output : Vector4 = null) : Vector4


Added lots of code to make connection pairs and connect to the connector and so on...

--- return_of_the_rtmfpcat.as
+++ return_of_the_rtmfpcat.as
@@ -50,6 +50,9 @@

         private static const DEFAULT_CIRCON_TIMEOUT:uint = 4000;

+        /* Maximum connections. */
+        private const MAXIMUM_RCP_PAIRS:uint = 1;
+
         /* TextField for debug output. */
         private var output_text:TextField;

@@ -76,8 +79,8 @@
         /* Cirrus connection timeout ID. */
         private var circon_timeo_id:int;

-        /* Array of connection pairs */
-        private var con_pairs:Array;
+        /* Number of connected RTMFPConnectionPairs. */
+        private var rcp_pairs:uint;

         /* Put a string to the screen. */
         public function puts(s:String):void
@@ -98,6 +101,9 @@
             output_text.background = true;
             output_text.backgroundColor = 0x001f0f;
             output_text.textColor = 0x44cc44;
+
+            /* Initialize connection pair count. */
+            rcp_pairs = 0;

             puts("Meow!");
             puts("Starting.");
@@ -182,11 +188,13 @@
                 if(proxy_mode) {

                 } else {
-                    /* Listen for incoming RTMFP connections. */
-                    var s_r:RTMFPSocket = new RTMFPSocket(circon);
-                    s_r.addEventListener(Event.CONNECT, rtmfp_connect_event);
-                    s_r.listen();
-
+                    puts("Setting up listening RTMFPConnectionPair");
+                    var rcp:RTMFPConnectionPair = new RTMFPConnectionPair(circon, tor_addr, output_text);
+                    rcp.addEventListener(Event.CONNECT, rcp_connect_event);
+                    rcp.addEventListener(Event.CLOSE, rcp_close_event);
+                    rcp.listen();
+
+                    puts("Registering with facilitator");
                     /* Register ID with facilitator. */
                     register_id(circon.nearID, fac_addr);
                 }
@@ -207,9 +215,34 @@
             }
         }

-        private function rtmfp_connect_event(e:Event):void
-        {
-           puts("VICTORY!");
+        private function rcp_connect_event(e:Event):void
+        {
+            puts("RTMFPConnectionPair connected");
+
+            rcp_pairs++;
+
+            if(proxy_mode) {
+
+            } else {
+                /* Setup listening RTMFPConnectionPair. */
+                if(rcp_pairs < MAXIMUM_RCP_PAIRS) {
+                    puts("Setting up listening RTMFPConnectionPair");
+                    var rcp:RTMFPConnectionPair = new RTMFPConnectionPair(circon, tor_addr, output_text);
+                    rcp.addEventListener(Event.CONNECT, rcp_connect_event);
+                    rcp.addEventListener(Event.CLOSE, rcp_close_event);
+                    rcp.listen();
+                }
+            }
+        }
+
+        private function rcp_close_event(e:Event):void
+        {
+            puts("RTMFPConnectionPair closed");
+
+            rcp_pairs--;
+
+            /* FIXME: Do I need to unregister the event listeners so
+             * that the system can garbage collect the rcp object? */
         }

         private function register_id(id:String, fac_addr:Object):void
@@ -270,6 +303,7 @@
 import flash.utils.setTimeout;
 import flash.net.NetConnection;
 import flash.net.NetStream;
+import flash.text.TextField;

 class RTMFPSocket extends EventDispatcher
 {
@@ -284,9 +318,23 @@
     private var send_stream:NetStream;
     private var recv_stream:NetStream;

-    public function RTMFPSocket(circon:NetConnection)
+    /* Keeps the state of our connectedness. */
+    public var connected:Boolean;
+
+    private var output_text:TextField;
+
+    /* Put a string to the screen. */
+    public function puts(s:String):void
+    {
+        output_text.appendText(s + "\n");
+        output_text.scrollV = output_text.maxScrollV;
+    }
+
+    public function RTMFPSocket(circon:NetConnection, output_text:TextField)
     {
         this.circon = circon;
+        this.output_text = output_text;
+        connected = false;
     }

     public function listen():void
@@ -300,12 +348,15 @@

     private function send_stream_peer_connect(peer:NetStream):Boolean
     {
+        puts("RTMFPSocket: peer connecting...");
         recv_stream = new NetStream(circon, peer.farID);
         var client:RTMFPSocketClient = new RTMFPSocketClient();
         client.addEventListener(ProgressEvent.SOCKET_DATA, function (event:ProgressEvent):void {
             dispatchEvent(event);
         }, false, 0, true);
         client.addEventListener(RTMFPSocketClient.PEER_CONNECT_ACKNOWLEDGED, function (event:Event):void {
+            puts("RTMFPSocket: peer connected");
+            connected = true;
             dispatchEvent(new Event(Event.CONNECT));
         }, false, 0, true);
         recv_stream.client = client;
@@ -314,7 +365,23 @@
         return true;
     }

-
+    public function readBytes(bytes:ByteArray):void
+    {
+        recv_stream.client.bytes.readBytes(bytes);
+    }
+
+    public function writeBytes(bytes:ByteArray):void
+    {
+        send_stream.send("dataAvailable", bytes);
+    }
+
+    public function close():void
+    {
+        puts("RTMFPSocket: closing...");
+        send_stream.close();
+        recv_stream.close();
+        connected = false;
+    }
 }

 dynamic class RTMFPSocketClient extends EventDispatcher
@@ -368,7 +435,83 @@

 }

-class ConnectionPair extends EventDispatcher
+class RTMFPConnectionPair extends EventDispatcher
 {
+    private var circon:NetConnection;
+
+    private var tor_addr:Object;
+
+    private var s_r:RTMFPSocket;
+
+    private var s_t:Socket;
+
+    private var output_text:TextField;
+
+    /* Put a string to the screen. */
+    public function puts(s:String):void
+    {
+        output_text.appendText(s + "\n");
+        output_text.scrollV = output_text.maxScrollV;
+    }
+
+    public function RTMFPConnectionPair(circon:NetConnection, tor_addr:Object, output_text:TextField)
+    {
+        this.circon = circon;
+        this.tor_addr = tor_addr;
+        this.output_text = output_text;
+    }
+
+    public function listen():void
+    {
+        s_r = new RTMFPSocket(circon, output_text);
+        s_r.addEventListener(Event.CONNECT, rtmfp_connect_event);
+        s_r.addEventListener(Event.CLOSE, rtmfp_close_event);
+        s_r.listen();
+    }
+
+    private function rtmfp_connect_event(e:Event):void
+    {
+        puts("RTMFPConnectionPair: RTMFPSocket connected!");
+        puts("RTMFPConnectionPair: setting up tor connection...");
+
+        /* Setup tor connection linked to RTMFPSocket. */
+        s_t = new Socket();
+        s_t.addEventListener(Event.CONNECT, function (e:Event):void {
+            puts("RTMFPConnectionPair: Tor: connected to " + tor_addr.host + ":" + tor_addr.port + ".");
+            dispatchEvent(new Event(Event.CONNECT));
+        });
+        s_t.addEventListener(Event.CLOSE, function (e:Event):void {
+            puts("RTMFPConnectionPair: Tor: closed connection.");
+            /* Close other side of connection pair if it is open and
+             * dispatch close event. */
+            if(s_r.connected)
+                s_r.close();
+            dispatchEvent(new Event(Event.CLOSE));
+        });
+        s_t.addEventListener(IOErrorEvent.IO_ERROR, function (e:IOErrorEvent):void {
+            puts("RTMFPConnectionPair: Tor: I/O error: " + e.text + ".");
+        });
+        s_t.addEventListener(ProgressEvent.SOCKET_DATA, function (e:ProgressEvent):void {
+            var bytes:ByteArray = new ByteArray();
+            s_t.readBytes(bytes, 0, e.bytesLoaded);
+            puts("RTMFPConnectionPair: Tor: read " + bytes.length + " bytes.");
+            s_r.writeBytes(bytes);
+        });
+        s_t.addEventListener(SecurityErrorEvent.SECURITY_ERROR, function (e:SecurityErrorEvent):void {
+            puts("RTMFPConnectionPair: Tor: security error: " + e.text + ".");
+        });
+
+        s_t.connect(tor_addr.host, tor_addr.port);
+    }
+
+    private function rtmfp_close_event(e:Event):void
+    {
+       puts("RTMFPConnectionPair: RTMFPSocket closed connection");
+       /* Close other side of connection pair if it is open and dispatch
+        * close event. */
+       if(s_t.connected)
+           s_t.close();
+       dispatchEvent(new Event(Event.CLOSE));
+    }

 }


don't try to reconnect upon disconnection

--- Agent.as
+++ Agent.as
@@ -83,9 +83,8 @@

     	private function close(e:Event):void {
     	   _connected = false;
-    	   trace(PREFIX, "Disconnected, will try to reconnect");
-
-           connect();
+
+    	   trace(PREFIX, "Disconnected");
     	}

     	private function fail(e:Event):void {


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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 20461
Author:   rfrishbe@adobe.com
Date:     2011-02-24T19:55:55.937178Z

Log Message:
-----------
Fixing up how we redispatch mouse events that occur on the stage.  Their coordinates need to be transferred to local coordinates for the mouseCatcher before we redispatch them on the mouseCatcher.

QE notes: -
Doc notes:
Bugs: SDK-29580
Reviewer: Alex
Tests run: checkintests, full cyclone
Is noteworthy for integration: No

Modified Paths:
--------------
/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/SystemManager.as

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

--- frameworks/projects/framework/src/mx/managers/SystemManager.as
+++ frameworks/projects/framework/src/mx/managers/SystemManager.as
@@ -3527,9 +3527,23 @@
     private function stageEventHandler(event:Event):void
     {
         if (event.target is Stage && mouseCatcher)
+        {
+            // need to fix up the coordinate space before re-dispatching the mouse event
+            // to put it in the same coordinate space as the mouseCatcher since the
+            // mouseCatcher may be scaled while outside of the stage, we are not
+            if (event is MouseEvent)
+            {
+                var mouseEvent:MouseEvent = MouseEvent(event);
+                var stagePoint:Point = new Point(mouseEvent.stageX, mouseEvent.stageY);
+                var mouesCatcherLocalPoint:Point = mouseCatcher.globalToLocal(stagePoint);
+                mouseEvent.localX = mouesCatcherLocalPoint.x;
+                mouseEvent.localY = mouesCatcherLocalPoint.y;
+            }
+
             // dispatch them from mouseCatcher so capture phase listeners on
             // systemManager will work
             mouseCatcher.dispatchEvent(event);
+        }
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 17431
Author:   clucier@adobe.com
Date:     2010-08-20T20:18:26.874029Z

Log Message:
-----------
State specific event handlers now work correctly (and remove original handler as necessary).
State specific event handlers no longer pin target element in memory.
Duplicate skin states and state tags no longer allowed (by request).

QE notes: None
Doc notes: None
Bugs: SDK-26590, SDK-26463, SDK-26185
Reviewer: Paul, Glenn
Tests run: Checkin
Is noteworthy for integration: No

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

--- frameworks/projects/framework/src/mx/states/SetEventHandler.as
+++ frameworks/projects/framework/src/mx/states/SetEventHandler.as
@@ -19,6 +19,7 @@
 import mx.core.ComponentDescriptor;
 import mx.core.UIComponent;
 import mx.states.OverrideBase;
+import mx.core.IStateClient2;

 /**
  *  The event handler function to execute in response to the event that is
@@ -165,6 +166,18 @@
      *  @productversion Flex 3
      */
     public var handlerFunction:Function;
+
+    /**
+     *  The handler function to remove prior to applying our override.
+     *
+     *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public var originalHandlerFunction:Function;

     //----------------------------------
     //  target
@@ -239,41 +252,51 @@
         var obj:* = getOverrideContext(target, parent);
         if (obj != null)
         {
-        	appliedTarget = obj;
-	        var uiObj:UIComponent = obj as UIComponent;
-
-	        if (!installedHandlers)
-	            installedHandlers = new Dictionary(true);
-
-	        // Remember the current handler so it can be restored
-	        if (installedHandlers[obj] && installedHandlers[obj][name])
-	        {
-	            oldHandlerFunction = installedHandlers[obj][name];
-	            obj.removeEventListener(name, oldHandlerFunction);
-	        }
-	        else if (uiObj && uiObj.descriptor)
-	        {
-	            var descriptor:ComponentDescriptor = uiObj.descriptor;
-
-	            if (descriptor.events && descriptor.events[name])
-	            {
-	                oldHandlerFunction = uiObj.document[descriptor.events[name]];
-	                obj.removeEventListener(name, oldHandlerFunction);
-	            }
-	        }
-
-	        // Set new handler as weak reference
-	        if (handlerFunction != null)
-	        {
-	            obj.addEventListener(name, handlerFunction, false, 0, true);
-
-	            // Add this handler to our installedHandlers list so it can
-	            // be removed if needed by a state based on this state.
-	            if (installedHandlers[obj] == undefined)
-	                installedHandlers[obj] = {};
-
-	            installedHandlers[obj][name] = handlerFunction;
-	        }
+            appliedTarget = obj;
+            var uiObj:UIComponent = obj as UIComponent;
+
+            if (!installedHandlers)
+                installedHandlers = new Dictionary(true);
+
+            // Remember the current handler so it can be restored
+            if (installedHandlers[obj] && installedHandlers[obj][name])
+            {
+                oldHandlerFunction = installedHandlers[obj][name];
+                obj.removeEventListener(name, oldHandlerFunction);
+            }
+            else if (originalHandlerFunction != null)
+            {
+                oldHandlerFunction = originalHandlerFunction;
+                obj.removeEventListener(name, oldHandlerFunction);
+            }
+            else if (uiObj && uiObj.descriptor)
+            {
+                var descriptor:ComponentDescriptor = uiObj.descriptor;
+
+                if (descriptor.events && descriptor.events[name])
+                {
+                    oldHandlerFunction = uiObj.document[descriptor.events[name]];
+                    obj.removeEventListener(name, oldHandlerFunction);
+                }
+            }
+
+            // Set new handler as weak reference
+            if (handlerFunction != null)
+            {
+                obj.addEventListener(name, handlerFunction, false, 0, true);
+
+                // Add this handler to our installedHandlers list so it can
+                // be removed if needed by a state based on this state. We
+                // only do so for legacy MXML documents that support hierarchical
+                // states.
+                if (!(parent.document is IStateClient2))
+                {
+                    if (installedHandlers[obj] == undefined)
+                        installedHandlers[obj] = {};
+
+                    installedHandlers[obj][name] = handlerFunction;
+                }
+            }
         }
         else if (!applied)
         {


Transferred from the Adobe Open Source Subversion Repository

Revision: 11452
Author:   klin@adobe.com
Date:     2009-11-05T01:43:45.759633Z

Log Message:
-----------
Couple of various fixes.

ComboBox.as - The dropDown was not receiving changes to styles nor dataproviders. This was a result of not recreating the dropDown each time it was shown. I've changed the default of the flag for destroying the dropDown to be true. I've also modified the code to only not destroy the dropDown when it is showing or being shown.

ButtonBar.as - In one case, when calculating the percentage that each button takes of the width, there was a rounding error that caused the total percentage to be less than 100%. I've changed the code to use Numbers to avoid the rounding error.

DropDownList.as - I've fixed the page down code to take into account the case when selectedIndex==-1.

Label.as, SWFLoader.as, TextInput.as - Excluded baseColor style.

TitleWindowBoundsEvent.as - ASDoc change. "afterBounds" is always null when the "windowMoveStart" event is dispatched

QE notes: No
Doc notes: No
Bugs: SDK-21715, SDK-23338, SDK-23512, SDK-23838, SDK-23660
Reviewer: Chet
Tests run: checkintests, ButtonBar, ToggleButtonBar, tabnavigator
Is noteworthy for integration: No

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/spark/src/spark/components/DropDownList.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/framework/src/mx/controls/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/events/TitleWindowBoundsEvent.as</path>

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

--- frameworks/projects/spark/src/spark/components/DropDownList.as
+++ frameworks/projects/spark/src/spark/components/DropDownList.as
@@ -781,7 +781,7 @@
                     e.newIndex = caretIndex;
                     dispatchEvent(e);

-                    event.preventDefault()
+                    event.preventDefault();
                 }
             }
             else if (dataProvider)
@@ -791,14 +791,14 @@
                     case NavigationUnit.UP:
                     {
                         proposedNewIndex = selectedIndex - 1;
-                        event.preventDefault()
+                        event.preventDefault();
                         break;
                     }

                     case NavigationUnit.DOWN:
                     {
                         proposedNewIndex = selectedIndex + 1;
-                        event.preventDefault()
+                        event.preventDefault();
                         break;
                     }

@@ -806,28 +806,29 @@
                     {
                         proposedNewIndex = selectedIndex == -1 ?
                                             -1 : Math.max(selectedIndex - PAGE_SIZE, 0);
-                        event.preventDefault()
+                        event.preventDefault();
                         break;
                     }

                     case NavigationUnit.PAGE_DOWN:
                     {
-                        proposedNewIndex = selectedIndex + PAGE_SIZE;
-                        event.preventDefault()
+                        proposedNewIndex = selectedIndex == -1 ?
+                                           PAGE_SIZE : (selectedIndex + PAGE_SIZE);
+                        event.preventDefault();
                         break;
                     }

                     case NavigationUnit.HOME:
                     {
                         proposedNewIndex = 0;
-                        event.preventDefault()
+                        event.preventDefault();
                         break;
                     }

                     case NavigationUnit.END:
                     {
                         proposedNewIndex = dataProvider.length - 1;
-                        event.preventDefault()
+                        event.preventDefault();
                         break;
                     }

@@ -841,7 +842,7 @@
         }
         else
         {
-            event.preventDefault()
+            event.preventDefault();
         }

     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 10845
Author:   rfrishbe@adobe.com
Date:     2009-10-02T22:55:13.358388Z

Log Message:
-----------
For VideoElement and VideoPlayer, rather than having to load up the video source always, there's now a way just to load up an image.  This will help for cases, like Design View, where you just want a preview of a component and how it looks without necessarily loading up the whole video source.  The way to do this is through a new mx_internal property, thumbnailSource.  This gets pushed in to a BitmapImage object, so any type of source that BitmapImage supports will be supported by this property.

QE notes: Please add some tests for this
Doc notes: -
Bugs: SDK-22261
Reviewer: Deepa
Tests run: checkintests, mustella VideoElement/VideoPlayer
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VideoPlayer.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/VideoElement.as</path>

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

--- frameworks/projects/spark/src/spark/components/VideoDisplay.as
+++ frameworks/projects/spark/src/spark/components/VideoDisplay.as
@@ -31,6 +31,7 @@
 import mx.core.UIComponent;
 import mx.core.mx_internal;

+import spark.components.Group;
 import spark.components.mediaClasses.StreamItem;
 import spark.components.mediaClasses.StreamingVideoSource;
 import spark.events.VideoEvent;
@@ -753,6 +754,98 @@
     }

     //----------------------------------
+    //  thumbnailSource
+    //----------------------------------
+
+    private var _thumbnailSource:Object;
+
+    /**
+     *  @private
+     *  Group that holds the BitmapImage for the thumbnail
+     */
+    private var thumbnailGroup:Group;
+
+    [Inspectable(Category="General")]
+
+    /**
+     *  @private
+     *  Thumbnail source is an internal property used to replace the video with a thumbnail.
+     *  This is for places where we just want to load in a placeholder object for the video
+     *  and don't want to incur the extra load-time or memory of loading up the video.
+     *
+     *
Thumbnail source can take any valid source that can be passed in to
+     *  spark.primitivies.BitmapImage#source.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    mx_internal function get thumbnailSource():Object
+    {
+        return _thumbnailSource;
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal function set thumbnailSource(value:Object):void
+    {
+        if (_thumbnailSource == value)
+            return;
+
+        _thumbnailSource = value;
+
+        // if we haven't initialized, let's wait to set up the
+        // source in commitProperties() as it is dependent on other
+        // properties, like autoPlay and enabled, and those may not
+        // be set yet, especially if they are set via MXML.
+        // Otherwise, if we have initialized, let's just set up the
+        // source immediately.  This way people can change the source
+        // and immediately call methods like seek().
+        if (!initializedOnce)
+        {
+            sourceChanged = true;
+            invalidateProperties();
+        }
+        else
+        {
+            setUpThumbnailSource();
+        }
+    }
+
+    /**
+     *  @private
+     *  Sets up the thumbnail source for use.
+     */
+    private function setUpThumbnailSource():void
+    {
+        if (thumbnailSource)
+        {
+            var bitmapImage:BitmapImage;
+            if (!thumbnailGroup)
+            {
+                bitmapImage = new BitmapImage();
+
+                bitmapImage.left = 0;
+                bitmapImage.right = 0;
+                bitmapImage.top = 0;
+                bitmapImage.bottom = 0;
+
+                thumbnailGroup = new Group();
+                thumbnailGroup.addElement(bitmapImage);
+                addChild(thumbnailGroup);
+            }
+            else
+            {
+                bitmapImage = thumbnailGroup.getElementAt(0) as BitmapImage;
+            }
+
+            bitmapImage.source = thumbnailSource;
+        }
+    }
+
+    //----------------------------------
     //  totalTime
     //----------------------------------

@@ -875,7 +968,10 @@
         {
             sourceChanged = false;

-            setUpSource();
+            if (thumbnailSource)
+                setUpThumbnailSource();
+            else
+                setUpSource();
         }
     }

@@ -952,6 +1048,15 @@
     {
         super.measure();

+        // if showing the thumbnail, just use the thumbnail's size
+        if (thumbnailSource && thumbnailGroup)
+        {
+            measuredWidth = thumbnailGroup.getPreferredBoundsWidth();
+            measuredHeight = thumbnailGroup.getPreferredBoundsHeight();
+            return;
+        }
+
+        // otherwise grab the width/height from the video
         var vw:Number = videoPlayer.videoWidth;
         var vh:Number = videoPlayer.videoHeight;

@@ -978,6 +1083,51 @@
     override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number) : void
     {
         super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        // if just showing the thumbnail, push this width/height in to the thumbnail
+        // otherwise we'll push it in to the video object
+        if (thumbnailSource && thumbnailGroup)
+        {
+            var imageWidth:Number;
+            var imageHeight:Number;
+            var bitmapImage:BitmapImage = thumbnailGroup.getElementAt(0) as BitmapImage;
+
+            if (!maintainAspectRatio)
+            {
+                // if not maintainAspectRatio, the width and height of the image
+                // are what the layout wants them to be and the image is stretched or shrunken
+                imageWidth = unscaledWidth;
+                imageHeight = unscaledHeight;
+
+                thumbnailGroup.setLayoutBoundsSize(imageWidth, imageHeight);
+            }
+            else
+            {
+                // the image dimensions need to maintain aspect ratio
+                var realRatio:Number = thumbnailGroup.getPreferredBoundsWidth()/thumbnailGroup.getPreferredBoundsHeight();
+
+                if (unscaledWidth / realRatio < unscaledHeight)
+                {
+                    // width is restrictive size
+                    imageWidth = unscaledWidth;
+                    imageHeight = unscaledWidth / realRatio;
+                }
+                else
+                {
+                    // height is restrictive size
+                    imageWidth = unscaledHeight * realRatio;
+                    imageHeight = unscaledHeight;
+                }
+
+                thumbnailGroup.setLayoutBoundsSize(imageWidth, imageHeight);
+
+                // center the thumbnailGroup
+                thumbnailGroup.x = (unscaledWidth - imageWidth)/2;
+                thumbnailGroup.y = (unscaledHeight - imageHeight)/2;
+            }
+
+            return;
+        }

         var flvPlayer:VideoPlayer = videoPlayer;

@@ -1035,7 +1185,12 @@
         if (!initializedOnce)
             return;

+        // if source is null or in a bad connection state, don't do anything
         if (source == null || videoPlayer.state == VideoState.CONNECTION_ERROR)
+            return;
+
+        // if have a thumbnailSource, no method calls are valid
+        if (thumbnailSource)
             return;

         setPlaying(false);
@@ -1054,7 +1209,7 @@
     public function play():void
     {
         // can't call any methods before we've initialized
-        if (!initializedOnce)
+        if (!initializedOnce || thumbnailSource)
             return;

         // check for 2 cases: streaming video or progressive download
@@ -1216,7 +1371,12 @@
         if (!initializedOnce)
             return;

+        // if source is null or in a bad connection state, don't do anything
         if (source == null || videoPlayer.state == VideoState.CONNECTION_ERROR)
+            return;
+
+        // if have a thumbnailSource, no method calls are valid
+        if (thumbnailSource)
             return;

         if (time < 0)
@@ -1245,7 +1405,12 @@
         if (!initializedOnce)
             return;

+        // if source is null or in a bad connection state, don't do anything
         if (source == null || videoPlayer.state == VideoState.CONNECTION_ERROR)
+            return;
+
+        // if have a thumbnailSource, no method calls are valid
+        if (thumbnailSource)
             return;

         setPlaying(false);


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

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


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

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

 package mx.validators
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 20325
Author:   chiedozi@adobe.com
Date:     2011-02-15T19:43:48.655006Z

Log Message:
-----------
Properly removed an event listener that caused ViewNavigator to dispatch the "viewChangeComplete" event multiple times when switching tabs

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

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

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

--- frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as
+++ frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as
@@ -13,21 +13,16 @@
 {
 import flash.display.Stage;
 import flash.events.Event;
-import flash.geom.Rectangle;

 import mx.core.IVisualElement;
 import mx.core.UIComponent;
 import mx.core.mx_internal;
 import mx.effects.IEffect;
 import mx.effects.Parallel;
-import mx.events.CollectionEvent;
-import mx.events.CollectionEventKind;
 import mx.events.EffectEvent;
 import mx.events.FlexEvent;
 import mx.events.PropertyChangeEvent;
-import mx.events.PropertyChangeEventKind;
 import mx.managers.LayoutManager;
-import mx.resources.ResourceManager;

 import spark.components.supportClasses.NavigationStack;
 import spark.components.supportClasses.ViewDescriptor;
@@ -36,15 +31,10 @@
 import spark.components.supportClasses.ViewReturnObject;
 import spark.core.ContainerDestructionPolicy;
 import spark.effects.Animate;
-import spark.effects.Fade;
-import spark.effects.Move;
-import spark.effects.Resize;
 import spark.effects.animation.MotionPath;
 import spark.effects.animation.SimpleMotionPath;
-import spark.events.IndexChangeEvent;
 import spark.layouts.supportClasses.LayoutBase;
 import spark.transitions.SlideViewTransition;
-import spark.transitions.SlideViewTransitionMode;
 import spark.transitions.ViewTransitionBase;
 import spark.transitions.ViewTransitionDirection;

@@ -397,7 +387,7 @@
                 else
                 {
                     // Wait until the view validates before activating it
-                    activeView.addEventListener(FlexEvent.UPDATE_COMPLETE, completeViewCommitProcess);
+                    activeView.addEventListener(FlexEvent.UPDATE_COMPLETE, view_updateCompleteHandler);
                 }
             }

@@ -1756,21 +1746,38 @@
             // Wait a frame before sending the complete event so that the player
             // has the chance to render the last frame before any custom actionscript
             // is run in response to a VIEW_ACTIVATE event.
-            addEventListener(Event.ENTER_FRAME, completeViewCommitProcess);
-        }
-    }
-
-    /**
-     *  @private
-     *  Activates the current view.  Called on the frame following the
-     *  navigator commit or when a TabbedViewNavigator activates a new
-     *  view.
+            addEventListener(Event.ENTER_FRAME, enterFrameHandler);
+        }
+    }
+
+    /**
+     *  @private
+     *  Called when the activeView has received its first updateComplete event
+     *  after the navigator has been activated.  See setActive().
      */
-    private function completeViewCommitProcess(event:Event = null):void
-    {
-        if (event)
-            removeEventListener(Event.ENTER_FRAME, completeViewCommitProcess);
-
+    private function view_updateCompleteHandler(event:FlexEvent):void
+    {
+        event.target.removeEventListener(FlexEvent.UPDATE_COMPLETE, view_updateCompleteHandler);
+        completeViewCommitProcess();
+    }
+
+    /**
+     *  @private
+     *  Called after a navigation operation is complete.  See
+     *  navigatorActionCommitted().
+     */
+    private function enterFrameHandler(event:Event):void
+    {
+        removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
+        completeViewCommitProcess();
+    }
+
+    /**
+     *  @private
+     *  Activates the current view and completes the view change process.
+     */
+    private function completeViewCommitProcess():void
+    {
         // At this point, currentViewDescriptor points to the new view.
         // The navigator needs to listen for property change events on the
         // view so that it can be notified when the template properties


Transferred from the Adobe Open Source Subversion Repository

Revision: 17804
Author:   rfrishbe@adobe.com
Date:     2010-09-22T17:24:30.060779Z

Log Message:
-----------
Fixing a bunch of List issues:

- Scrolling now interacts with List's selection, even if it isn't the List's own scroller that is scrolling
- the touchInteractionEnd event is now bubbling as documented
- Remove a hack in Scroller aorund updateAfterEvent() because I figured out what the underlying bug is around scaleX/scaleY==0 affecting the thumb position for sliders and scrollbars
- Fixing some caret issues (though some still remain and need to be worked out)
- Fix a padding issue for MobileItemRenderer

QE notes: None
Doc notes: None
Bugs: SDK-27671, SDK-27675, SDK-27734, SDK-27828, SDK-27935
Reviewer: Hans
Tests run: checkintests, mustella Slider, Scrollbar, List
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ScrollerLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as
@@ -312,6 +312,62 @@
     }

     //---------------------------------
+    // scaleX
+    //---------------------------------
+
+    /**
+     *  @private
+     *  Overridden so that we can call invalidateDisplayList()
+     *  when scaleX changes since the positioning of the thumb
+     *  is incorrect when scaleX = 0 thanks to globalToLocal/localToGlobal().
+     *
+     *
We override it here in TrackBase instead of where the issue
+     *  actually exists (HScrollBar, HSlider, VScrollBar, VSlider) because it
+     *  is easier this way and most subclasses who rely on updateSkinDisplayList()
+     *  will probably run in to this issue.

+     */
+    override public function set scaleX(value:Number):void
+    {
+        if (value == super.scaleX)
+            return;
+
+        // if we were scaled at 0 and are being set to something else,
+        // invalidate the display list (see comment above)
+        if (super.scaleX == 0)
+            invalidateDisplayList();
+
+        super.scaleX = value;
+    }
+
+    //---------------------------------
+    // scaleY
+    //---------------------------------
+
+    /**
+     *  @private
+     *  Overridden so that we can call invalidateDisplayList()
+     *  when scaleY changes since the positioning of the thumb
+     *  is incorrect when scaleY = 0 thanks to globalToLocal/localToGlobal().
+     *
+     *
We override it here in TrackBase instead of where the issue
+     *  actually exists (HScrollBar, HSlider, VScrollBar, VSlider) because it
+     *  is easier this way and most subclasses who rely on updateSkinDisplayList()
+     *  will probably run in to this issue.

+     */
+    override public function set scaleY(value:Number):void
+    {
+        if (value == super.scaleY)
+            return;
+
+        // if we were scaled at 0 and are being set to something else,
+        // invalidate the display list (see comment above)
+        if (super.scaleY == 0)
+            invalidateDisplayList();
+
+        super.scaleY = value;
+    }
+
+    //---------------------------------
     // value
     //---------------------------------


Transferred from the Adobe Open Source Subversion Repository

Revision: 10357
Author:   jimurphy@adobe.com
Date:     2009-09-17T21:13:02.502084Z

Log Message:
-----------
Merged beta2 revisions 10309,10320-10321,10333-10335,10342,10347-10348 -> trunk

checkintests: pass

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/core/SpriteVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/supportClasses/FadeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/binding/Info.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/genext/GenerativeClassInfo.java</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/DropDownListSkin.mxml</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/TLFText.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/UITLFTextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/binding/TypeAnalyzer.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/ApplicationSkin.mxml</path>

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

--- frameworks/projects/spark/src/spark/effects/supportClasses/FadeInstance.as
+++ frameworks/projects/spark/src/spark/effects/supportClasses/FadeInstance.as
@@ -109,33 +109,40 @@
      */
     override public function play():void
     {
+        // FIXME chaase: clean up this logic and make it simpler to decide whether
+        // and object is appearing or disappearing, then set the starting/ending
+        // values appropriately. Also, reuse the lazy-evaluation code for
+        // animations by supplying NaNs for values to be filled in with
+        // state values from propChanges later
+
         // Remember the original value of the target object's alpha
         origAlpha = target.alpha;
         var propChanges:PropertyChanges = propertyChanges;

         // If nobody assigned a value, make this a "show" effect.
         if (isNaN(alphaFrom) && isNaN(alphaTo))
-        {
+        {
+            var startAlpha:Number = origAlpha;
+            var endAlpha:Number = origAlpha;
             if (propChanges && propChanges.end["alpha"] !== undefined &&
                 propChanges.end["alpha"] != propChanges.start["alpha"])
             {
-                alphaFrom = origAlpha;
-                alphaTo = propChanges.end["alpha"];
-            }
-            else if (propChanges && propChanges.end["visible"] !== undefined &&
+                endAlpha = propChanges.end["alpha"];
+            }
+            if (propChanges && propChanges.end["visible"] !== undefined &&
                 propChanges.end["visible"] != propChanges.start["visible"])
             {
-                alphaFrom = propChanges.start["visible"] ? origAlpha : 0;
-                alphaTo = propChanges.end["visible"] ? origAlpha : 0;
-                // Force target to be visible at effect start
-                restoreAlpha = true;
+                alphaFrom = propChanges.start["visible"] ? startAlpha : 0;
+                alphaTo = propChanges.end["visible"] ? endAlpha : 0;
+                // Force target to be visible at effect
+                restoreAlpha = !propChanges.end["visible"];
             }
             else if (propChanges && propChanges.end["parent"] !== undefined &&
                 propChanges.end["parent"] != propChanges.start["parent"])
             {
-                alphaFrom = propChanges.start["parent"] ? origAlpha : 0;
-                alphaTo = propChanges.end["parent"] ? origAlpha : 0;
-                restoreAlpha = true;
+                alphaFrom = propChanges.start["parent"] ? startAlpha : 0;
+                alphaTo = propChanges.end["parent"] ? endAlpha : 0;
+                restoreAlpha = !propChanges.end["parent"];
                 if (alphaFrom == 0)
                 {
                     target.alpha = 0;
@@ -146,12 +153,13 @@
             }
             else
             {
-                alphaFrom = 0;
-                alphaTo = origAlpha;
+                alphaFrom = startAlpha;
+                alphaTo = endAlpha;
             }
         }
         else if (isNaN(alphaFrom))
         {
+            // FIXME chaase: why anything but origAlpha here?
             alphaFrom = (alphaTo == 0) ? origAlpha : 0;
         }
         else if (isNaN(alphaTo))
@@ -163,6 +171,7 @@
             }
             else
             {
+                // FIXME chaase: why anything but origAlpha here?
                 alphaTo = (alphaFrom == 0) ? origAlpha : 0;
             }
         }


Clean up ResultItem.

Clean up ResultItem.


remove unused variable

remove unused variable

--- src/com/mangui/HLS/streaming/Buffer.as
+++ src/com/mangui/HLS/streaming/Buffer.as
@@ -14,11 +14,6 @@

     /** Class that keeps the buffer filled. **/
     public class Buffer {
-
-
-        /** Default bufferlength in seconds. **/
-        private static const LENGTH:Number = 30;
-
         /** Reference to the framework controller. **/
         private var _hls:HLS;
         /** The buffer with video tags. **/


reset variables upon load

reset variables upon load

--- src/flash/htmlelements/VideoElement.as
+++ src/flash/htmlelements/VideoElement.as
@@ -250,6 +250,10 @@
 			}
 			_isConnected = false;
 			_isPreloading = false;
+
+
+			_isEnded = false;
+			_bufferEmpty = false;

 			// start new connection
 			if (_isRTMP) {


Normalize line endings

Normalize line endings

--- src/flash/htmlelements/VideoElement.as
+++ src/flash/htmlelements/VideoElement.as
@@ -1,447 +1,447 @@
-package htmlelements
-{
-	import flash.display.Sprite;
-	import flash.events.*;
-	import flash.net.NetConnection;
-	import flash.net.NetStream;
-	import flash.media.Video;
-	import flash.media.SoundTransform;
-	import flash.utils.Timer;
-
-	import FlashMediaElement;
-	import HtmlMediaEvent;
-
-	public class VideoElement extends Sprite implements IMediaElement
-	{
-		private var _currentUrl:String = "";
-		private var _autoplay:Boolean = true;
-		private var _preload:String = "";
-		private var _isPreloading:Boolean = false;
-
-		private var _connection:NetConnection;
-		private var _stream:NetStream;
-		private var _video:Video;
-		private var _element:FlashMediaElement;
-		private var _soundTransform;
-		private var _oldVolume:Number = 1;
-
-		// event values
-		private var _duration:Number = 0;
-		private var _framerate:Number;
-		private var _isPaused:Boolean = true;
-		private var _isEnded:Boolean = false;
-		private var _volume:Number = 1;
-		private var _isMuted:Boolean = false;
-
-		private var _bytesLoaded:Number = 0;
-		private var _bytesTotal:Number = 0;
-		private var _bufferedTime:Number = 0;
-		private var _bufferEmpty:Boolean = false;
-
-		private var _videoWidth:Number = -1;
-		private var _videoHeight:Number = -1;
-
-		private var _timer:Timer;
-
-		private var _isRTMP:Boolean = false;
-		private var _isConnected:Boolean = false;
-		private var _playWhenConnected:Boolean = false;
-		private var _hasStartedPlaying:Boolean = false;
-
-		private var _parentReference:Object;
-
-		public function setReference(arg:Object):void {
-			_parentReference = arg;
-		}
-
-		public function setSize(width:Number, height:Number):void {
-			_video.width = width;
-			_video.height = height;
-		}
-
-		public function get video():Video {
-			return _video;
-		}
-
-		public function get videoHeight():Number {
-			return _videoHeight;
-		}
-
-		public function get videoWidth():Number {
-			return _videoWidth;
-		}
-
-
-		public function duration():Number {
-			return _duration;
-		}
-
-		public function currentProgress():Number {
-			if(_stream != null) {
-				return Math.round(_stream.bytesLoaded/_stream.bytesTotal*100);
-			} else {
-				return 0;
-			}
-		}
-
-		public function currentTime():Number {
-			if (_stream != null) {
-				return _stream.time;
-			} else {
-				return 0;
-			}
-		}
-
-
-		// (1) load()
-		// calls _connection.connect();
-		// waits for NetConnection.Connect.Success
-		// _stream gets created
-
-
-		public function VideoElement(element:FlashMediaElement, autoplay:Boolean, preload:String, timerRate:Number, startVolume:Number)
-		{
-			_element = element;
-			_autoplay = autoplay;
-			_volume = startVolume;
-			_preload = preload;
-
-			_video = new Video();
-			addChild(_video);
-
-			_connection = new NetConnection();
-			_connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
-			_connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
-			//_connection.connect(null);
-
-			_timer = new Timer(timerRate);
-			_timer.addEventListener("timer", timerHandler);
-
-		}
-
-		private function timerHandler(e:TimerEvent) {
-
-			_bytesLoaded = _stream.bytesLoaded;
-			_bytesTotal = _stream.bytesTotal;
-
-			if (!_isPaused)
-				sendEvent(HtmlMediaEvent.TIMEUPDATE);
-
-			//trace("bytes", _bytesLoaded, _bytesTotal);
-
-			if (_bytesLoaded < _bytesTotal)
-				sendEvent(HtmlMediaEvent.PROGRESS);
-		}
-
-		// internal events
-		private function netStatusHandler(event:NetStatusEvent):void {
-			trace("netStatus", event.info.code);
-
-			switch (event.info.code) {
-
-				case "NetStream.Buffer.Empty":
-					_bufferEmpty = true;
-					_isEnded ? sendEvent(HtmlMediaEvent.ENDED) : null;
-					break;
-
-				case "NetStream.Buffer.Full":
-					_bytesLoaded = _stream.bytesLoaded;
-					_bytesTotal = _stream.bytesTotal;
-					_bufferEmpty = false;
-
-					sendEvent(HtmlMediaEvent.PROGRESS);
-					break;
-
-				case "NetConnection.Connect.Success":
-					connectStream();
-					break;
-				case "NetStream.Play.StreamNotFound":
-					trace("Unable to locate video");
-					break;
-
-				// STREAM
-				case "NetStream.Play.Start":
-
-					_isPaused = false;
-					sendEvent(HtmlMediaEvent.LOADEDDATA);
-					sendEvent(HtmlMediaEvent.CANPLAY);
-
-					if (!_isPreloading) {
-
-						sendEvent(HtmlMediaEvent.PLAY);
-						sendEvent(HtmlMediaEvent.PLAYING);
-
-					}
-
-					_timer.start();
-
-					break;
-
-				case "NetStream.Seek.Notify":
-					sendEvent(HtmlMediaEvent.SEEKED);
-					break;
-
-				case "NetStream.Pause.Notify":
-					_isPaused = true;
-					sendEvent(HtmlMediaEvent.PAUSE);
-					break;
-
-				case "NetStream.Play.Stop":
-					_isEnded = true;
-					_isPaused = false;
-					_timer.stop();
-					_bufferEmpty ? sendEvent(HtmlMediaEvent.ENDED) : null;
-					break;
-
-			}
-		}
-
-
-		private function securityErrorHandler(event:SecurityErrorEvent):void {
-			trace("securityErrorHandler: " + event);
-		}
-
-		private function asyncErrorHandler(event:AsyncErrorEvent):void {
-			// ignore AsyncErrorEvent events.
-		}
-
-
-		private function onMetaDataHandler(info:Object):void {
-			_duration = info.duration;
-			_framerate = info.framerate;
-			_videoWidth = info.width;
-			_videoHeight = info.height;
-
-			// set size?
-
-			sendEvent(HtmlMediaEvent.LOADEDMETADATA);
-
-
-
-			if (_isPreloading) {
-
-				_stream.pause();
-				_isPaused = true;
-				_isPreloading = false;
-
-				sendEvent(HtmlMediaEvent.PROGRESS);
-				sendEvent(HtmlMediaEvent.TIMEUPDATE);
-
-			}
-		}
-
-
-
-
-		// interface members
-		public function setSrc(url:String):void {
-			if (_isConnected && _stream) {
-				// stop and restart
-				_stream.pause();
-			}
-
-			_currentUrl = url;
-			_isRTMP = !!_currentUrl.match(/^rtmp(s|t|e|te)?\:\/\//);
-			_isConnected = false;
-			_hasStartedPlaying = false;
-		}
-
-		public function load():void {
-			// disconnect existing stream and connection
-			if (_isConnected && _stream) {
-				_stream.pause();
-				_stream.close();
-				_connection.close();
-			}
-			_isConnected = false;
-			_isPreloading = false;
-
-
-			_isEnded = false;
-			_bufferEmpty = false;
-
-			// start new connection
-			if (_isRTMP) {
-				_connection.connect(_currentUrl.replace(/\/[^\/]+$/,"/"));
-			} else {
-				_connection.connect(null);
-			}
-
-			// in a few moments the "NetConnection.Connect.Success" event will fire
-			// and call createConnection which finishes the "load" sequence
-			sendEvent(HtmlMediaEvent.LOADSTART);
-		}
-
-
-		private function connectStream():void {
-			trace("connectStream");
-			_stream = new NetStream(_connection);
-
-			// explicitly set the sound since it could have come before the connection was made
-			_soundTransform = new SoundTransform(_volume);
-			_stream.soundTransform = _soundTransform;
-
-			_stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); // same event as connection
-			_stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
-
-			var customClient:Object = new Object();
-			customClient.onMetaData = onMetaDataHandler;
-			_stream.client = customClient;
-
-			_video.attachNetStream(_stream);
-
-			// start downloading without playing )based on preload and play() hasn't been called)
-			// I wish flash had a load() command to make this less awkward
-			if (_preload != "none" && !_playWhenConnected) {
-				_isPaused = true;
-				//stream.bufferTime = 20;
-				_stream.play(_currentUrl, 0, 0);
-				_stream.pause();
-
-				_isPreloading = true;
-
-				//_stream.pause();
-				//
-				//sendEvent(HtmlMediaEvent.PAUSE); // have to send this because the "playing" event gets sent via event handlers
-			}
-
-			_isConnected = true;
-
-			if (_playWhenConnected && !_hasStartedPlaying) {
-				play();
-				_playWhenConnected = false;
-			}
-
-		}
-
-		public function play():void {
-
-			if (!_hasStartedPlaying && !_isConnected) {
-				_playWhenConnected = true;
-				load();
-				return;
-			}
-
-			if (_hasStartedPlaying) {
-				if (_isPaused) {
-					_stream.resume();
-					_timer.start();
-					_isPaused = false;
-					sendEvent(HtmlMediaEvent.PLAY);
-					sendEvent(HtmlMediaEvent.PLAYING);
-				}
-			} else {
-
-				if (_isRTMP) {
-					_stream.play(_currentUrl.split("/").pop());
-				} else {
-					_stream.play(_currentUrl);
-				}
-				_timer.start();
-				_isPaused = false;
-				_hasStartedPlaying = true;
-
-				// don't toss play/playing events here, because we haven't sent a
-				// canplay / loadeddata event yet. that'll be handled in the net
-				// event listener
-			}
-
-		}
-
-		public function pause():void {
-			if (_stream == null)
-				return;
-
-			_stream.pause();
-			_isPaused = true;
-
-			if (_bytesLoaded == _bytesTotal) {
-				_timer.stop();
-			}
-
-			_isPaused = true;
-			sendEvent(HtmlMediaEvent.PAUSE);
-		}
-
-		public function stop():void {
-			if (_stream == null)
-				return;
-
-			_stream.close();
-			_isPaused = false;
-			_timer.stop();
-			sendEvent(HtmlMediaEvent.STOP);
-		}
-
-		public function setCurrentTime(pos:Number):void {
-			if (_stream == null)
-				return;
-
-			sendEvent(HtmlMediaEvent.SEEKING);
-			_stream.seek(pos);
-			sendEvent(HtmlMediaEvent.TIMEUPDATE);
-		}
-
-		public function setVolume(volume:Number):void {
-			if (_stream != null) {
-				_soundTransform = new SoundTransform(volume);
-				_stream.soundTransform = _soundTransform;
-			}
-
-			_volume = volume;
-
-			_isMuted = (_volume == 0);
-
-			sendEvent(HtmlMediaEvent.VOLUMECHANGE);
-		}
-
-		public function getVolume():Number {
-			if(_isMuted) {
-				return 0;
-			} else {
-				return _volume;
-			}
-		}
-
-		public function setMuted(muted:Boolean):void {
-
-			if (_isMuted == muted)
-				return;
-
-			if (muted) {
-				_oldVolume = (_stream == null) ? _oldVolume : _stream.soundTransform.volume;
-				setVolume(0);
-			} else {
-				setVolume(_oldVolume);
-			}
-
-			_isMuted = muted;
-		}
-
-
-		private function sendEvent(eventName:String) {
-
-			// calculate this to mimic HTML5
-			_bufferedTime = _bytesLoaded / _bytesTotal * _duration;
-
-			// build JSON
-			var values:String =
-							"duration:" + _duration +
-							",framerate:" + _framerate +
-							",currentTime:" + (_stream != null ? _stream.time : 0) +
-							",muted:" + _isMuted +
-							",paused:" + _isPaused +
-							",ended:" + _isEnded +
-							",volume:" + _volume +
-							",src:\"" + _currentUrl + "\"" +
-							",bytesTotal:" + _bytesTotal +
-							",bufferedBytes:" + _bytesLoaded +
-							",bufferedTime:" + _bufferedTime +
-							",videoWidth:" + _videoWidth +
-							",videoHeight:" + _videoHeight +
-							"";
-
-			_element.sendEvent(eventName, values);
-		}
-	}
+package htmlelements
+{
+	import flash.display.Sprite;
+	import flash.events.*;
+	import flash.net.NetConnection;
+	import flash.net.NetStream;
+	import flash.media.Video;
+	import flash.media.SoundTransform;
+	import flash.utils.Timer;
+
+	import FlashMediaElement;
+	import HtmlMediaEvent;
+
+	public class VideoElement extends Sprite implements IMediaElement
+	{
+		private var _currentUrl:String = "";
+		private var _autoplay:Boolean = true;
+		private var _preload:String = "";
+		private var _isPreloading:Boolean = false;
+
+		private var _connection:NetConnection;
+		private var _stream:NetStream;
+		private var _video:Video;
+		private var _element:FlashMediaElement;
+		private var _soundTransform;
+		private var _oldVolume:Number = 1;
+
+		// event values
+		private var _duration:Number = 0;
+		private var _framerate:Number;
+		private var _isPaused:Boolean = true;
+		private var _isEnded:Boolean = false;
+		private var _volume:Number = 1;
+		private var _isMuted:Boolean = false;
+
+		private var _bytesLoaded:Number = 0;
+		private var _bytesTotal:Number = 0;
+		private var _bufferedTime:Number = 0;
+		private var _bufferEmpty:Boolean = false;
+
+		private var _videoWidth:Number = -1;
+		private var _videoHeight:Number = -1;
+
+		private var _timer:Timer;
+
+		private var _isRTMP:Boolean = false;
+		private var _isConnected:Boolean = false;
+		private var _playWhenConnected:Boolean = false;
+		private var _hasStartedPlaying:Boolean = false;
+
+		private var _parentReference:Object;
+
+		public function setReference(arg:Object):void {
+			_parentReference = arg;
+		}
+
+		public function setSize(width:Number, height:Number):void {
+			_video.width = width;
+			_video.height = height;
+		}
+
+		public function get video():Video {
+			return _video;
+		}
+
+		public function get videoHeight():Number {
+			return _videoHeight;
+		}
+
+		public function get videoWidth():Number {
+			return _videoWidth;
+		}
+
+
+		public function duration():Number {
+			return _duration;
+		}
+
+		public function currentProgress():Number {
+			if(_stream != null) {
+				return Math.round(_stream.bytesLoaded/_stream.bytesTotal*100);
+			} else {
+				return 0;
+			}
+		}
+
+		public function currentTime():Number {
+			if (_stream != null) {
+				return _stream.time;
+			} else {
+				return 0;
+			}
+		}
+
+
+		// (1) load()
+		// calls _connection.connect();
+		// waits for NetConnection.Connect.Success
+		// _stream gets created
+
+
+		public function VideoElement(element:FlashMediaElement, autoplay:Boolean, preload:String, timerRate:Number, startVolume:Number)
+		{
+			_element = element;
+			_autoplay = autoplay;
+			_volume = startVolume;
+			_preload = preload;
+
+			_video = new Video();
+			addChild(_video);
+
+			_connection = new NetConnection();
+			_connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
+			_connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
+			//_connection.connect(null);
+
+			_timer = new Timer(timerRate);
+			_timer.addEventListener("timer", timerHandler);
+
+		}
+
+		private function timerHandler(e:TimerEvent) {
+
+			_bytesLoaded = _stream.bytesLoaded;
+			_bytesTotal = _stream.bytesTotal;
+
+			if (!_isPaused)
+				sendEvent(HtmlMediaEvent.TIMEUPDATE);
+
+			//trace("bytes", _bytesLoaded, _bytesTotal);
+
+			if (_bytesLoaded < _bytesTotal)
+				sendEvent(HtmlMediaEvent.PROGRESS);
+		}
+
+		// internal events
+		private function netStatusHandler(event:NetStatusEvent):void {
+			trace("netStatus", event.info.code);
+
+			switch (event.info.code) {
+
+				case "NetStream.Buffer.Empty":
+					_bufferEmpty = true;
+					_isEnded ? sendEvent(HtmlMediaEvent.ENDED) : null;
+					break;
+
+				case "NetStream.Buffer.Full":
+					_bytesLoaded = _stream.bytesLoaded;
+					_bytesTotal = _stream.bytesTotal;
+					_bufferEmpty = false;
+
+					sendEvent(HtmlMediaEvent.PROGRESS);
+					break;
+
+				case "NetConnection.Connect.Success":
+					connectStream();
+					break;
+				case "NetStream.Play.StreamNotFound":
+					trace("Unable to locate video");
+					break;
+
+				// STREAM
+				case "NetStream.Play.Start":
+
+					_isPaused = false;
+					sendEvent(HtmlMediaEvent.LOADEDDATA);
+					sendEvent(HtmlMediaEvent.CANPLAY);
+
+					if (!_isPreloading) {
+
+						sendEvent(HtmlMediaEvent.PLAY);
+						sendEvent(HtmlMediaEvent.PLAYING);
+
+					}
+
+					_timer.start();
+
+					break;
+
+				case "NetStream.Seek.Notify":
+					sendEvent(HtmlMediaEvent.SEEKED);
+					break;
+
+				case "NetStream.Pause.Notify":
+					_isPaused = true;
+					sendEvent(HtmlMediaEvent.PAUSE);
+					break;
+
+				case "NetStream.Play.Stop":
+					_isEnded = true;
+					_isPaused = false;
+					_timer.stop();
+					_bufferEmpty ? sendEvent(HtmlMediaEvent.ENDED) : null;
+					break;
+
+			}
+		}
+
+
+		private function securityErrorHandler(event:SecurityErrorEvent):void {
+			trace("securityErrorHandler: " + event);
+		}
+
+		private function asyncErrorHandler(event:AsyncErrorEvent):void {
+			// ignore AsyncErrorEvent events.
+		}
+
+
+		private function onMetaDataHandler(info:Object):void {
+			_duration = info.duration;
+			_framerate = info.framerate;
+			_videoWidth = info.width;
+			_videoHeight = info.height;
+
+			// set size?
+
+			sendEvent(HtmlMediaEvent.LOADEDMETADATA);
+
+
+
+			if (_isPreloading) {
+
+				_stream.pause();
+				_isPaused = true;
+				_isPreloading = false;
+
+				sendEvent(HtmlMediaEvent.PROGRESS);
+				sendEvent(HtmlMediaEvent.TIMEUPDATE);
+
+			}
+		}
+
+
+
+
+		// interface members
+		public function setSrc(url:String):void {
+			if (_isConnected && _stream) {
+				// stop and restart
+				_stream.pause();
+			}
+
+			_currentUrl = url;
+			_isRTMP = !!_currentUrl.match(/^rtmp(s|t|e|te)?\:\/\//);
+			_isConnected = false;
+			_hasStartedPlaying = false;
+		}
+
+		public function load():void {
+			// disconnect existing stream and connection
+			if (_isConnected && _stream) {
+				_stream.pause();
+				_stream.close();
+				_connection.close();
+			}
+			_isConnected = false;
+			_isPreloading = false;
+
+
+			_isEnded = false;
+			_bufferEmpty = false;
+
+			// start new connection
+			if (_isRTMP) {
+				_connection.connect(_currentUrl.replace(/\/[^\/]+$/,"/"));
+			} else {
+				_connection.connect(null);
+			}
+
+			// in a few moments the "NetConnection.Connect.Success" event will fire
+			// and call createConnection which finishes the "load" sequence
+			sendEvent(HtmlMediaEvent.LOADSTART);
+		}
+
+
+		private function connectStream():void {
+			trace("connectStream");
+			_stream = new NetStream(_connection);
+
+			// explicitly set the sound since it could have come before the connection was made
+			_soundTransform = new SoundTransform(_volume);
+			_stream.soundTransform = _soundTransform;
+
+			_stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); // same event as connection
+			_stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
+
+			var customClient:Object = new Object();
+			customClient.onMetaData = onMetaDataHandler;
+			_stream.client = customClient;
+
+			_video.attachNetStream(_stream);
+
+			// start downloading without playing )based on preload and play() hasn't been called)
+			// I wish flash had a load() command to make this less awkward
+			if (_preload != "none" && !_playWhenConnected) {
+				_isPaused = true;
+				//stream.bufferTime = 20;
+				_stream.play(_currentUrl, 0, 0);
+				_stream.pause();
+
+				_isPreloading = true;
+
+				//_stream.pause();
+				//
+				//sendEvent(HtmlMediaEvent.PAUSE); // have to send this because the "playing" event gets sent via event handlers
+			}
+
+			_isConnected = true;
+
+			if (_playWhenConnected && !_hasStartedPlaying) {
+				play();
+				_playWhenConnected = false;
+			}
+
+		}
+
+		public function play():void {
+
+			if (!_hasStartedPlaying && !_isConnected) {
+				_playWhenConnected = true;
+				load();
+				return;
+			}
+
+			if (_hasStartedPlaying) {
+				if (_isPaused) {
+					_stream.resume();
+					_timer.start();
+					_isPaused = false;
+					sendEvent(HtmlMediaEvent.PLAY);
+					sendEvent(HtmlMediaEvent.PLAYING);
+				}
+			} else {
+
+				if (_isRTMP) {
+					_stream.play(_currentUrl.split("/").pop());
+				} else {
+					_stream.play(_currentUrl);
+				}
+				_timer.start();
+				_isPaused = false;
+				_hasStartedPlaying = true;
+
+				// don't toss play/playing events here, because we haven't sent a
+				// canplay / loadeddata event yet. that'll be handled in the net
+				// event listener
+			}
+
+		}
+
+		public function pause():void {
+			if (_stream == null)
+				return;
+
+			_stream.pause();
+			_isPaused = true;
+
+			if (_bytesLoaded == _bytesTotal) {
+				_timer.stop();
+			}
+
+			_isPaused = true;
+			sendEvent(HtmlMediaEvent.PAUSE);
+		}
+
+		public function stop():void {
+			if (_stream == null)
+				return;
+
+			_stream.close();
+			_isPaused = false;
+			_timer.stop();
+			sendEvent(HtmlMediaEvent.STOP);
+		}
+
+		public function setCurrentTime(pos:Number):void {
+			if (_stream == null)
+				return;
+
+			sendEvent(HtmlMediaEvent.SEEKING);
+			_stream.seek(pos);
+			sendEvent(HtmlMediaEvent.TIMEUPDATE);
+		}
+
+		public function setVolume(volume:Number):void {
+			if (_stream != null) {
+				_soundTransform = new SoundTransform(volume);
+				_stream.soundTransform = _soundTransform;
+			}
+
+			_volume = volume;
+
+			_isMuted = (_volume == 0);
+
+			sendEvent(HtmlMediaEvent.VOLUMECHANGE);
+		}
+
+		public function getVolume():Number {
+			if(_isMuted) {
+				return 0;
+			} else {
+				return _volume;
+			}
+		}
+
+		public function setMuted(muted:Boolean):void {
+
+			if (_isMuted == muted)
+				return;
+
+			if (muted) {
+				_oldVolume = (_stream == null) ? _oldVolume : _stream.soundTransform.volume;
+				setVolume(0);
+			} else {
+				setVolume(_oldVolume);
+			}
+
+			_isMuted = muted;
+		}
+
+
+		private function sendEvent(eventName:String) {
+
+			// calculate this to mimic HTML5
+			_bufferedTime = _bytesLoaded / _bytesTotal * _duration;
+
+			// build JSON
+			var values:String =
+							"duration:" + _duration +
+							",framerate:" + _framerate +
+							",currentTime:" + (_stream != null ? _stream.time : 0) +
+							",muted:" + _isMuted +
+							",paused:" + _isPaused +
+							",ended:" + _isEnded +
+							",volume:" + _volume +
+							",src:\"" + _currentUrl + "\"" +
+							",bytesTotal:" + _bytesTotal +
+							",bufferedBytes:" + _bytesLoaded +
+							",bufferedTime:" + _bufferedTime +
+							",videoWidth:" + _videoWidth +
+							",videoHeight:" + _videoHeight +
+							"";
+
+			_element.sendEvent(eventName, values);
+		}
+	}
 }


added stream time adjustments for better buffering

--- src/flash/htmlelements/VideoElement.as
+++ src/flash/htmlelements/VideoElement.as
@@ -289,7 +289,11 @@

 			// explicitly set the sound since it could have come before the connection was made
 			_soundTransform = new SoundTransform(_volume);
-			_stream.soundTransform = _soundTransform;
+			_stream.soundTransform = _soundTransform;
+
+			// set the buffer to ensure nice playback
+			_stream.bufferTime = 1;
+			_stream.bufferTimeMax = 3;

 			_stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); // same event as connection
 			_stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);


define a static const default effect for the RealisticMaterial and use it properly in the constructor

--- src/aerys/minko/render/material/realistic/RealisticMaterial.as
+++ src/aerys/minko/render/material/realistic/RealisticMaterial.as
@@ -13,7 +13,9 @@
 	public class RealisticMaterial extends PhongMaterial
 	{
 		private static const DEFAULT_NAME		: String		= 'RealisticMaterial';
-		private static const SCENE_TO_EFFECT	: Dictionary	= new Dictionary(true);
+        private static const DEFAULT_EFFECT     : Effect        = new PhongEffect(
+            new RealisticShader()
+        );

 		public function get environmentMap() : ITextureResource
 		{
@@ -91,7 +93,7 @@
 										  effect		: Effect	= null,
 										  name			: String	= DEFAULT_NAME)
 		{
-			super(properties, effect || new PhongEffect(new RealisticShader()), name);
+			super(properties, effect || DEFAULT_EFFECT, name);
 		}

         override public function clone() : IDataProvider


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

--- frameworks/projects/advancedgrids/src/mx/collections/DefaultSummaryCalculator.as
+++ frameworks/projects/advancedgrids/src/mx/collections/DefaultSummaryCalculator.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: 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@1251573 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/automation/src/mx/automation/events/AutomationRecordEvent.as
+++ frameworks/projects/automation/src/mx/automation/events/AutomationRecordEvent.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.automation.events
 {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

--- frameworks/projects/spark/src/spark/effects/supportClasses/CallActionInstance.as
+++ frameworks/projects/spark/src/spark/effects/supportClasses/CallActionInstance.as
@@ -21,6 +21,11 @@
  *  effect; you do not create one yourself.
  *
  *  @see flex.effects.CallFunctionAction
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 public class CallActionInstance extends ActionEffectInstance
 {
@@ -36,6 +41,11 @@
      *  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 CallActionInstance(target:Object)
     {
@@ -54,6 +64,11 @@

     /**
      * Function that will be called on the target when this effect plays
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public var functionName:String;

@@ -64,6 +79,11 @@
     /**
      * Parameters that will be supplied to the function that is called
      * by this effect
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public var parameters:Array;


mkcd.

mkcd.

	* build-aux/base.as (mkcd): New.
	(URBI_INIT): Check the dirs we know for sure.
	Trap the signals.

--- build-aux/base.as
+++ build-aux/base.as
@@ -286,6 +286,17 @@

 m4_defun([_URBI_PREPARE],
 [
+# mkcd DIR
+# --------
+# Remove, create, and cd into DIR.
+mkcd ()
+{
+  local dir=$1
+  rm -rf "$dir"
+  mkdir -p "$dir"
+  cd "$dir"
+}
+
 # truth TEST-ARGUMENTS...
 # -----------------------
 # Run "test TEST-ARGUMENTS" and echo true/false depending on the result.
@@ -333,9 +344,19 @@
 : ${abs_builddir='@abs_builddir@'}
 : ${abs_srcdir='@abs_srcdir@'}
 : ${abs_top_builddir='@abs_top_builddir@'}
+check_dir abs_top_builddir config.status
 : ${abs_top_srcdir='@abs_top_srcdir@'}
+check_dir abs_top_srcdir configure.ac
 : ${builddir='@builddir@'}
 : ${srcdir='@srcdir@'}
 : ${top_builddir='@top_builddir@'}
+check_dir top_builddir config.status
 : ${top_srcdir='@top_srcdir@'}
-])
+check_dir top_srcdir configure.ac
+
+# Bounce the signals to trap 0, passing the signal as exit value.
+for signal in 1 2 13 15; do
+  trap 'error $((128 + $signal)) \
+	      "received signal $signal ($(kill -l $signal))"' $signal
+done
+])