Transferred from the Adobe Open Source Subversion Repository

Revision: 19830
Author:   smgilson@adobe.com
Date:     2011-01-20T17:49:51.514869Z

Log Message:
-----------
Minor ASDoc edits

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

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/framework/src/mx/core/InteractionMode.as</path>

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

--- frameworks/projects/framework/src/mx/core/InteractionMode.as
+++ frameworks/projects/framework/src/mx/core/InteractionMode.as
@@ -13,8 +13,8 @@
 {

     /**
-     *  Values for the interactionMode property
-     *  of the UIComponent classes.
+     *  The InteractionMode class defines the alues for the
+     *  interactionMode property of the UIComponent class.
      *
      *  @see mx.core.Container
      *  @see mx.core.ScrollControlBase


Update src/aerys/minko/type/MouseManager.as

Fixed bug in middle mouse button handler.

--- src/aerys/minko/type/MouseManager.as
+++ src/aerys/minko/type/MouseManager.as
@@ -142,12 +142,12 @@

 		private function mouseMiddleDownHandler(event : MouseEvent) : void
 		{
-			_rightButtonDown = true;
+			_middleButtonDown = true;
 		}

 		private function mouseMiddleUpHandler(event : MouseEvent) : void
 		{
-			_rightButtonDown = false;
+			_middleButtonDown = false;
 		}

 		private function mouseRightDownHandler(event : MouseEvent) : void


Rename `api' parameter to `streamio:api'.

--- src/goplayer/ConfigurationParser.as
+++ src/goplayer/ConfigurationParser.as
@@ -2,13 +2,13 @@
 {
   public class ConfigurationParser
   {
-    public static const DEFAULT_API_URL : String
+    public static const DEFAULT_STREAMIO_API_URL : String
       = "http://staging.streamio.com/api"
     public static const DEFAULT_SKIN_URL : String = "goplayer-skin.swf"
     public static const DEFAULT_TRACKER_ID : String = "global"

     public static const VALID_PARAMETERS : Array = [
-      "api", "tracker", "skin", "video", "bitrate",
+      "streamio:api", "tracker", "skin", "video", "bitrate",
       "enablertmp", "autoplay", "loop",
       "skin:showchrome", "skin:showtitle" ]

@@ -26,7 +26,7 @@

     public function execute() : void
     {
-      result.apiURL = getString("api", DEFAULT_API_URL)
+      result.apiURL = getString("streamio:api", DEFAULT_STREAMIO_API_URL)
       result.trackerID = getString("tracker", DEFAULT_TRACKER_ID)
       result.skinURL = getString("skin", DEFAULT_SKIN_URL)
       result.movieID = getString("video", null)


Factor out a get_param_addr function.

Factor out a get_param_addr function.

This gets an address spec from a movie parameter, parses it and returns
the address.

--- swfcat.as
+++ swfcat.as
@@ -152,19 +152,26 @@
                 addChild(cur_client_count_tf);
             }

-            fac_spec = this.loaderInfo.parameters["facilitator"];
-            if (fac_spec) {
-                puts("Facilitator spec: \"" + fac_spec + "\"");
-                fac_addr = parse_addr_spec(fac_spec);
-                if (!fac_addr) {
-                    puts("Error: Facilitator spec must be in the form \"host:port\".");
-                    return;
-                }
-            } else {
-                fac_addr = DEFAULT_FACILITATOR_ADDR;
+            fac_addr = get_param_addr("facilitator", DEFAULT_FACILITATOR_ADDR);
+            if (!fac_addr) {
+                puts("Error: Facilitator spec must be in the form \"host:port\".");
+                return;
             }

             main();
+        }
+
+        /* Get an address structure from the given movie parameter, or the given
+           default. Returns null on error. */
+        private function get_param_addr(param:String, default_addr:Object):Object
+        {
+            var spec:String, addr:Object;
+
+            spec = this.loaderInfo.parameters[param];
+            if (spec)
+                return parse_addr_spec(spec);
+            else
+                return default_addr;
         }

         /* The main logic begins here, after start-up issues are taken care of. */


Do RTMFP client and proxy using the new RTMFPSocket and ProxyPair.

--- swfcat.as
+++ swfcat.as
@@ -5,26 +5,24 @@
     import flash.display.StageScaleMode;
     import flash.text.TextField;
     import flash.text.TextFormat;
+    import flash.net.Socket;
+    import flash.net.URLLoader;
+    import flash.net.URLLoaderDataFormat;
+    import flash.net.URLRequest;
+    import flash.net.URLRequestMethod;
+    import flash.net.URLVariables;
     import flash.events.Event;
+    import flash.events.IOErrorEvent;
+    import flash.events.SecurityErrorEvent;
     import flash.utils.setTimeout;
-
-    import FacilitatorSocket;
-    import events.FacilitatorSocketEvent;
-
-    import ProxyPair;
-    import RTMFPProxyPair;
-    import TCPProxyPair;
-
-    import rtmfp.CirrusSocket;
-    import rtmfp.events.CirrusSocketEvent;

     public class swfcat extends Sprite
     {
         /* Adobe's Cirrus server for RTMFP connections.
            The Cirrus key is defined at compile time by
            reading from the CIRRUS_KEY environment var. */
-        private const DEFAULT_CIRRUS_ADDR:String = "rtmfp://p2p.rtmfp.net";
-        private const DEFAULT_CIRRUS_KEY:String = RTMFP::CIRRUS_KEY;
+        private const CIRRUS_URL:String = "rtmfp://p2p.rtmfp.net";
+        private const CIRRUS_KEY:String = RTMFP::CIRRUS_KEY;

         private const DEFAULT_FACILITATOR_ADDR:Object = {
             host: "tor-facilitator.bamsoftware.com",
@@ -47,17 +45,6 @@
         // Seconds.
         private const RATE_LIMIT_HISTORY:Number = 5.0;

-        // Socket to Cirrus server
-        private var s_c:CirrusSocket;
-        // Socket to facilitator.
-        private var s_f:FacilitatorSocket;
-        // Handle local-remote traffic
-        private var p_p:ProxyPair;
-
-        private var client_id:String;
-        private var proxy_pair_factory:Function;
-        private var relay_addr:Object;
-
         private var proxy_mode:Boolean;

         /* TextField for debug output. */
@@ -124,7 +111,10 @@
                 return;
             }

-            main();
+            if (proxy_mode)
+                proxy_main();
+            else
+                client_main();
         }

         /* Get an address structure from the given movie parameter, or the given
@@ -141,129 +131,171 @@
         }

         /* The main logic begins here, after start-up issues are taken care of. */
-        private function main():void
-        {
-            if (proxy_mode) {
-                establish_facilitator_connection();
-            } else {
-                establish_cirrus_connection();
-            }
-        }
-
-        private function establish_cirrus_connection():void
-        {
-            s_c = new CirrusSocket();
-            s_c.addEventListener(CirrusSocketEvent.CONNECT_SUCCESS, function (e:CirrusSocketEvent):void {
-                puts("Cirrus: connected with id " + s_c.id + ".");
-                if (proxy_mode) {
-                    start_proxy_pair();
-                    s_c.send_hello(client_id);
-                } else {
-                    establish_facilitator_connection();
-                }
-            });
-            s_c.addEventListener(CirrusSocketEvent.CONNECT_FAILED, function (e:CirrusSocketEvent):void {
-                puts("Error: failed to connect to Cirrus.");
-            });
-            s_c.addEventListener(CirrusSocketEvent.CONNECT_CLOSED, function (e:CirrusSocketEvent):void {
-                puts("Cirrus: closed connection.");
-            });
-            s_c.addEventListener(CirrusSocketEvent.HELLO_RECEIVED, function (e:CirrusSocketEvent):void {
-                puts("Cirrus: received hello from peer " + e.peer);
-
-                /* don't bother if we already have a proxy going */
-                if (p_p != null && p_p.connected) {
-                    return;
-                }
-
-                /* if we're in proxy mode, we should have already set
-                   up a proxy pair */
-                if (!proxy_mode) {
-                    relay_addr = DEFAULT_TOR_CLIENT_ADDR;
-                    proxy_pair_factory = rtmfp_proxy_pair_factory;
-                    start_proxy_pair();
-                    s_c.send_hello(e.peer);
-                } else {
-                    num_proxy_pairs++;
-                    badge.proxy_begin();
-                }
-
-                p_p.client = {peer: e.peer, stream: e.stream};
-            });
-
-            s_c.connect(DEFAULT_CIRRUS_ADDR, DEFAULT_CIRRUS_KEY);
-        }
-
-        private function establish_facilitator_connection():void
-        {
-            s_f = new FacilitatorSocket(fac_addr.host, fac_addr.port);
-            s_f.addEventListener(FacilitatorSocketEvent.CONNECT_FAILED, function (e:Event):void {
-                puts("Facilitator: connect failed.");
-                setTimeout(establish_facilitator_connection, FACILITATOR_POLL_INTERVAL);
-            });
-
-            if (proxy_mode) {
-                s_f.addEventListener(FacilitatorSocketEvent.REGISTRATION_RECEIVED, function (e:FacilitatorSocketEvent):void {
-                    var client_addr:Object = parse_addr_spec(e.client);
-                    relay_addr = parse_addr_spec(e.relay);
-                    if (client_addr == null) {
-                        puts("Facilitator: got registration " + e.client);
-                        proxy_pair_factory = rtmfp_proxy_pair_factory;
-                        if (s_c == null || !s_c.connected) {
-                            client_id = e.client;
-                            establish_cirrus_connection();
-                        } else {
-                            start_proxy_pair();
-                            s_c.send_hello(e.client);
-                        }
-                    } else {
-                        proxy_pair_factory = tcp_proxy_pair_factory;
-                        start_proxy_pair();
-                        p_p.client = client_addr;
-                    }
+        private function proxy_main():void
+        {
+            var fac_url:String;
+            var loader:URLLoader;
+
+            if (num_proxy_pairs >= MAX_NUM_PROXY_PAIRS) {
+                setTimeout(proxy_main, FACILITATOR_POLL_INTERVAL);
+                return;
+            }
+
+            loader = new URLLoader();
+            /* Get the x-www-form-urlencoded values. */
+            loader.dataFormat = URLLoaderDataFormat.VARIABLES;
+            loader.addEventListener(Event.COMPLETE, fac_complete);
+            loader.addEventListener(IOErrorEvent.IO_ERROR, function (e:IOErrorEvent):void {
+                puts("Facilitator: I/O error: " + e.text + ".");
+            });
+            loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, function (e:SecurityErrorEvent):void {
+                puts("Facilitator: security error: " + e.text + ".");
+            });
+
+            fac_url = "http://" + encodeURIComponent(fac_addr.host)
+                + ":" + encodeURIComponent(fac_addr.port) + "/";
+            puts("Facilitator: connecting to " + fac_url + ".");
+            loader.load(new URLRequest(fac_url));
+        }
+
+        private function fac_complete(e:Event):void
+        {
+            var loader:URLLoader;
+            var client_spec:String;
+            var relay_spec:String;
+            var proxy_pair:Object;
+
+            setTimeout(proxy_main, FACILITATOR_POLL_INTERVAL);
+
+            loader = e.target as URLLoader;
+            client_spec = loader.data.client;
+            if (client_spec == "") {
+                puts("No clients.");
+                return;
+            } else if (!client_spec) {
+                puts("Error: missing \"client\" in response.");
+                return;
+            }
+            relay_spec = loader.data.relay;
+            if (!relay_spec) {
+                puts("Error: missing \"relay\" in response.");
+                return;
+            }
+            puts("Facilitator: got client:\"" + client_spec + "\" "
+                + "relay:\"" + relay_spec + "\".");
+
+            try {
+                proxy_pair = make_proxy_pair(client_spec, relay_spec);
+            } catch (e:ArgumentError) {
+                puts("Error: " + e);
+                return;
+            }
+            proxy_pair.addEventListener(Event.COMPLETE, function(e:Event):void {
+                proxy_pair.log("Complete.");
+                num_proxy_pairs--;
+                badge.proxy_end();
+            });
+            proxy_pair.connect();
+
+            num_proxy_pairs++;
+            badge.proxy_begin();
+        }
+
+        private function client_main():void
+        {
+            var rs:RTMFPSocket;
+
+            rs = new RTMFPSocket(CIRRUS_URL, CIRRUS_KEY);
+            rs.addEventListener(Event.COMPLETE, function (e:Event):void {
+                puts("Got RTMFP id " + rs.id);
+                register(rs);
+            });
+            rs.addEventListener(RTMFPSocket.ACCEPT_EVENT, client_accept);
+
+            rs.listen();
+        }
+
+        private function client_accept(e:Event):void {
+            var rs:RTMFPSocket;
+            var s_t:Socket;
+            var proxy_pair:ProxyPair;
+
+            rs = e.target as RTMFPSocket;
+            s_t = new Socket();
+
+            puts("Got RTMFP connection from " + rs.peer_id);
+
+            proxy_pair = new ProxyPair(this, rs, function ():void {
+                /* Do nothing; already connected. */
+            }, s_t, function ():void {
+                s_t.connect(DEFAULT_TOR_CLIENT_ADDR.host, DEFAULT_TOR_CLIENT_ADDR.port);
+            });
+            proxy_pair.connect();
+        }
+
+        private function register(rs:RTMFPSocket):void {
+            var fac_url:String;
+            var loader:URLLoader;
+            var request:URLRequest;
+            var variables:URLVariables;
+
+            loader = new URLLoader();
+            loader.addEventListener(Event.COMPLETE, function (e:Event):void {
+                puts("Facilitator: registered.");
+            });
+            loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, function (e:SecurityErrorEvent):void {
+                puts("Facilitator: security error: " + e.text + ".");
+                rs.close();
+            });
+            loader.addEventListener(IOErrorEvent.IO_ERROR, function (e:IOErrorEvent):void {
+                puts("Facilitator: I/O error: " + e.text + ".");
+                rs.close();
+            });
+
+            fac_url = "http://" + encodeURIComponent(fac_addr.host)
+                + ":" + encodeURIComponent(fac_addr.port) + "/";
+            request = new URLRequest(fac_url);
+            request.method = URLRequestMethod.POST;
+            request.data = new URLVariables;
+            request.data["client"] = rs.id;
+
+            puts("Facilitator: connecting to " + fac_url + ".");
+            loader.load(request);
+        }
+
+        private function make_proxy_pair(client_spec:String, relay_spec:String):ProxyPair
+        {
+            var addr_c:Object;
+            var addr_r:Object;
+            var s_c:*;
+            var s_r:Socket;
+
+            addr_r = swfcat.parse_addr_spec(relay_spec);
+            if (!addr_r)
+                throw new ArgumentError("Relay spec must be in the form \"host:port\".");
+
+            addr_c = swfcat.parse_addr_spec(client_spec);
+            if (addr_c) {
+                s_c = new Socket();
+                s_r = new Socket();
+                return new ProxyPair(this, s_c, function ():void {
+                    s_c.connect(addr_c.host, addr_c.port);
+                }, s_r, function ():void {
+                    s_r.connect(addr_r.host, addr_r.port);
                 });
-                s_f.addEventListener(FacilitatorSocketEvent.REGISTRATIONS_EMPTY, function (e:Event):void {
-                    puts("Facilitator: no registrations available.");
-                    setTimeout(establish_facilitator_connection, FACILITATOR_POLL_INTERVAL);
+            }
+
+            if (client_spec.match(/^[0-9A-Fa-f]{64}$/)) {
+                s_c = new RTMFPSocket(CIRRUS_URL, CIRRUS_KEY);
+                s_r = new Socket();
+                return new ProxyPair(this, s_c, function ():void {
+                    s_c.connect(client_spec);
+                }, s_r, function ():void {
+                    s_r.connect(addr_r.host, addr_r.port);
                 });
-                puts("Facilitator: getting registration.");
-                s_f.get_registration();
-            } else {
-                s_f.addEventListener(FacilitatorSocketEvent.REGISTRATION_FAILED, function (e:Event):void {
-                    puts("Facilitator: registration failed.");
-                    setTimeout(establish_facilitator_connection, FACILITATOR_POLL_INTERVAL);
-                });
-                puts("Facilitator: posting registration.");
-                s_f.post_registration(s_c.id);
-            }
-        }
-
-        private function start_proxy_pair():void
-        {
-            p_p = proxy_pair_factory();
-            p_p.addEventListener(Event.CONNECT, function (e:Event):void {
-                puts("ProxyPair: connected!");
-            });
-            p_p.addEventListener(Event.CLOSE, function (e:Event):void {
-                puts("ProxyPair: connection closed.");
-                p_p = null;
-                if (proxy_mode) {
-                    num_proxy_pairs--;
-                    badge.proxy_end();
-                }
-                establish_facilitator_connection();
-            });
-            p_p.relay = relay_addr;
-        }
-
-        private function rtmfp_proxy_pair_factory():ProxyPair
-        {
-            return new RTMFPProxyPair(this, s_c, s_c.local_stream_name);
-        }
-
-        private function tcp_proxy_pair_factory():ProxyPair
-        {
-            return new TCPProxyPair(this);
+            }
+
+            throw new ArgumentError("Can't parse client spec \"" + client_spec + "\".");
         }

         /* Parse an address in the form "host:port". Returns an Object with


Rearranging.

Rearranging.

--- swfcat.as
+++ swfcat.as
@@ -18,10 +18,10 @@
             port: 9001
         };

-        private var output_text:TextField;
-
         // Socket to facilitator.
         private var s_f:Socket;
+
+        private var output_text:TextField;

         public function puts(s:String):void
         {


Reschedule a facilitator connection upon close, not upon data read.

--- swfcat.as
+++ swfcat.as
@@ -78,6 +78,7 @@
             s_f.addEventListener(Event.CONNECT, fac_connected);
             s_f.addEventListener(Event.CLOSE, function (e:Event):void {
                 puts("Facilitator: closed connection.");
+                setTimeout(main, FACILITATOR_POLL_INTERVAL);
             });
             s_f.addEventListener(IOErrorEvent.IO_ERROR, function (e:IOErrorEvent):void {
                 puts("Facilitator: I/O error: " + e.text + ".");
@@ -111,19 +112,15 @@
             client_addr = parse_addr_spec(client_spec);
             if (!client_addr) {
                 puts("Error: Client spec must be in the form \"host:port\".");
-                setTimeout(main, FACILITATOR_POLL_INTERVAL);
                 return;
             }
             if (client_addr.host == "0.0.0.0" && client_addr.port == 0) {
                 puts("Error: Facilitator has no clients.");
-                setTimeout(main, FACILITATOR_POLL_INTERVAL);
                 return;
             }

             proxy_pair = new ProxyPair(this, client_addr, DEFAULT_TOR_ADDR);
             proxy_pair.connect();
-
-            setTimeout(main, FACILITATOR_POLL_INTERVAL);
         }

         /* Parse an address in the form "host:port". Returns an Object with


Added error catch in htmlUnescape.

Added error catch in htmlUnescape.

--- src/org/openPyro/utils/StringUtil.as
+++ src/org/openPyro/utils/StringUtil.as
@@ -114,7 +114,15 @@

 		public static function htmlUnescape(str:String):String{
 			if(!str || str == "") return "";
-			return new XMLDocument(str).firstChild.nodeValue;
+			var ret:String;
+			try{
+				ret = new XMLDocument(str).firstChild.nodeValue;
+			}
+			catch(e:Error){
+				ret = str;
+			}
+			return ret;
+
 		}

 		public static function htmlEscape(str:String):String{


fixed crash when sorting a vector

fixed crash when sorting a vector

--- WeaveCore/src/weave/utils/AsyncSort.as
+++ WeaveCore/src/weave/utils/AsyncSort.as
@@ -173,25 +173,28 @@

 		private function iterate(stopTime:int):Number
 		{
-			if (compare === ObjectUtil.numericCompare)
-			{
-				original.sort(Array.NUMERIC);
-				return 1;
-			}
-
-			if (compare === compareCaseInsensitive)
-			{
-				original.sort(Array.CASEINSENSITIVE);
-				return 1;
-			}
-
-			if (compare === null)
-			{
-				if (original[0] is Number || original[0] is Date)
+			if (original is Array)
+			{
+				if (compare === ObjectUtil.numericCompare)
+				{
 					original.sort(Array.NUMERIC);
-				else
-					original.sort();
-				return 1;
+					return 1;
+				}
+
+				if (compare === compareCaseInsensitive)
+				{
+					original.sort(Array.CASEINSENSITIVE);
+					return 1;
+				}
+
+				if (compare === null)
+				{
+					if (original[0] is Number || original[0] is Date)
+						original.sort(Array.NUMERIC);
+					else
+						original.sort();
+					return 1;
+				}
 			}

 			var time:int = getTimer();


Transferred from the Adobe Open Source Subversion Repository

Revision: 14354
Author:   jimurphy@adobe.com
Date:     2010-02-23T15:05:48.761194Z

Log Message:
-----------
resetting the build number in version.as
The build automated process checked it in as 4.5.0.13964 when it should have been 4.5.0.0

QE notes: no
Doc notes: no
Bugs: https://bugs.adobe.com/jira/browse/SDK-25489
Reviewer: no
Tests run: ran version test included in the bug
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_air/src/mx/core/Version.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/datavisualization/src/mx/core/Version.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/core/Version.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/core/Version.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Version.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation/src/mx/core/Version.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/mx/core/Version.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_flashflexkit/src/mx/core/Version.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/core/Version.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_dmv/src/mx/core/Version.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airspark/src/spark/core/Version.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/Version.as</path>

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

--- frameworks/projects/automation_air/src/mx/core/Version.as
+++ frameworks/projects/automation_air/src/mx/core/Version.as
@@ -15,4 +15,4 @@
  *  @private
  *  Version string for this class.
  */
-mx_internal static const VERSION:String = "4.5.0.13964";
+mx_internal static const VERSION:String = "4.5.0.0";


Transferred from the Adobe Open Source Subversion Repository

Revision: 21632
Author:   betravis@adobe.com
Date:     2011-07-19T23:14:11.603303Z

Log Message:
-----------
Initial checkin of ToggleSwitch component to mobilecomponents project.
Initial checkin of ToggleSwitchSkin to mobiletheme.

QE notes: None
Doc notes: None
Bugs: None
Reviewer: Kevin Lin (component), Jason San Jose (skin)
Tests run: checkintests, mustella
Is noteworthy for integration: Yes. Introduces the ToggleSwitch component.

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/manifest.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/bundles/en_US/components.properties</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/ToggleSwitchSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/ToggleSwitch_contentShadow.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile240/assets/ToggleSwitch_contentShadow.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/ToggleSwitch.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile160/assets/ToggleSwitch_contentShadow.fxg</path>

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

--- frameworks/projects/mobiletheme/src/MobileThemeClasses.as
+++ frameworks/projects/mobiletheme/src/MobileThemeClasses.as
@@ -47,6 +47,7 @@
 import spark.skins.mobile.TextAreaHScrollBarSkin; TextAreaHScrollBarSkin;
 import spark.skins.mobile.TextAreaVScrollBarSkin; TextAreaVScrollBarSkin;
 import spark.skins.mobile.TextInputSkin; TextInputSkin;
+import spark.skins.mobile.ToggleSwitchSkin; ToggleSwitchSkin;
 import spark.skins.mobile.TransparentActionButtonSkin; TransparentActionButtonSkin;
 import spark.skins.mobile.TransparentNavigationButtonSkin; TransparentNavigationButtonSkin;
 import spark.skins.mobile.ViewMenuItemSkin; ViewMenuItemSkin;


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

--- frameworks/projects/mx/src/mx/effects/RemoveItemAction.as
+++ frameworks/projects/mx/src/mx/effects/RemoveItemAction.as
@@ -47,6 +47,11 @@
  *  @see mx.effects.effectClasses.RemoveItemActionInstance
  *
  *  @includeExample examples/AddItemActionEffectExample.mxml
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class RemoveItemAction extends Effect
 {
@@ -73,6 +78,11 @@
      *  Constructor.
      *
      *  @param target The Object to animate with this effect.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function RemoveItemAction(target:Object = null)
     {


... and back again, because apparently you can't initialize static members in, you know, static code.

git-svn-id: a1a4b28b82a3276cc491891159dd9963a0a72fae@5072 542714f4-19e9-0310-aa3c-eee0fc999fb1

--- src/as/com/threerings/presents/dobj/DEvent.as
+++ src/as/com/threerings/presents/dobj/DEvent.as
@@ -32,6 +32,10 @@
 {
     public function DEvent (targetOid :int = 0)
     {
+        // TODO: Remove when https://bugzilla.mozilla.org/show_bug.cgi?id=433103 is fixed
+        if (UNSET_OLD_ENTRY == null) {
+            UNSET_OLD_ENTRY = new DummyEntry();
+        }
         _toid = targetOid;
     }

@@ -112,13 +116,6 @@
     /** The oid of the object that is the target of this event. */
     protected var _toid :int;

-    // TODO: Remove when https://bugzilla.mozilla.org/show_bug.cgi?id=433103 is fixed
-    private static function staticInit () :void
-    {
-        UNSET_OLD_ENTRY = new DummyEntry();
-    }
-    staticInit();
-
     protected static var UNSET_OLD_ENTRY :DSet_Entry;
 }
 }


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

--- frameworks/projects/mx/src/mx/accessibility/MenuBarAccImpl.as
+++ frameworks/projects/mx/src/mx/accessibility/MenuBarAccImpl.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.accessibility
 {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/mx/src/mx/styles/metadata/BorderStyles.as
+++ frameworks/projects/mx/src/mx/styles/metadata/BorderStyles.as
@@ -1,26 +1,4 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2005-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.
-//
-////////////////////////////////////////////////////////////////////////////////
-
-/**
- *  Background color of the component when it is disabled.
- *  The global default value is undefined.
- *  The default value for List controls is 0xDDDDDD (light gray).
- *  If a container is disabled, the background is dimmed, and the degree of
- *  dimming is controlled by the disabledOverlayAlpha style.
- *
- *  @langversion 3.0
- *  @playerversion Flash 9
- *  @playerversion AIR 1.1
- *  @productversion Flex 3
- */
+
 [Style(name="backgroundDisabledColor", type="uint", format="Color", inherit="yes", theme="halo")]

 /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 9930
Author:   smgilson@adobe.com
Date:     2009-09-02T18:18:40.643031Z

Log Message:
-----------
Add ASDoc version tags to new or untagged classes

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/mxml/IMXMLSupport.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/IMarshalSystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/filters/BaseDimensionFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/AbstractWebService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/Bounce.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/filters/IBitmapFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/DefaultTileListEffect.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/INavigatorContent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/DefaultListEffect.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/Elastic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/HTTPService.as</path>

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

--- frameworks/projects/spark/src/spark/effects/easing/Elastic.as
+++ frameworks/projects/spark/src/spark/effects/easing/Elastic.as
@@ -19,6 +19,11 @@
  * target object will decelerate toward the end value and past it
  * and will continue to oscillate around that value in smaller increments
  * before ending up on that end value.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 public class Elastic implements IEaser
 {
@@ -30,6 +35,11 @@

     /**
      *  Constructs an Elastic easer.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function Elastic()
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 5545
Author:   jimurphy@adobe.com
Date:     2009-03-25T19:00:52.330680Z

Log Message:
-----------
1st pass of rename according to the spec http://opensource.adobe.com/wiki/display/flexsdk/Dropping+the+Fx+Prefix

Flex now requires CSS Style declarations to declare @namespace rules and disambiguate between halo and spark components using CSS 3 namespace prefixes on type selectors. At compile time, this namespace information will be used to map type names to qualified ActionScript class names. At runtime, type selectors are matched on qualified ActionScript class name (for example mx.controls.Button rather than just Button). Flex 3 applications must be compiled with -compatibility-version=3.0.0 to get unqualified CSS type selector behavior.

QE: Yes, this build may help in updating test cases to use the new namespaces and class names.
Dev: Not yet
Doc: Not yet

Modified Paths:
--------------
748 paths were modified

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

--- frameworks/projects/spark/src/spark/filters/GradientFilter.as
+++ frameworks/projects/spark/src/spark/filters/GradientFilter.as
@@ -1,4 +1,4 @@
-package mx.filters
+package spark.filters
 {

 import flash.events.Event;


Transferred from the Adobe Open Source Subversion Repository

Revision: 13099
Author:   egeorgie@adobe.com
Date:     2009-12-18T02:58:52.185083Z

Log Message:
-----------
Minor updates to the drag and drop protected APIs.

- LayoutBase calculateDragScrollDelta now takes only two parameters, the timeInterval parameter was removed while the timeElapsed interval was renamed to elapsedTime and its type was changed from int to Number.
- The drag and drop data format descriptors were renamed from "orderedItems" and "orderedItemsCaretIndex" to "itemsByIndex" and "caretIndex" respectively.
- Fixed a default value for the VerticalLayout requestedMinRowCount property to be -1 (was 0).

QE notes: None
Doc notes: None
Bugs: None
Reviewer: Jason
Tests run: checkintests, mustella tests/gumbo/components/ListDragDrop
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
+++ frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
@@ -477,7 +477,7 @@
     //  requestedMinRowCount
     //----------------------------------

-    private var _requestedMinRowCount:int = 0;
+    private var _requestedMinRowCount:int = -1;

     [Inspectable(category="General", minValue="-1")]

@@ -491,7 +491,7 @@
      *
If the actual size of the container has been explicitly set,
      *  then this property has no effect.

      *
-     *  @default 0
+     *  @default -1
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -1985,10 +1985,9 @@
      *  @private
      */
     override protected function calculateDragScrollDelta(dropLocation:DropLocation,
-                                                         timeInterval:int,
-                                                         timeElapsed:int):Point
-    {
-        var delta:Point = super.calculateDragScrollDelta(dropLocation, timeInterval, timeElapsed);
+                                                         elapsedTime:Number):Point
+    {
+        var delta:Point = super.calculateDragScrollDelta(dropLocation, elapsedTime);
         // Don't scroll in the horizontal direction
         if (delta)
             delta.x = 0;


Transferred from the Adobe Open Source Subversion Repository

Revision: 6481
Author:   egeorgie@adobe.com
Date:     2009-05-01T23:55:34.032529Z

Log Message:
-----------
Fix bug http://bugs.adobe.com/jira/browse/SDK-20857 List is not responding to PgDn and PgUp

Implement page up/down support in vertical, horizontal and tile layouts.

QE Notes: None
Doc Notes: None
Bugs: SDK-20857
Reviewer: Deepa, Hans
tests: checkintests

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/TileLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/core/NavigationUnit.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/VerticalLayout.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
+++ frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
@@ -16,17 +16,17 @@
 import flash.events.EventDispatcher;
 import flash.geom.Point;
 import flash.geom.Rectangle;
-import flash.ui.Keyboard;

 import mx.containers.utilityClasses.Flex;
 import mx.core.ILayoutElement;
 import mx.events.PropertyChangeEvent;

 import spark.components.supportClasses.GroupBase;
+import spark.core.NavigationUnit;
+import spark.core.ScrollUnit;
 import spark.layouts.supportClasses.LayoutBase;
 import spark.layouts.supportClasses.LayoutElementHelper;
 import spark.layouts.supportClasses.LinearLayoutVector;
-

 /**
  *  The VerticalLayout arranges the layout elements in a vertical sequence,
@@ -1192,27 +1192,118 @@

     /**
      *  @private
-     *  For a VerticalLayout, returns the index of the next item to
-     *  navigate to given the current index and keyCode passed in.
      */
-     override public function nextItemIndex(keyCode:uint, currentIndex:int, maxIndex:int):int
+     override public function getDestinationIndex(navigationUnit:uint, currentIndex:int):int
      {
-         var retVal:int = super.nextItemIndex(keyCode, currentIndex, maxIndex);
-         switch (keyCode)
-         {
-             case Keyboard.UP:
-             {
-                retVal = Math.max(currentIndex - 1, 0);
+        var maxIndex:int = target.numElements - 1;
+        var newIndex:int;
+        var bounds:Rectangle;
+        var y:Number;
+
+        switch (navigationUnit)
+        {
+            case NavigationUnit.UP:
+            {
+               newIndex = currentIndex - 1;
+               break;
+            }
+
+            case NavigationUnit.DOWN:
+            {
+               newIndex = currentIndex + 1;
+               break;
+            }
+
+            case NavigationUnit.PAGE_UP:
+            {
+                // Find the first fully visible element
+                var firstVisible:int = firstIndexInView;
+                var firstFullyVisible:int = firstVisible;
+                if (fractionOfElementInView(firstFullyVisible) < 1)
+                    firstFullyVisible += 1;
+
+                // Is the current element in the middle of the viewport?
+                if (firstFullyVisible < currentIndex && currentIndex <= lastIndexInView)
+                    newIndex = firstFullyVisible;
+                else
+                {
+                    // Find an element that's one page up
+                    if (currentIndex == firstFullyVisible || currentIndex == firstVisible)
+                    {
+                        // currentIndex is visible, we can calculate where the scrollRect top
+                        // would end up if we scroll by a page
+                        y = getVerticalScrollPositionDelta(ScrollUnit.PAGE_UP) + getScrollRect().top;
+                    }
+                    else
+                    {
+                        // currentIndex is not visible, just find an element a page up from currentIndex
+                        y = getElementBounds(currentIndex).bottom - getScrollRect().height;
+                    }
+
+                    // Find the element after the last element that spans above the y position
+                    newIndex = currentIndex - 1;
+                    while (0 < newIndex)
+                    {
+                        bounds = getElementBounds(newIndex);
+                        if (bounds && bounds.top < y)
+                        {
+                            // This element spans the y position, so return the next one
+                            newIndex = Math.min(currentIndex - 1, newIndex + 1);
+                            break;
+                        }
+                        newIndex--;
+                    }
+                }
                 break;
-             }
-             case Keyboard.DOWN:
-             {
-                retVal = Math.min(currentIndex + 1, maxIndex);
+            }
+
+            case NavigationUnit.PAGE_DOWN:
+            {
+                // Find the last fully visible element:
+                var lastVisible:int = lastIndexInView;
+                var lastFullyVisible:int = lastVisible;
+                if (fractionOfElementInView(lastFullyVisible) < 1)
+                    lastFullyVisible -= 1;
+
+                // Is the current element in the middle of the viewport?
+                if (firstIndexInView <= currentIndex && currentIndex < lastFullyVisible)
+                    newIndex = lastFullyVisible;
+                else
+                {
+                    // Find an element that's one page down
+                    if (currentIndex == lastFullyVisible || currentIndex == lastVisible)
+                    {
+                        // currentIndex is visible, we can calculate where the scrollRect bottom
+                        // would end up if we scroll by a page
+                        y = getVerticalScrollPositionDelta(ScrollUnit.PAGE_DOWN) + getScrollRect().bottom;
+                    }
+                    else
+                    {
+                        // currentIndex is not visible, just find an element a page down from currentIndex
+                        y = getElementBounds(currentIndex).top + getScrollRect().height;
+                    }
+
+                    // Find the element before the first element that spans below the y position
+                    newIndex = currentIndex + 1;
+                    while (newIndex < maxIndex)
+                    {
+                        bounds = getElementBounds(newIndex);
+                        if (bounds && bounds.bottom > y)
+                        {
+                            // This element spans the y position, so return the previous one
+                            newIndex = Math.max(currentIndex + 1, newIndex - 1);
+                            break;
+                        }
+                        newIndex++;
+                    }
+                }
                 break;
-             }
-         }
-         return retVal;
-     }
+            }
+
+            default: return super.getDestinationIndex(navigationUnit, currentIndex);
+        }
+        return Math.max(0, Math.min(maxIndex, newIndex));
+    }

     /**
      *  @private


Transferred from the Adobe Open Source Subversion Repository

Revision: 4033
Author:   rfrishbe@adobe.com
Date:     2008-11-06T22:20:42.263178Z

Log Message:
-----------
Fix a bug Steve found when dealing with "justify" for horizontalAlign or verticalAlign.

Add horizontalAlign and verticalAlign to VGroup and HGroup, respectively.  Also fix some ASDoc and code comments.

Ran mustella tests for layout, group, and datagroup.

QE Notes: Continue testing these properties
Doc Notes: None
Bugs: -
Reviewer: Evtim

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/VGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/HGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/VerticalLayout.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
+++ frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
@@ -171,7 +171,8 @@

     [Inspectable(category="General")]

-    /** Horizontal alignment of children in the container.
+    /**
+     *  Horizontal alignment of children in the container.
      *  Possible values are "left", "center",
      *  "right", "justify",
      *  and "contentJustify".
@@ -859,17 +860,17 @@
         if (!layoutTarget)
             return;

-        // TODO EGeorgie: use vector
         var layoutItem:ILayoutItem;
         var count:uint = layoutTarget.numLayoutItems;

-        // if horizontalAlign is "contentJustify", we need to figure out restrictedWidth.
-        // contentWidth gets sent in to distributeHeight(), but is only used if
-        // horizontalAlign is "justify" (contentWidth is unscaledWidth) or
-        // horizontalAlign is "contentJustify" (contentWidth is the maximum width
-        // of all its children and a minimum of unscaledWidth)
-        var contentWidth:Number = unscaledWidth;
-
+        // If horizontalAlign is left, we don't need to figure out the contentWidth
+        // Otherwise the contentWidth is used to position the item and even size
+        // the item if it's "contentJustify" or "justify".
+        var contentWidth:Number = unscaledWidth;
+
+        // TODO: in the center or right case, we end up calculating percentWidth
+        // twice.  Once here for the contentWidth and once in distributeHeight
+        // to size that particular element.
         if (horizontalAlign != HorizontalAlign.LEFT)
         {
             for (var i:int = 0; i < count; i++)
@@ -888,7 +889,17 @@
             }
         }

-        distributeHeight(unscaledWidth, unscaledHeight, contentWidth);
+        // If we're justifying the items, then all widths should be set to
+        // unscaledWidth.  If we're content justifying the items, then
+        // all widths should be set to the contentWidth.
+        // Otherwise restrictedWidth is ignored in distributedHeight.
+        var restrictedWidth:Number;
+        if (horizontalAlign == HorizontalAlign.JUSTIFY)
+            restrictedWidth = unscaledWidth;
+        else if (horizontalAlign == HorizontalAlign.CONTENT_JUSTIFY)
+            restrictedWidth = contentWidth;
+
+        distributeHeight(unscaledWidth, unscaledHeight, restrictedWidth);

         // default to left (0)
         var hAlign:Number = 0;


Transferred from the Adobe Open Source Subversion Repository

Revision: 12331
Author:   smgilson@adobe.com
Date:     2009-12-01T19:45:33.274910Z

Log Message:
-----------
ASDoc updates in preparation for localization

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TitleWindow.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airspark/src/spark/components/WindowedApplication.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airspark/src/spark/components/Window.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/TileLayout.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
+++ frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
@@ -179,9 +179,9 @@
     public function VerticalLayout():void
     {
         super();
-
-		// Don't drag-scroll in the horizontal direction
-		dragScrollRegionSizeHorizontal = 0;
+
+        // Don't drag-scroll in the horizontal direction
+        dragScrollRegionSizeHorizontal = 0;

         // Virtualization defaults for cases
         // where there are no items and no typical item.
@@ -205,7 +205,7 @@
     [Inspectable(category="General")]

     /**
-     *  The vertical space between layout elements.
+     *  The vertical space between layout elements, in pixels.
      *
      *  Note that the gap is only applied between layout elements, so if there's
      *  just one element, the gap has no effect on the layout.
@@ -570,7 +570,7 @@

     /**
      *  If variableRowHeight is false, then
-     *  this property specifies the actual height of each child.
+     *  this property specifies the actual height of each child, in pixels.
      *
      *
If variableRowHeight is true,
      *  the default, then this property has no effect.

@@ -1578,12 +1578,12 @@
         var maxVisibleY:Number = minVisibleY + layoutTarget.height;

         updateLLV(layoutTarget);
-
-		// Find the index of the first visible item. Since the item's bounds includes the gap
-		// that follows it, we want to avoid looking at an item that has only a portion of
-		// its gap intersecting with the visible region.
-		// We have to also be careful, as gap could be negative and in that case, we should
-		// simply start from minVisibleY - SDK-22497.
+
+        // Find the index of the first visible item. Since the item's bounds includes the gap
+        // that follows it, we want to avoid looking at an item that has only a portion of
+        // its gap intersecting with the visible region.
+        // We have to also be careful, as gap could be negative and in that case, we should
+        // simply start from minVisibleY - SDK-22497.
         var startIndex:int = llv.indexOf(Math.max(0, minVisibleY + gap));
         if (startIndex == -1)
             return;
@@ -1978,25 +1978,25 @@

         var x:Number = paddingLeft;

-		var y:Number = emptySpaceTop + Math.round((emptySpace - height)/2);
-		// Allow 1 pixel overlap with container border
+        var y:Number = emptySpaceTop + Math.round((emptySpace - height)/2);
+        // Allow 1 pixel overlap with container border
         y = Math.max(-1, Math.min(target.contentHeight - height + 1, y));
         return new Rectangle(x, y, width, height);
     }
-
-	/**
-	 *  @private
-	 */
-	override protected function calculateDragScrollDelta(dropLocation:DropLocation,
-														 timeInterval:int,
-														 timeElapsed:int):Point
-	{
-		var delta:Point = super.calculateDragScrollDelta(dropLocation, timeInterval, timeElapsed);
-		// Don't scroll in the horizontal direction
-		if (delta)
-			delta.x = 0;
-		return delta;
-	}
+
+    /**
+     *  @private
+     */
+    override protected function calculateDragScrollDelta(dropLocation:DropLocation,
+                                                         timeInterval:int,
+                                                         timeElapsed:int):Point
+    {
+        var delta:Point = super.calculateDragScrollDelta(dropLocation, timeInterval, timeElapsed);
+        // Don't scroll in the horizontal direction
+        if (delta)
+            delta.x = 0;
+        return delta;
+    }
 }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 2711
Author:   jszeto@adobe.com
Date:     2008-08-01T21:28:09.563575Z

Log Message:
-----------
MXMLG-111 - Several shapes dont dispatch updateComplete event

All graphic elements now dispatch an updateComplete event after they have validated.

Bug: MXMLG-111
QA: Yes
Doc: Yes
Review: Evtim

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/TextBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/TextGraphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/StrokedElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/graphicsClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/BitmapGraphic.as</path>

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

--- frameworks/projects/spark/src/spark/primitives/BitmapImage.as
+++ frameworks/projects/spark/src/spark/primitives/BitmapImage.as
@@ -268,8 +268,6 @@
 		_fill.begin(g, new Rectangle(w, h));
 		g.drawRect(0, 0, w, h);
 		_fill.end(g);
-
-		applyDisplayObjectProperties();
 	}

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


:coffee:

:coffee:

--- src/app/flash/partials/jinx.as
+++ src/app/flash/partials/jinx.as
@@ -1,831 +0,0 @@
-/**
-Author : Andre Caetano 2015
-**/
-
-import flash.events.Event;
-import flash.events.MouseEvent;
-import flash.external.ExternalInterface;
-import flash.filters.BitmapFilter;
-import flash.filters.ColorMatrixFilter;
-import flash.filters.DropShadowFilter;
-import flash.geom.*;
-import flash.display.*;
-import flash.net.*;
-import flash.text.TextField;
-import flash.utils.*;
-import flash.events.ErrorEvent;
-import flash.events.UncaughtErrorEvent;
-import flash.filters.GlowFilter;
-import flash.system.*;
-
-/* CONSOLE.log */
-function $trace($){
-	ExternalInterface.call("console.log",$);
-}
-
-var console={'log':function($){$trace($)}};
-
-/* MULTI PROTOTYPE */
-var $prototype = function(name,f){
-	var protos = [Bitmap,MovieClip,TextField];
-	for(var i in protos) protos[i].prototype[name] = f;
-}
-
-/* INLINE AS3 */
-MovieClip.prototype.$stop = function(){
-	this.stop();
-	return this;
-}
-
-MovieClip.prototype.$gotoAndStop = function(){
-	this.gotoAndStop.call(null,arguments.splice(0,1));
-	return this;
-}
-
-MovieClip.prototype.$gotoAndPlay = function(){
-	this.gotoAndPlay.call(null,arguments.splice(0,1));
-	return this;
-}
-
-TextField.prototype.$if = MovieClip.prototype.$if = function(Bool,$=null){
-	if(Bool){
-		if($) $.call(this);
-		return this;
-	}
-
-	return;
-}
-
-$prototype('$set',function(prop,val){
-	if(typeof prop==='object'){
-		for(var i in prop){
-			if(i.indexOf('.')==-1){
-				this[i]=prop[i];
-			} else {
-				var pathObj = i.split(".");
-				var c = this;
-				for(var k=0;k<pathObj.length-1;k++) c=c[pathObj[k]];
-				c[pathObj[pathObj.length-1]]=prop[i];
-			}
-		}
-	} else {
-		this[prop]=val;
-	}
-	return this;
-});
-
-$prototype('$add',function(obj=null){
-	if(!obj) {
-		addChild(this);
-	} else {
-		obj.addChild(this);
-	}
-	return this;
-});
-
-MovieClip.prototype.$index = function(val,obj=null){
-	if(!obj){
-		if(!val) val = numChildren-1;
-		setChildIndex(this,val);
-	} else {
-		if(!val) val = obj.numChildren-1;
-		obj.setChildIndex(this,val);
-	}
-	return this;
-}
-
-MovieClip.prototype.$hit = function(){
-	this.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
-}
-
-MovieClip.prototype.$do = function(func){
-	if(!$isArray(func)) func=[func];
-	var myself = this;
-	func.map(function(f){
-		f.call(myself);
-	});
-	return this;
-}
-
-$prototype('$remove',function(){
-	if(this+""=='[object MovieClip]')this.$unbindAll();
-	this.parent.removeChild(this);
-	return this;
-});
-
-var $bmpData = function(obj,width=null,height=null,x=0,y=0,margin=0){
-	var bitmapData:BitmapData = new BitmapData((width && width!='pivot' ? width : obj.width)+(margin*2), (height ? height : obj.height)+(margin*2), true, 0xffffff);
-	//var move = [obj.x,obj.y]
-	if(x=='center' || y=='center') {
-		x=obj.width/2;
-		y=obj.height/2;
-		obj.x-=obj.width/2;
-		obj.y-=obj.height/2;
-	}
-	if(width=='pivot'){
-		var bounds = obj.getBounds(obj);
-		x=bounds.x*-1;
-		y=bounds.y*-1;
-	}
-	var tmp = new Matrix();
-	tmp.translate(x+margin,y+margin);
-	bitmapData.draw(obj, tmp);
-	return bitmapData;
-}
-
-var $bmp = function(obj,width=null,height=null,x=0,y=0,margin=0){
-	var bitmapData:BitmapData = $bmpData(obj,width,height,x,y,margin);
-	var move = [obj.x,obj.y]
-	if(x=='center' || y=='center') {
-		obj.x-=obj.width/2;
-		obj.y-=obj.height/2;
-	}
-	if(width=='pivot'){
-		var bounds = obj.getBounds(obj);
-		move=[bounds.x,bounds.y];
-	}
-	var bitmap:Bitmap = new Bitmap(bitmapData);
-	obj.parent.addChild(bitmap);
-	bitmap.x=move[0];
-	bitmap.y=move[1];
-	obj.$remove();
-	//obj=bitmap;
-	return bitmap;
-}
-
-/* START EVENTS TRIGGERS */
-var $getEventTypes = function(){
-	var eventsTypes = [];
-		eventsTypes['enterFrame']={'is':Event,'do':'ENTER_FRAME'};
-		eventsTypes['removed']={'is':Event,'do':'REMOVED'};
-		eventsTypes['load']={'is':Event,'do':'ACTIVATE'};
-		eventsTypes['mouseMove']={'is':MouseEvent,'do':'MOUSE_MOVE'};
-		eventsTypes['mouseUp']={'is':MouseEvent,'do':'MOUSE_UP'};
-		eventsTypes['mouseDown']={'is':MouseEvent,'do':'MOUSE_DOWN'};
-		eventsTypes['mouseOver']={'is':MouseEvent,'do':'MOUSE_OVER'};
-		eventsTypes['mouseOut']={'is':MouseEvent,'do':'MOUSE_OUT'};
-		eventsTypes['releaseOutside']={'is':MouseEvent,'do':'RELEASE_OUTSIDE'};
-		eventsTypes['click']={'is':MouseEvent,'do':'CLICK'};
-		eventsTypes['mouseWhell']={'is':MouseEvent,'do':'MOUSE_WHEEL'};
-		eventsTypes['rollOut']={'is':MouseEvent,'do':'ROLL_OUT'};
-		eventsTypes['rollOver']={'is':MouseEvent,'do':'ROLL_OVER'};
-		eventsTypes['rightClick']={'is':MouseEvent,'do':'RIGHT_MOUSE_DOWN'};
-	return eventsTypes;
-}
-
-MovieClip.prototype.$bind = function(typeEvent,callbackOrOptions,callback2=null,idFunc=null){
-	var callback;
-	var options;
-	if(typeof callbackOrOptions === 'object'){
-		options={
-			'hand':callbackOrOptions.hand
-		};
-		callback=callback2;
-	} else {
-		options={
-			'hand':true
-		};
-		callback=callbackOrOptions;
-	}
-	if(typeof callback2 !== 'function') idFunc=callback2;
-
-	var eventsTypes = $getEventTypes();
-
-	if(eventsTypes[typeEvent]['is'] === MouseEvent){
-		this.$set('mouseChildren',false)
-		.$if(options.hand)
-		.$set({'buttonMode':true,'useHandCursor':true});
-	}
-
-	if(!this.bindFuncs) this.bindFuncs={};
-	if(!this.bindFuncs[eventsTypes[typeEvent]['do']]) this.bindFuncs[eventsTypes[typeEvent]['do']]={};
-
-	var tmpvar;
-	this.addEventListener(eventsTypes[typeEvent]['is'][eventsTypes[typeEvent]['do']],tmpvar = function(e){
-		if(callback!=null)callback.call(e.target,e,tmpvar);
-	});
-	if(!idFunc){
-		this.bindFuncs[eventsTypes[typeEvent]['do']][$nextNewIndex(this.bindFuncs[eventsTypes[typeEvent]['do']])]=tmpvar;
-	} else {
-		this.bindFuncs[eventsTypes[typeEvent]['do']][idFunc]=tmpvar;
-	}
-
-	return this;
-}
-
-MovieClip.prototype.$unbind = function(typeEvent,idFunc=null,keepCursor=false){
-	var eventsTypes = $getEventTypes(), i;
-
-	if(!this.bindFuncs || !this.bindFuncs[eventsTypes[typeEvent]['do']] || this.bindFuncs[eventsTypes[typeEvent]['do']].length==0) return this;
-
-	if(eventsTypes[typeEvent]['is'] === MouseEvent){
-		var d=true;
-		for (var index in eventsTypes) {
-			if(eventsTypes[index]['is'] !== MouseEvent) continue;
-
-			for(i in this.bindFuncs[eventsTypes[index]['do']]){
-				d=false;
-				break;
-			}
-			if(!d)break;
-		}
-
-		this.$if(!d && !keepCursor).$set({'buttonMode':false,'useHandCursor':false});
-	}
-
-	if(typeof idFunc == 'function'){
-
-		for(i in this.bindFuncs[eventsTypes[typeEvent]['do']]){
-			if(this.bindFuncs[eventsTypes[typeEvent]['do']][i]==idFunc){
-				this.removeEventListener(eventsTypes[typeEvent]['is'][eventsTypes[typeEvent]['do']],this.bindFuncs[eventsTypes[typeEvent]['do']][i]);
-				return this;
-			}
-		}
-	}
-
-	if(!idFunc){
-		for(i in this.bindFuncs[eventsTypes[typeEvent]['do']]){
-			this.removeEventListener(eventsTypes[typeEvent]['is'][eventsTypes[typeEvent]['do']],this.bindFuncs[eventsTypes[typeEvent]['do']][i]);
-		}
-		return this;
-	}
-
-	if(
-	this.bindFuncs &&
-	this.bindFuncs[eventsTypes[typeEvent]['do']] &&
-	this.bindFuncs[eventsTypes[typeEvent]['do']][idFunc]
-	){
-		this.removeEventListener(eventsTypes[typeEvent]['is'][eventsTypes[typeEvent]['do']],this.bindFuncs[eventsTypes[typeEvent]['do']][idFunc]);
-		delete this.bindFuncs[eventsTypes[typeEvent]['do']][idFunc];
-	}
-	return this;
-}
-
-MovieClip.prototype.$unbindAll = function(typeEvent=null){
-	if(!this.bindFuncs) return this;
-	var i, c=0;
-	for(i in this.bindFuncs) c++;
-	if(c==0) return this;
-	var eventsTypes = $getEventTypes();
-	for (var index in eventsTypes){
-		for(i in this.bindFuncs[eventsTypes[index]['do']]){
-			if(typeEvent && typeEvent!=index) continue;
-			this.removeEventListener(eventsTypes[index]['is'][eventsTypes[index]['do']],this.bindFuncs[eventsTypes[index]['do']][i]);
-		}
-	}
-	this.$set({'buttonMode':false,'useHandCursor':false});
-
-	return this;
-}
-
-var $releaseOutside = function(callback){
-	/* SCHEMA : HAVE TO BE PUT INSIDE MOUSE BINDS
-	$bind('click or other mouse event',function(){
-		>here<
-	})*/
-	if(callback==null) return;
-
-	var tmpvar;
-	stage.addEventListener(MouseEvent.MOUSE_UP, tmpvar = function(e){
-		callback.call(e.target,e);
-		stage.removeEventListener(MouseEvent.MOUSE_UP, tmpvar);
-	});
-}
-
-/* REG ALIAS */
-
-MovieClip.prototype.$click = function(callback,idFunc=null){
-	return this.$bind('click',callback,idFunc);
-}
-
-MovieClip.prototype.$hover = MovieClip.prototype.$mouseOver = function(callback,callback2=null){
-	if(!callback2){
-		return this.$bind('mouseOver',callback);
-	} else {
-		return this.$bind('mouseOver',callback).$bind('mouseOut',callback2);
-	}
-}
-
-MovieClip.prototype.$mouseMove = function(callback){
-	return this.$bind('mouseMove',callback);
-}
-
-MovieClip.prototype.$mouseOut = function(callback){
-	return this.$bind('mouseOut',callback);
-}
-
-MovieClip.prototype.$mouseDown = function(callback,callback2=null){
-	if(!callback2){
-		return this.$bind('mouseDown',callback);
-	} else {
-		return this.$bind('mouseDown',callback).$bind('mouseUp',callback2).$bind('releaseOutside',callback2);
-	}
-}
-
-MovieClip.prototype.$mouseUp = function(callback){
-	return this.$bind('mouseUp',callback);
-}
-
-MovieClip.prototype.$enterFrame = function(callback){
-	return this.$bind('enterFrame',callback);
-}
-
-/* END EVENTS TRIGGERS */
-
-var $new = function(objName=null){
-	if(!objName){
-		return new MovieClip();
-	} else {
-		return new (getDefinitionByName(objName) as Class)(); // <-- still not working on flex.
-	}
-}
-
-var $allChild = function (target){
-	var children = [];
-
-	for (var i=0;i<target.numChildren;i++) children.push(target.getChildAt(i));
-
-	if(children.length==0) return null;
-	return children;
-}
-
-$prototype('$sendBack',function(){
-	var place = this.parent;
-	var dep = place.getChildIndex(this);
-	$allChild(place).map(function(e){
-		if(place.getChildIndex(e)<dep) place.setChildIndex(e,place.getChildIndex(e)+1);
-	});
-	place.setChildIndex(this,0);
-	return this;
-});
-
-MovieClip.prototype.$sendFront = function(){
-	this.parent.setChildIndex(this,this.parent.numChildren-1);
-	return this;
-}
-
-/* START TINT SCRIPT */
-function $setColor(mc, r, g, b, a, brightness){
-	var matrix:Array = [
-		r, 0, 0, 0, brightness, // red
-		0, g, 0, 0, brightness, // green
-		0, 0, b, 0, brightness, // blue
-		0, 0, 0, a, 0  // alpha
-	];
-
-	var filter:BitmapFilter = new ColorMatrixFilter(matrix);
-	mc.filters = new Array(filter);
-}
-
-function $setColorFromHex(mc, rgb, alpha=100, brightness=0){
-	rgb='0x'+rgb;
-	var r:Number = (rgb & 0x00FF0000) >>> 16;
-	var g:Number = (rgb & 0x0000FF00) >>> 8;
-	var b:Number = rgb & 0x000000FF;
-
-	$setColor(mc, r/255, g/255, b/255, alpha/100, brightness*255/100);
-}
-
-MovieClip.prototype.$tint = function(color,alpha=100,brightness=0){
-	$setColorFromHex(this, color, alpha, brightness);
-	return this;
-}
-
-MovieClip.prototype.$border = TextField.prototype.$border = function(color){
-	color='0x'+color;
-	var filter_shadow:DropShadowFilter = new DropShadowFilter(0, 0, color, 10, 2, 2, 9);
-	this.filters = [filter_shadow];
-	return this;
-}
-
-var $colors = {
-	hexDigits:["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],
-	rgb2hex:function(rgb){
-		rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
-		return "#" + this.hex(rgb[1]) + this.hex(rgb[2]) + this.hex(rgb[3]);
-	},
-	hex:function(x){
-		return isNaN(x) ? "00" : this.hexDigits[(x - x % 16) / 16] + this.hexDigits[x % 16];
-	},
-	LightenDarkenColor:function(col, amt) {
-		if(col.length>7) col = this.rgb2hex(col);
-		amt=amt*255/100;
-		var usePound = true, i;
-
-		if (col[0] == "#") {
-			col = col.slice(1);
-			usePound = true;
-		}
-
-		if(col.length<7){
-			for(i=0;i<6;i++){
-				if(col.length<6){
-					col+=col[0];
-				} else {
-					break;
-				}
-			}
-		}
-
-		var num = parseInt(col,16);
-
-		var r = (num >> 16) + amt;
-
-		if (r > 255) r = 255;
-		else if  (r < 0) r = 0;
-
-		var b = ((num >> 8) & 0x00FF) + amt;
-
-		if (b > 255) b = 255;
-		else if  (b < 0) b = 0;
-
-		var g = (num & 0x0000FF) + amt;
-
-		if (g > 255) g = 255;
-		else if (g < 0) g = 0;
-
-		var c = (g | (b << 8) | (r << 16)).toString(16);
-		for(i=0;i<6;i++){
-			if(c.length<6){
-				c+=0;
-			} else {
-				break;
-			}
-		}
-		return (usePound?"#":"") + c;
-	},
-	darken:function(col, amt){
-		return this.LightenDarkenColor(col,(amt>0 ? amt*-1 : amt));
-	},
-	lighten:function(col, amt){
-		return this.LightenDarkenColor(col,(amt<0 ? amt*-1 : amt));
-	}
-};
-/* END TINT SCRIPT */
-
-
-
-/* START EFFECTS */
-TextField.prototype.$hide = MovieClip.prototype.$hide = function(){
-	this.visible = false;
-	return this;
-}
-
-TextField.prototype.$show = MovieClip.prototype.$show = function(){
-	this.visible = true;
-	return this;
-}
-
-TextField.prototype.$toggle = MovieClip.prototype.$toggle = function(){
-	this.visible = !this.visible;
-	return this;
-}
-
-TextField.prototype.$scale = MovieClip.prototype.$scale = function(por=100){
-	this.$set({
-		width:this.width*por/100,
-		height:this.height*por/100
-	});
-	return this;
-}
-
-TextField.prototype.$fadeOut = MovieClip.prototype.$fadeOut = function(time=1000,callback=null,until=0){
-	if(typeof time === 'function'){
-			callback=time;
-			time=1000;
-	}
-	var alphaPerSec=1/((time*stage.frameRate)/1000);
-	if(this._fadeAnimation){
-		this.removeEventListener(Event.ENTER_FRAME,this._fadeAnimation);
-		this._fadeAnimation=null;
-	}
-	var a;
-	this.addEventListener(Event.ENTER_FRAME,a=function(e:Event){
-		if(e.target.alpha>until){
-			e.target.alpha-=alphaPerSec;
-		} else {
-			e.target.removeEventListener(Event.ENTER_FRAME,a);
-			this._fadeAnimation=null;
-			e.target.alpha=until;
-			if(callback)callback.call(e.target,e);
-		}
-	});
-	this._fadeAnimation=a;
-	return this;
-}
-
-TextField.prototype.$fadeIn = MovieClip.prototype.$fadeIn = function(time=1000,callback=null,until=1){
-	var alphaPerSec=1/((time*stage.frameRate)/1000);
-	if(this._fadeAnimation) {
-		this.removeEventListener(Event.ENTER_FRAME,this._fadeAnimation);
-		this._fadeAnimation=null;
-	}
-	var a;
-	this.addEventListener(Event.ENTER_FRAME,a=function(e:Event){
-		if(e.target.alpha<until){
-			e.target.alpha+=alphaPerSec;
-		} else {
-			e.target.removeEventListener(Event.ENTER_FRAME,a);
-			this._fadeAnimation=null;
-			e.target.alpha=until;
-			if(callback)callback.call(e.target,e);
-		}
-	});
-	this._fadeAnimation=a;
-	return this;
-}
-/* END EFFECTS */
-
-/* START MOVE SCRIPT */
-MovieClip.prototype.$follow = function(obj,offSetX=0,offSetY=0){
-	this.$unFollow().addEventListener(Event.ENTER_FRAME,this.followFunc=function(e:Event){
-		e.target.$set({'x':obj.x+offSetX,'y':obj.y+offSetY});
-	});
-	return this;
-}
-
-MovieClip.prototype.$unFollow = function(){
-	if(!this.followFunc) return this;
-	this.removeEventListener(Event.ENTER_FRAME,this.followFunc);
-	return this;
-}
-
-MovieClip.prototype.$followMouse = function(offSetX=0,offSetY=0){
-	this.$unFollow().addEventListener(Event.ENTER_FRAME,this.followFunc=function(e:Event){
-		e.target.$set({'x':mouseX+offSetX,'y':mouseY+offSetY});
-	});
-	return this;
-}
-
-$prototype('$copyPos',function(obj){
-	this.x=obj.x;
-	this.y=obj.y;
-	return this;
-});
-
-MovieClip.prototype.$copyPosGlobal = function(obj){
-	var globalPoint:Point = obj.localToGlobal(new Point(0,0));
-	this.x = globalPoint.x;
-	this.y = globalPoint.y;
-	return this;
-}
-
-/* END MOVE SCRIPT */
-
-/* CAUC FUNCS */
-var $sort = function(obj,property){
-	var dynamicSort = function(property){
-		var sortOrder = 1;
-		if(property.substr(0,1) === "-") {
-			sortOrder = -1;
-			property = property.substr(1);
-		}
-		return function (a,b) {
-			var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;
-			return result * sortOrder;
-		}
-	}
-
-	var multiSort = function(props){
-		return function (obj1, obj2) {
-			var i = 0, result = 0, numberOfProperties = props.length;
-			while(result === 0 && i < numberOfProperties) result = dynamicSort(props[i++])(obj1, obj2);
-			return result;
-		}
-	}
-
-	if(!$isArray(property)){
-		obj.sort(dynamicSort(property));
-	} else {
-		obj.sort(multiSort(property));
-	}
-}
-
-var $caucRateTime = function(time){
-	return stage.frameRate*time/1000;
-}
-
-var $randomIndex = function(arr){
-	return arr[Math.floor(Math.random()*arr.length)];
-}
-
-var $isArray = function($){
-	return Object.prototype.toString.call($) === '[object Array]';
-}
-
-var $isNumber = function(n) {
-	return !isNaN(parseFloat(n)) && isFinite(n);
-}
-
-var $nextNewIndex = function(obj){
-	var c=0;
-	for(var i in obj) if($isNumber(i)) c++;
-	return c;
-}
-
-var $clone = function(obj){
-	var resp=($isArray(obj) ? [] : {});
-	for(var i in obj) {
-		if(typeof obj[i]=='object'){
-			resp[i]=$clone(obj[i]);
-		} else {
-			resp[i]=obj[i];
-		}
-	}
-	return resp;
-}
-
-/* DISTANCE FUNCTIONS */
-var $randomRange = function(obj,size){
-	return [(obj.x-size/2)+(Math.random()*size),(obj.y-size/2)+(Math.random()*size)];
-}
-
-var $inRange = function(obj,target,range){
-	return $dist(obj,target)<=range;
-}
-
-var $dist = function(obj1,obj2){
-	var dx = obj1.x-obj2.x;
-	var dy = obj1.y-obj2.y;
-	return Math.sqrt((dx*dx)+(dy*dy));
-}
-
-/* START SOME PHP FUNCS */
-var $rand = function(min, max){
-  if (arguments.length === 0) {
-	min = 0;
-	max = 100;
-  } else if (arguments.length === 1) throw new Error('Warning: rand() expects exactly 2 parameters, 1 given');
-  return Math.floor(Math.random() * (max - min + 1)) + min;
-}
-
-var $str_replace = function(search, replace, subject, count) {
-	var i = 0,    j = 0,    temp = '',    repl = '',    sl = 0,    fl = 0,    f = [].concat(search),    r = [].concat(replace),    s = subject,
-	ra = Object.prototype.toString.call(r) === '[object Array]',
-	sa = Object.prototype.toString.call(s) === '[object Array]';
-	s = [].concat(s);
-	if (count)this.window[count] = 0;
-
-	for (i = 0, sl = s.length; i < sl; i++) {
-		if (s[i] === '') continue;
-		for (j = 0, fl = f.length; j < fl; j++) {
-			temp = s[i] + '';
-			repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0];
-			s[i] = (temp).split(f[j]).join(repl);
-			if (count && s[i] !== temp) this.window[count] += (temp.length - s[i].length) / f[j].length;
-		}
-	}
-	return sa ? s : s[0];
-}
-
-var $in_array = function(needle, haystack, argStrict){
-	var key = '',
-	strict = !! argStrict;
-
-	if (strict){
-		for (key in haystack) if (haystack[key] === needle) return true;
-	} else {
-		for (key in haystack) if (haystack[key] == needle) return true;
-	}
-	return false;
-}
-
-/* LOADERS */
-var $isJSON = function(str){
-	return (/^[\],:{}\s]*$/.test(str.replace(/\\["\\\/bfnrtu]/g, '@').
-	replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
-	replace(/(?:^|:|,)(?:\s*\[)+/g, '')));
-}
-
-var $load = function(url,callback,method=null,data=null){
-	var loader:URLLoader = new URLLoader();
-	var request:URLRequest = new URLRequest(url);
-
-	if(method!=null){
-		if(method=='post') request.method = URLRequestMethod.POST;
-		if(data){
-			var variables : URLVariables = new URLVariables();
-			for(var i in data) variables[i]=JSON.stringify(data[i]);
-			//variables.data = JSON.stringify(data);
-			request.data = variables;
-		}
-	}
-
-	loader.addEventListener(Event.COMPLETE, function(e:Event){
-		if(callback) callback.call(null,e.target.data);
-	});
-	loader.load(request);
-}
-
-var $http = function(url,data=null,callback=null,method=null){
-	if(typeof data == 'function') callback = data;
-
-	$load(url,function(data){
-		if($isJSON(data)) data = JSON.parse(data);
-		if(callback) callback.call(null,data);
-	},method,data);
-}
-
-var $get = function(url,data=null,callback=null){
-	$http(url,data,callback,'get');
-}
-
-var $post = function(url,data=null,callback=null){
-	$http(url,data,callback,'post');
-}
-
-var $doURL = function(url,target='_self'){
-	navigateToURL(new URLRequest(url), target);
-}
-
-var $newImg = function(where,url,arg1='img',arg2='img'){
-	var options = {'imageName':'img','callback':null};
-	var opt = {};
-	if(typeof arg1=='function' || typeof arg2=='function') opt=(typeof arg1=='function' ? arg1 : arg2);
-	for(var i in opt) if(opt[i]) options[i]=opt[i];
-
-	var imageLoader:Loader = new Loader();
-	var image:URLRequest = new URLRequest(url);
-	var tmpObj = new MovieClip();
-	imageLoader.load(image);
-	tmpObj.addChild(imageLoader);
-	where.addChild(tmpObj);
-	where[options['imgName']]=imageLoader;
-
-	if(options['callback']){
-		imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, function(e:Event){
-			options['callback'].call(e.target,null,e);
-		});
-	}
-	return tmpObj;
-}
-
-/* LOAD IMG */
-MovieClip.prototype.$addImg = function(url,arg1='img',arg2='img'){
-	$newImg(url,arg1,arg2);
-	return this;
-}
-
-/* ERROR HANDLE */
-if(loaderInfo.hasOwnProperty("uncaughtErrorEvents")) loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, function uncaughtErrorHandler( event:UncaughtErrorEvent ):void {
-	var deepDir = 2;
-	var maxStack = 3; // 0 for infinite;
-	var errorText:String;
-	var errorObj:Object = {};
-	var stack:String;
-	if( event.error is Error ) {
-		errorText = (event.error as Error).message;
-		errorObj.msg = errorText;
-		stack = (event.error as Error).getStackTrace();
-		errorObj.stack = stack;
-		if(stack != null){ errorText += stack; }
-	} else if( event.error is ErrorEvent ) {
-		errorText = (event.error as ErrorEvent).text;
-	} else {
-		errorText = event.text;
-	}
-	event.preventDefault();
-
-	var resp = [];
-	var asSplit = errorText.split(".as:");
-	for(var i=1;i<asSplit.length;i++){
-		var dir = [];
-		for(var k=deepDir;k>0;--k) dir.push(asSplit[i-1].split('\\').slice(k*-1)[0]);
-		resp.push(dir.join("/")+".as:"+asSplit[i].split("]")[0]);
-		if(maxStack && i>=maxStack) break;
-	}
-
-	console.log(errorObj.msg+"\n\n"+resp.join('\n'));
-});
-
-/* EXTERNAL FUNCS */
-var $js = function(js){
-	ExternalInterface.call(js);
-}
-
-var $getParams = function(){
-	return LoaderInfo(root.loaderInfo).parameters;
-};
-
-var $link = {};
-var $setVar = function(nameVar,val){
-	$link[nameVar]=val;
-}
-
-var $outFunc = function(name,func){
-	if($link[name]) return name;
-	$addLink(name,func);
-	return name;
-}
-
-var $addLink = function(name,func){
-	$link[name] = func;
-}
-
-var $runFunc = function(nameFunc){
-	arguments.splice(0,1);
-	$link[nameFunc].apply(null,arguments);
-}
-
-ExternalInterface.addCallback("setVar", $setVar);
-ExternalInterface.addCallback("runFunc", $runFunc);


[D] 清理

[D] 清理

--- age/src/age/renderers/BGRenderer.as
+++ age/src/age/renderers/BGRenderer.as
@@ -63,7 +63,6 @@
 		override public function onAssetLoadComplete(asset:IAsset):void
 		{
 			setTexture(_asset.textureAtlas.getTexture(info.textureName));
-			// filter = new WaveFilter(width, height, AGE.renderJuggler);
 			isFlipX = info.isFlipX;
 			isFlipY = info.isFlipY;


clean up

clean up

--- source/com/kemsky/support/StreamError.as
+++ source/com/kemsky/support/StreamError.as
@@ -12,7 +12,9 @@
     public class StreamError extends Error
     {
         /**
-         * @inheritDoc
+         * Constructor.
+         * @param message error description.
+         * @param errorID error number.
          */
         public function StreamError(message:String = null, errorID:int = 0)
         {


Transferred from the Adobe Open Source Subversion Repository

Revision: 11942
Author:   dloverin@adobe.com
Date:     2009-11-18T17:33:13.065717Z

Log Message:
-----------
StyleManager fixes.

Stop using the styleManager property in a constructor.
framework/src/mx/containers/DividedBox.as
framework/src/mx/containers/Form.as
framework/src/mx/controls/ButtonBar.as

Cache inheriting styles. Also made static arrays in StyleManagerImpl per-instance.
framework/src/mx/events/FlexChangeEvent.as
framework/src/mx/styles/StyleManagerImpl.as

Remove static StyleManager methods that were new to Flex 4 (qualifiedTypeSelectors property, getStyleDeclarations(), hasAdvancedSelectors(), hasPseudoCondition()).
framework/src/mx/styles/StyleManager.as

Update copyright.
framework/src/mx/styles/CSSMergedStyleDeclaration.as

QE notes: None.
Doc notes: None.
Bugs: SDK-24215
Reviewer: Alex
Tests run: checkintests, containers/DividedBox, containers/form, components/ButtonBar, Managers/StyleManager, PerModuleStyleManager
Is noteworthy for integration: yes - StyleManager performance improvement

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/DividedBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSMergedStyleDeclaration.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Form.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/FlexChangeEvent.as</path>

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

--- frameworks/projects/framework/src/mx/styles/StyleManager.as
+++ frameworks/projects/framework/src/mx/styles/StyleManager.as
@@ -178,35 +178,6 @@
     /**
      *  @private
      */
-    private static var _qualifiedTypeSelectors:Boolean = true;
-
-    /**
-     *  @private
-     *  Qualified type selectors were added in Flex 4 to support styling
-     *  components with the same local name, e.g. 'spark.components.Button'.
-     *  Prior to this type selectors were always unqualified class names  e.g.
-     *  'Button'. To ease migration of Flex 3 application, this property can
-     *  control whether CSS type selectors must be fully qualified class names
-     *  when the compatibility version is 4 or later.
-     */
-    [Deprecated(replacement="IStyleManager2.qualifiedTypeSelectors on a style manager instance",
-                since="4.0")]
-    mx_internal static function get qualifiedTypeSelectors():Boolean
-    {
-        return impl.qualifiedTypeSelectors;
-    }
-
-    /**
-     *  @private
-     */
-    mx_internal static function set qualifiedTypeSelectors(value:Boolean):void
-    {
-        impl.qualifiedTypeSelectors = value;
-    }
-
-    /**
-     *  @private
-     */
     [Deprecated(replacement="IStyleManager2.typeHierarchyCache on a style manager instance",
                 since="4.0")]
     mx_internal static function get typeHierarchyCache():Object
@@ -261,62 +232,6 @@
     public static function get selectors():Array
     {
         return impl.selectors;
-    }
-
-    /**
-     *  @private
-     *  Determines whether any of the selectors declared a pseudo selector
-     *  for the given state. This is used to avoid unnecessary style
-     *  regeneration between state changes.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    [Deprecated(replacement="IStyleManager2.hasPseudoCondition on a style manager instance",
-                since="4.0")]
-    mx_internal static function hasPseudoCondition(value:String):Boolean
-    {
-        return impl.hasPseudoCondition(value);
-    }
-
-    /**
-     *  @private
-     *  Determines whether any of the selectors registered with the style
-     *  manager have been advanced selectors (descendant selector, id selector,
-     *  non-global class selector, or pseudo selector).
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    [Deprecated(replacement="IStyleManager2.hasAdvancedSelectors on a style manager instance",
-                since="4.0")]
-    mx_internal static function hasAdvancedSelectors():Boolean
-    {
-        return impl.hasAdvancedSelectors();
-    }
-
-    /**
-     *  @private
-     *  Gets the list of style declarations for the given subject. The subject
-     *  is the right most simple type selector in a potential selector chain.
-     *
-     *  @param subject The style subject.
-     *  @return Array of StyleDeclarations for this subject.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    [Deprecated(replacement="IStyleManager2.getStyleDeclarations on a style manager instance",
-                since="4.0")]
-    mx_internal static function getStyleDeclarations(subject:String):Array
-    {
-        return impl.getStyleDeclarations(subject);
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 4748
Author:   dsubrama@adobe.com
Date:     2009-01-30T00:31:42.781368Z

Log Message:
-----------
Externalizing strings for the flex4 project. We now produce a resource bundle swc (flex4_rb.swc) that has all of the externalized strings for the flex4 project. We include 3 new bundles: components, layout and sparkEffects for the en_US locale. Other locales will come shortly.

QA: Yes, please doublecheck error messages are thrown with the correct error message.
Checkintests: Pass
Reviewer: Gordon

Modified Paths:
--------------
<path kind="file" action="A">/flex/sdk/trunk/components.properties</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxScroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LinearLayoutVector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/build.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/build.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxApplication.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/ArrayInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimateShaderTransition.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/Animation.as</path>
<path kind="file" action="A">/flex/sdk/trunk/layout.properties</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/NumberInterpolator.as</path>
<path kind="file" action="A">/flex/sdk/trunk/sparkEffects.properties</path>

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

--- frameworks/projects/spark/src/spark/components/DataGroup.as
+++ frameworks/projects/spark/src/spark/components/DataGroup.as
@@ -1,22 +1,21 @@
 package mx.components
 {
 import flash.display.DisplayObject;
+import flash.utils.Dictionary;

 import mx.collections.IList;
 import mx.components.baseClasses.GroupBase;
 import mx.core.IDataRenderer;
 import mx.core.IFactory;
+import mx.core.IInvalidating;
+import mx.core.ILayoutElement;
 import mx.core.IVisualElement;
 import mx.core.mx_internal;
-import mx.core.IInvalidating;
 import mx.events.CollectionEvent;
 import mx.events.CollectionEventKind;
 import mx.events.ItemExistenceChangedEvent;
-import mx.core.ILayoutElement;
 import mx.layout.LayoutBase;
 import mx.layout.LayoutElementFactory;
-import mx.styles.IStyleClient;
-import flash.utils.Dictionary;

 /**
@@ -34,6 +33,12 @@
  *  @eventType mx.events.ItemExistenceChangedEvent.ITEM_REMOVE
  */
 [Event(name="itemRemove", type="mx.events.ItemExistenceChangedEvent")]
+
+//--------------------------------------
+//  Other metadata
+//--------------------------------------
+
+[ResourceBundle("components")]

 [DefaultProperty("dataProvider")]

@@ -365,11 +370,12 @@
         // Couldn't find item renderer.  Throw an RTE.
         if (!myItemRenderer && failRTE)
         {
+        	var err:String;
             if (item is IVisualElement || item is DisplayObject)
-                throw new Error("DataGroup cannot display visual elements directly unless the elements " +
-                        "are display objects and implement IVisualElement");
+                err = resourceManager.getString("components", "cannotDisplayVisualElement");
             else
-                throw new Error("Could not create an item renderer for " + item);
+                err = resourceManager.getString("components", "unableToCreateRenderer", [item]);
+            throw new Error(err);
         }

         return myItemRenderer;
@@ -939,7 +945,7 @@
      */
     override public function addChild(child:DisplayObject):DisplayObject
     {
-        throw(new Error("This method is not available in this class.  Please consult the documentation."));
+        throw(new Error(resourceManager.getString("components", "methodUnavailable")));
     }

     /**
@@ -952,7 +958,7 @@
      */
     override public function addChildAt(child:DisplayObject, index:int):DisplayObject
     {
-        throw(new Error("This method is not available in this class.  Please consult the documentation."));
+        throw(new Error(resourceManager.getString("components", "methodUnavailable")));
     }

     /**
@@ -965,7 +971,7 @@
      */
     override public function removeChild(child:DisplayObject):DisplayObject
     {
-        throw(new Error("This method is not available in this class.  Please consult the documentation."));
+        throw(new Error(resourceManager.getString("components", "methodUnavailable")));
     }

     /**
@@ -978,7 +984,7 @@
      */
     override public function removeChildAt(index:int):DisplayObject
     {
-        throw(new Error("This method is not available in this class.  Please consult the documentation."));
+        throw(new Error(resourceManager.getString("components", "methodUnavailable")));
     }

     /**
@@ -991,7 +997,7 @@
      */
     override public function setChildIndex(child:DisplayObject, index:int):void
     {
-        throw(new Error("This method is not available in this class.  Please consult the documentation."));
+        throw(new Error(resourceManager.getString("components", "methodUnavailable")));
     }

     /**
@@ -1004,7 +1010,7 @@
      */
     override public function swapChildren(child1:DisplayObject, child2:DisplayObject):void
     {
-        throw(new Error("This method is not available in this class.  Please consult the documentation."));
+        throw(new Error(resourceManager.getString("components", "methodUnavailable")));
     }

     /**
@@ -1017,7 +1023,7 @@
      */
     override public function swapChildrenAt(index1:int, index2:int):void
     {
-        throw(new Error("This method is not available in this class.  Please consult the documentation."));
+        throw(new Error(resourceManager.getString("components", "methodUnavailable")));
     }
 }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 11070
Author:   rfrishbe@adobe.com
Date:     2009-10-21T23:56:10.882948Z

Log Message:
-----------
This has two changes: one is adding index to IItemRenderer and the other is adding handleHighlightBackground to ItemRenderer.  Adding an index property should speed things up a little bit, and it'll help fix a bug with renderers that have index-dependent drawing, like when alternatingItemColors is set.  handleHighlightBackground is a new shortcut property that will automatically handle drawing the background for selection/highlight in an item renderer.  For now, handleHighlightBackground defaults to false, so it shouldn’t affect anything.

The two new properties still need to be PARBed, and the handleHighlightBackround property in particular may change names and default values.

QE notes: We'll need to add new tests for this
Doc notes: We'll need some new documentation around the handleHighlightBackground property and the suggested approach for custom item renderers.
Bugs: SDK-22908
Reviewer: Deepa, Evtim
Tests run: checkintests, Mustella List, DataGroup, SkinnableDataContainer, ButtonBar, DropDownList
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ButtonBarButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/IItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataGroup.as</path>

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

--- frameworks/projects/spark/src/spark/components/DataGroup.as
+++ frameworks/projects/spark/src/spark/components/DataGroup.as
@@ -13,6 +13,7 @@
 {
 import flash.display.DisplayObject;
 import flash.events.Event;
+import flash.events.IEventDispatcher;

 import mx.collections.IList;
 import mx.core.IDataRenderer;
@@ -242,7 +243,7 @@
         }

         super.addChild(obj);
-        updateRenderer(renderer, _typicalItem);
+        updateRenderer(renderer, 0, _typicalItem);
         if (obj is IInvalidating)
             IInvalidating(obj).validateNow();
         setTypicalLayoutElement(renderer);
@@ -770,7 +771,7 @@
      *  new properties like owner, label, selected, etc.
      *
      */
-    private function updateRenderer(renderer:IVisualElement, data:Object):void
+    private function updateRenderer(renderer:IVisualElement, index:int, data:Object):void
     {
         if (!renderer)
            return;
@@ -786,6 +787,10 @@
         // Newly created renderer with no owner, set owner to this
         if (!renderer.owner)
             renderer.owner = this;
+
+        // Set the index
+        if (renderer is IItemRenderer)
+            IItemRenderer(renderer).index = index;

         // If a delegate is specified defer to the rendererUpdateDelegate
         // to update the renderer.
@@ -795,7 +800,7 @@
         // Else if we're the owner, set the label to the toString()
         // of the data
         else if (renderer.owner == this && renderer is IItemRenderer)
-            IItemRenderer(renderer).label = itemToLabel(data);
+            IItemRenderer(renderer).label = itemToLabel(data);

         // technically if this got called "recursively", this renderersBeingUpdated flag
         // would be prematurely set to false, but in most cases, this check should be
@@ -1049,7 +1054,7 @@
      */
     override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
     {
-        renderFillForMouseOpaque();
+        renderBackgroundFill();

         if (layout && layout.useVirtualLayout)
         {
@@ -1168,7 +1173,7 @@

             if (createdIR || recycledIR)
             {
-                updateRenderer(elt, item);
+                updateRenderer(elt, index, item);
                 if (!isNaN(eltWidth) || !isNaN(eltHeight))
                 {
                     // If we're going to set the width or height of this
@@ -1225,6 +1230,35 @@
         _layeringFlags |= (LAYERING_ENABLED | LAYERING_DIRTY);
         invalidateProperties();
     }
+
+    /**
+     *  @private
+     *  Recomputes every renderer's index.
+     *  This is useful when an item gets added that may change the renderer's
+     *  index.  In turn, this index may cuase the renderer to change appearance,
+     *  like when alternatingItemColors is used.
+     */
+    private function resetRenderersIndices():void
+    {
+        if (indexToRenderer.length > 0)
+        {
+            var vLayout:Boolean = layout && layout.useVirtualLayout;
+            var renderer:IItemRenderer;
+
+            var endIndex:int = vLayout ? virtualLayoutEndIndex : indexToRenderer.length - 1;
+            var startIndex:int = vLayout ? virtualLayoutStartIndex : 0;
+            // FIXME (rfrishbe): figure out how to iterate over item renderers
+            for (var i:int = startIndex; i <= endIndex; i++)
+            {
+                renderer = indexToRenderer[i] as IItemRenderer;
+
+                if (renderer)
+                    renderer.index = i;
+                // TODO (rfrishbe): could make this more optimal by only re-computing a subset of the visible
+                // item renderers, but it's probably not worth it
+            }
+        }
+    }

     /**
      *  Adds the itemRenderer for the specified dataProvider item to this DataGroup.
@@ -1266,7 +1300,7 @@
         var myItemRenderer:IVisualElement = createRendererForItem(item);
         indexToRenderer.splice(index, 0, myItemRenderer);
         addItemRendererToDisplayList(myItemRenderer as DisplayObject, index);
-        updateRenderer(myItemRenderer, item);
+        updateRenderer(myItemRenderer, index, item);
         dispatchEvent(new RendererExistenceEvent(
                       RendererExistenceEvent.RENDERER_ADD, false, false,
                       myItemRenderer, index, item));
@@ -1448,8 +1482,9 @@
                     var pe:PropertyChangeEvent = event.items[i];
                     if (pe)
                     {
-                        var renderer:IVisualElement = indexToRenderer[dataProvider.getItemIndex(pe.source)];
-                        updateRenderer(renderer, pe.source);
+                        var index:int = dataProvider.getItemIndex(pe.source);
+                        var renderer:IVisualElement = indexToRenderer[index];
+                        updateRenderer(renderer, index, pe.source);
                     }
                 }
                 break;
@@ -1467,6 +1502,10 @@
         {
             itemAdded(items[i], location + i);
         }
+
+        // the order might have changed, so we might need to redraw the other
+        // renderers that are order-dependent (for instance alternatingItemColor)
+        resetRenderersIndices();
     }

     /**
@@ -1479,6 +1518,10 @@
         {
             itemRemoved(items[i], location + i);
         }
+
+        // the order might have changed, so we might need to redraw the other
+        // renderers that are order-dependent (for instance alternatingItemColor)
+        resetRenderersIndices();
     }

     /**