Transferred from the Adobe Open Source Subversion Repository

Revision: 12291
Author:   smgilson@adobe.com
Date:     2009-11-30T20:05:25.519075Z

Log Message:
-----------
update old effects examples and add new ones. Add back the @includeExample tags to effects classes that had them removed for some reason.

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

Modified Paths:
--------------
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/effects/easing/examples</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/effects/easing/examples/assets</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/animation/MotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/Power.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/Sine.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/effects/animation/examples</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/effects/animation/examples/assets</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/effects/examples/Scale3DEffectExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/animation/SimpleMotionPath.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/effects/easing/examples/LinearEffectExample.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/effects/easing/examples/SinePowerEffectExample.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/effects/animation/examples/KeyFrameEffectExample.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/effects/easing/examples/assets/logo.jpg</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Animate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/controls/treeClasses/MXTreeItemRenderer.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/effects/easing</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/effects/examples/AnimateFilterEffectExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/Linear.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/effects/examples/Rotate3DEffectExample.mxml</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/spark/src/spark/effects/animation/Keyframe.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/effects/easing/examples/BounceElasticEffectExample.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/effects/examples/ScaleEffectExample.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/effects/examples/SetActionEffectExample.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/effects/animation/examples/assets/logo.jpg</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/effects/animation</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/effects/examples/Move3DEffectExample.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/spark/asdoc/en_US/spark/effects/examples/RotateEffectExample.mxml</path>

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

--- frameworks/projects/spark/src/spark/effects/easing/Bounce.as
+++ frameworks/projects/spark/src/spark/effects/easing/Bounce.as
@@ -18,6 +18,8 @@
  *  pulling on and bouncing the target object.
  *  The movement of the effect target accelerates toward the end value,
  *  and then bounces against the end value several times.
+ *
+ *  @includeExample examples/BounceElasticEffectExample.mxml
  *
  *  @langversion 3.0
  *  @playerversion Flash 10


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


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

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

 package spark.skins.mobile
 {


FLEX-34885 Added a unit test to make sure that object is re-run through the collection filter when any of its properties changes.

--- frameworks/projects/framework/tests/mx/collections/ListCollectionView_PropertyChangeEvent_Tests.as
+++ frameworks/projects/framework/tests/mx/collections/ListCollectionView_PropertyChangeEvent_Tests.as
@@ -116,6 +116,26 @@
         }

         [Test]
+        public function test_when_collection_item_changes_item_is_run_through_filter_and_there_is_no_fatal():void
+        {
+            //given
+            _sut.filterFunction = allowAll;
+            _sut.refresh();
+            const positionOfFirstWorkout:int = _sut.getItemIndex(_firstWorkout);
+
+            _noTimesFilterFunctionCalled = 0;
+            _lastFilteredObject = null;
+
+            //when
+            _firstWorkout.duration += 10;
+
+            //then - no fatal, and object has been filtered
+            assertEquals(1, _noTimesFilterFunctionCalled);
+            assertEquals(_firstWorkout, _lastFilteredObject);
+            assertEquals(positionOfFirstWorkout, _sut.getItemIndex(_firstWorkout));
+        }
+
+        [Test]
         public function test_when_collection_item_dispatches_PropertyChangeEvent_null_is_removed_from_list():void
         {
             //given


Appended unique data stream name to registration to prevent connection aliasing

--- return_of_the_rtmfpcat.as
+++ return_of_the_rtmfpcat.as
@@ -55,10 +55,12 @@
         private static const DEFAULT_CIRCON_TIMEOUT:uint = 4000;

         /* Maximum connections. */
-        private const MAXIMUM_RCP_PAIRS:uint = 1;
+        private const DEFAULT_MAXIMUM_RCP_PAIRS:uint = 1;

         /* Milliseconds. */
         private const FACILITATOR_POLL_INTERVAL:int = 10000;
+
+        private var max_rcp_pairs;

         /* TextField for debug output. */
         private var output_text:TextField;
@@ -88,6 +90,8 @@

         /* Number of connected RTMFPConnectionPairs. */
         private var rcp_pairs:uint;
+
+        private var rtmfp_data_counter:uint;

         /* Keep track of facilitator polling timer. */
         private var fac_poll_timeo_id:uint;
@@ -114,6 +118,9 @@

             /* Initialize connection pair count. */
             rcp_pairs = 0;
+
+            /* Unique counter for RTMFP data publishing. */
+            rtmfp_data_counter = 0;

             puts("Meow!");
             puts("Starting.");
@@ -167,6 +174,11 @@
                 cir_key = this.loaderInfo.parameters["cirrus_key"];
             else
                 cir_key = DEFAULT_CIRRUS_KEY;
+
+            if(this.loaderInfo.parameters["max_con"])
+                max_rcp_pairs = this.loaderInfo.parameters["max_con"];
+            else
+                max_rcp_pairs = DEFAULT_MAXIMUM_RCP_PAIRS;

             main();
         }
@@ -202,11 +214,12 @@
                     var rcp:RTMFPConnectionPair = new RTMFPConnectionPair(circon, tor_addr, output_text);
                     rcp.addEventListener(Event.CONNECT, rcp_connect_event);
                     rcp.addEventListener(Event.CLOSE, rcp_close_event);
-                    rcp.listen();
-
-                    puts("Registering with facilitator");
-                    /* Register ID with facilitator. */
-                    register_id(circon.nearID, fac_addr);
+                    rcp.listen(String(rtmfp_data_counter));
+
+                    var reg_str:String = circon.nearID + ":" + String(rtmfp_data_counter);
+                    puts("Registering " + reg_str + " with facilitator");
+                    register_id(reg_str, fac_addr);
+                    rtmfp_data_counter++;
                 }

                 break;
@@ -229,19 +242,25 @@
                 puts("Facilitator: I/O error: " + e.text + ".");
             });
             s_f.addEventListener(ProgressEvent.SOCKET_DATA, function (e:ProgressEvent):void {
-                var clientID:String = s_f.readMultiByte(e.bytesLoaded, "utf-8");
-                puts("Facilitator: got \"" + clientID + "\"");
-                if (clientID != "Registration list empty") {
-                    puts("Connecting to " + clientID + ".");
+                var client:String = s_f.readMultiByte(e.bytesLoaded, "utf-8");
+                puts("Facilitator: got \"" + client + "\"");
+                if (client != "Registration list empty") {
+                    puts("Connecting to " + client + ".");
+
+                    var client_id:String = client.split(":")[0];
+                    var client_data:String = client.split(":")[1];
+
+                    clearTimeout(fac_poll_timeo_id);
+
                     var rcp:RTMFPConnectionPair = new RTMFPConnectionPair(circon, tor_addr, output_text);
                     rcp.addEventListener(Event.CONNECT, rcp_connect_event);
                     rcp.addEventListener(Event.CLOSE, rcp_close_event);
-                    rcp.connect(clientID);
+                    rcp.connect(client_id, client_data);
                 } else {
                     /* Need to clear any outstanding timers to ensure
                      * that only one timer ever runs. */
                     clearTimeout(fac_poll_timeo_id);
-                    if(rcp_pairs < MAXIMUM_RCP_PAIRS)
+                    if(rcp_pairs < max_rcp_pairs)
                         fac_poll_timeo_id = setTimeout(poll_for_id, FACILITATOR_POLL_INTERVAL);
                 }
             });
@@ -260,17 +279,21 @@
             rcp_pairs++;

             if(proxy_mode) {
-                if(rcp_pairs < MAXIMUM_RCP_PAIRS) {
+                if(rcp_pairs < max_rcp_pairs) {
                     poll_for_id();
                 }
             } else {
                 /* Setup listening RTMFPConnectionPair. */
-                if(rcp_pairs < MAXIMUM_RCP_PAIRS) {
+                if(rcp_pairs < max_rcp_pairs) {
                     puts("Setting up listening RTMFPConnectionPair");
                     var rcp:RTMFPConnectionPair = new RTMFPConnectionPair(circon, tor_addr, output_text);
                     rcp.addEventListener(Event.CONNECT, rcp_connect_event);
                     rcp.addEventListener(Event.CLOSE, rcp_close_event);
-                    rcp.listen();
+                    rcp.listen(String(rtmfp_data_counter));
+                    var reg_str:String = circon.nearID + ":" + String(rtmfp_data_counter);
+                    puts("Registering " + reg_str + " with facilitator");
+                    register_id(reg_str, fac_addr);
+                    rtmfp_data_counter++;
                 }
             }
         }
@@ -284,16 +307,20 @@
             /* FIXME: Do I need to unregister the event listeners so
              * that the system can garbage collect the rcp object? */
             if(proxy_mode) {
-                if(rcp_pairs < MAXIMUM_RCP_PAIRS) {
+                if(rcp_pairs < max_rcp_pairs) {
                     poll_for_id();
                 }
             } else {
-                if(rcp_pairs < MAXIMUM_RCP_PAIRS) {
+                if(rcp_pairs < max_rcp_pairs) {
                     puts("Setting up listening RTMFPConnectionPair");
                     var rcp:RTMFPConnectionPair = new RTMFPConnectionPair(circon, tor_addr, output_text);
                     rcp.addEventListener(Event.CONNECT, rcp_connect_event);
                     rcp.addEventListener(Event.CLOSE, rcp_close_event);
-                    rcp.listen();
+                    rcp.listen(String(rtmfp_data_counter));
+                    var reg_str:String = circon.nearID + ":" + String(rtmfp_data_counter);
+                    puts("Registering " + reg_str + " with facilitator");
+                    register_id(reg_str, fac_addr);
+                    rtmfp_data_counter++;
                 }
             }
         }
@@ -362,7 +389,7 @@
 class RTMFPSocket extends EventDispatcher
 {
     /* The name of the "media" to pass between peers. */
-    private static const DATA:String = "data";
+    private var data:String;

     /* Connection to the Cirrus rendezvous service.
      * RTMFPSocket is established using this service. */
@@ -399,18 +426,22 @@
         });
     }

-    public function listen():void
-    {
+    public function listen(data:String):void
+    {
+        this.data = data;
+
         send_stream = new NetStream(circon, NetStream.DIRECT_CONNECTIONS);
         var client:Object = new Object();
         client.onPeerConnect = send_stream_peer_connect;
         send_stream.client = client;
-        send_stream.publish(DATA);
-    }
-
-    public function connect(clientID:String):void
+        send_stream.publish(data);
+    }
+
+    public function connect(clientID:String, data:String):void
     {
         puts("RTMFPSocket: connecting to peer...");
+
+        this.data = data;

         send_stream = new NetStream(circon, NetStream.DIRECT_CONNECTIONS);
         var client:Object = new Object();
@@ -422,7 +453,7 @@
             return true;
         };
         send_stream.client = client;
-        send_stream.publish(DATA);
+        send_stream.publish(data);

         recv_stream = new NetStream(circon, clientID);
         var client_rtmfp:RTMFPSocketClient = new RTMFPSocketClient();
@@ -434,7 +465,7 @@
         }, false, 0, true);

         recv_stream.client = client_rtmfp;
-        recv_stream.play(DATA);
+        recv_stream.play(data);
     }

     private function send_stream_peer_connect(peer:NetStream):Boolean
@@ -451,7 +482,7 @@
             dispatchEvent(new Event(Event.CONNECT));
         }, false, 0, true);
         recv_stream.client = client;
-        recv_stream.play(DATA);
+        recv_stream.play(data);

         peer.send("setPeerConnectAcknowledged");

@@ -574,20 +605,20 @@
         this.output_text = output_text;
     }

-    public function connect(clientID:String):void
+    public function connect(clientID:String, rtmfp_data:String):void
     {
         s_r = new RTMFPSocket(circon, output_text);
         s_r.addEventListener(Event.CONNECT, rtmfp_connect_event);
         s_r.addEventListener(Event.CLOSE, rtmfp_close_event);
-        s_r.connect(clientID);
-    }
-
-    public function listen():void
+        s_r.connect(clientID, rtmfp_data);
+    }
+
+    public function listen(rtmfp_data:String):void
     {
         s_r = new RTMFPSocket(circon, output_text);
         s_r.addEventListener(Event.CONNECT, rtmfp_connect_event);
         s_r.addEventListener(Event.CLOSE, rtmfp_close_event);
-        s_r.listen();
+        s_r.listen(rtmfp_data);
     }

     private function rtmfp_connect_event(e:Event):void


rm return_of_the_rtmfpcat.as.

rm return_of_the_rtmfpcat.as.

--- return_of_the_rtmfpcat.as
+++ return_of_the_rtmfpcat.as
@@ -1,794 +0,0 @@
-/* Meow! */
-package
-{
-    import flash.display.Sprite;
-    import flash.display.StageAlign;
-    import flash.display.StageScaleMode;
-    import flash.text.TextField;
-    import flash.text.TextFormat;
-    import flash.net.Socket;
-    import flash.events.Event;
-    import flash.events.EventDispatcher;
-    import flash.events.IOErrorEvent;
-    import flash.events.NetStatusEvent;
-    import flash.events.ProgressEvent;
-    import flash.events.SecurityErrorEvent;
-    import flash.utils.ByteArray;
-    import flash.utils.clearTimeout;
-    import flash.utils.setTimeout;
-    import flash.utils.clearInterval;
-    import flash.utils.setInterval;
-    import flash.utils.setTimeout;
-    import flash.net.NetConnection;
-
-    public class return_of_the_rtmfpcat extends Sprite
-    {
-        /* David's relay (nickname 3VXRyxz67OeRoqHn) that also serves a
-           crossdomain policy. */
-        private const DEFAULT_TOR_PROXY_ADDR:Object = {
-            host: "173.255.221.44",
-            port: 9001
-        };
-
-        /* Tor application running on the client. */
-        private const DEFAULT_TOR_CLIENT_ADDR:Object = {
-            host: "127.0.0.1",
-            port: 3333
-        };
-
-        /* Nate's facilitator -- also serving a crossdomain policy */
-        //private const DEFAULT_FACILITATOR_ADDR:Object = {
-        //    host: "128.12.179.80",
-        //    port: 9002
-        //};
-
-        /* David's facilitator. */
-        private const DEFAULT_FACILITATOR_ADDR:Object = {
-            host: "127.0.0.1",
-            port: 9002
-        };
-
-        /* Cirrus server information. */
-        private const DEFAULT_CIRRUS_ADDRESS:String = "rtmfp://p2p.rtmfp.net";
-        private const DEFAULT_CIRRUS_KEY:String = RTMFP::CIRRUS_KEY;
-
-        private static const DEFAULT_CIRCON_TIMEOUT:uint = 4000;
-
-        private static const DEFAULT_PEER_CON_TIMEOUT:uint = 4000;
-
-        /* Maximum connections. */
-        private const DEFAULT_MAXIMUM_RCP_PAIRS:uint = 1;
-
-        /* Milliseconds. */
-        private const FACILITATOR_POLL_INTERVAL:int = 10000;
-
-        private var max_rcp_pairs:uint;
-
-        /* TextField for debug output. */
-        private var output_text:TextField;
-
-        /* Are we the proxy or the client? */
-        private var proxy_mode:Boolean;
-
-        /* Facilitator address */
-        private var fac_addr:Object;
-
-        /* Tor address. If we're a proxy, then this address is a relay.
-         * If we're running on the client, then this address is the Tor
-         * client application. */
-        private var tor_addr:Object;
-
-        /* Cirrus address */
-        private var cir_addr:String;
-
-        /* Cirrus key */
-        private var cir_key:String;
-
-        /* Connection to the Cirrus rendezvous service */
-        private var circon:NetConnection;
-
-        /* Cirrus connection timeout ID. */
-        private var circon_timeo_id:int;
-
-        /* Number of connected RTMFPConnectionPairs. */
-        private var rcp_pairs:uint;
-        private var rcp_pairs_total:uint;
-
-        private var rtmfp_data_counter:uint;
-
-        /* Keep track of facilitator polling timer. */
-        private var fac_poll_timeo_id:uint;
-
-        /* Badge with a client counter */
-        [Embed(source="badge.png")]
-        private var BadgeImage:Class;
-        private var tot_client_count_tf:TextField;
-        private var tot_client_count_fmt:TextFormat;
-        private var cur_client_count_tf:TextField;
-        private var cur_client_count_fmt:TextFormat;
-
-        /* Put a string to the screen. */
-        public function puts(s:String):void
-        {
-            output_text.appendText(s + "\n");
-            output_text.scrollV = output_text.maxScrollV;
-        }
-
-        public function update_client_count():void
-        {
-            /* Update total client count. */
-            if (String(rcp_pairs_total).length == 1)
-                tot_client_count_tf.text = "0" + String(rcp_pairs_total);
-            else
-                tot_client_count_tf.text = String(rcp_pairs_total);
-
-            /* Update current client count. */
-            cur_client_count_tf.text = "";
-            for(var i:Number=0; i<rcp_pairs; i++)
-                cur_client_count_tf.appendText(".");;
-        }
-
-        public function return_of_the_rtmfpcat()
-        {
-            // Absolute positioning.
-            stage.scaleMode = StageScaleMode.NO_SCALE;
-            stage.align = StageAlign.TOP_LEFT;
-
-            output_text = new TextField();
-            output_text.width = stage.stageWidth;
-            output_text.height = stage.stageHeight;
-            output_text.background = true;
-            output_text.backgroundColor = 0x001f0f;
-            output_text.textColor = 0x44cc44;
-
-            /* Setup client counter for badge. */
-            tot_client_count_fmt = new TextFormat();
-            tot_client_count_fmt.color = 0xFFFFFF;
-            tot_client_count_fmt.align = "center";
-            tot_client_count_fmt.font = "courier-new";
-            tot_client_count_fmt.bold = true;
-            tot_client_count_fmt.size = 10;
-            tot_client_count_tf = new TextField();
-            tot_client_count_tf.width = 20;
-            tot_client_count_tf.height = 17;
-            tot_client_count_tf.background = false;
-            tot_client_count_tf.defaultTextFormat = tot_client_count_fmt;
-            tot_client_count_tf.x=47;
-            tot_client_count_tf.y=0;
-
-            cur_client_count_fmt = new TextFormat();
-            cur_client_count_fmt.color = 0xFFFFFF;
-            cur_client_count_fmt.align = "center";
-            cur_client_count_fmt.font = "courier-new";
-            cur_client_count_fmt.bold = true;
-            cur_client_count_fmt.size = 10;
-            cur_client_count_tf = new TextField();
-            cur_client_count_tf.width = 20;
-            cur_client_count_tf.height = 17;
-            cur_client_count_tf.background = false;
-            cur_client_count_tf.defaultTextFormat = cur_client_count_fmt;
-            cur_client_count_tf.x=47;
-            cur_client_count_tf.y=6;
-
-            /* Update the client counter on badge. */
-            update_client_count();
-
-            /* Initialize connection pair count. */
-            rcp_pairs = 0;
-
-            /* Unique counter for RTMFP data publishing. */
-            rtmfp_data_counter = 0;
-
-            puts("Meow!");
-            puts("Starting.");
-            // Wait until the query string parameters are loaded.
-            this.loaderInfo.addEventListener(Event.COMPLETE, loaderinfo_complete);
-        }
-
-        private function loaderinfo_complete(e:Event):void
-        {
-            var fac_spec:String;
-            var tor_spec:String;
-
-            puts("Parameters loaded.");
-
-            proxy_mode = (this.loaderInfo.parameters["proxy"] != null);
-
-            if(this.loaderInfo.parameters["debug"] != null)
-                addChild(output_text);
-
-            addChild(new BadgeImage());
-            /* Tried unsuccessfully to add counter to badge. */
-            /* For now, need two addChilds :( */
-            addChild(tot_client_count_tf);
-            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;
-            }
-
-            tor_spec = this.loaderInfo.parameters["tor"];
-            if (tor_spec) {
-                puts("Tor spec: \"" + tor_spec + "\"");
-                tor_addr = parse_addr_spec(tor_spec);
-                if (!tor_addr) {
-                    puts("Error: Tor spec must be in the form \"host:port\".");
-                    return;
-                }
-            } else {
-                if (proxy_mode)
-                    tor_addr = DEFAULT_TOR_PROXY_ADDR;
-                else
-                    tor_addr = DEFAULT_TOR_CLIENT_ADDR;
-            }
-
-            if(this.loaderInfo.parameters["cirrus_server"])
-                cir_addr = this.loaderInfo.parameters["cirrus_server"];
-            else
-                cir_addr = DEFAULT_CIRRUS_ADDRESS;
-
-            if(this.loaderInfo.parameters["cirrus_key"])
-                cir_key = this.loaderInfo.parameters["cirrus_key"];
-            else
-                cir_key = DEFAULT_CIRRUS_KEY;
-
-            if(this.loaderInfo.parameters["max_con"])
-                max_rcp_pairs = this.loaderInfo.parameters["max_con"];
-            else
-                max_rcp_pairs = DEFAULT_MAXIMUM_RCP_PAIRS;
-
-            if(this.loaderInfo.parameters["start"])
-                rtmfp_data_counter = this.loaderInfo.parameters["start"];
-
-            main();
-        }
-
-        /* The main logic begins here, after start-up issues are taken care of. */
-        private function main():void
-        {
-            puts("Making connection to cirrus server.");
-            circon = new NetConnection();
-            circon.addEventListener(NetStatusEvent.NET_STATUS, circon_netstatus_event);
-            circon.addEventListener(IOErrorEvent.IO_ERROR, function (e:Event):void {
-                puts("Cirrus connection had an IOErrorEvent.IO_ERROR event");
-            });
-            circon.addEventListener(SecurityErrorEvent.SECURITY_ERROR, function (e:Event):void {
-                puts("Cirrus connection had a SecurityErrorEvent.SECURITY_ERROR");
-            });
-            circon.connect(cir_addr + "/" + cir_key);
-            circon_timeo_id = setInterval(circon_timeout, DEFAULT_CIRCON_TIMEOUT);
-        }
-
-        private function circon_netstatus_event(event:NetStatusEvent):void
-        {
-            switch (event.info.code) {
-            case "NetConnection.Connect.Success" :
-                puts("Cirrus server connection established.");
-                puts("Got id " + circon.nearID + ".");
-                clearInterval(circon_timeo_id);
-
-                if(proxy_mode) {
-                   poll_for_id();
-                } else {
-                    puts("Setting up listening RTMFPConnectionPair");
-                    var rcp:RTMFPConnectionPair = new RTMFPConnectionPair(circon, tor_addr, output_text);
-                    rcp.addEventListener(Event.CONNECT, rcp_connect_event);
-                    rcp.addEventListener(Event.CLOSE, rcp_close_event);
-                    rcp.listen(String(rtmfp_data_counter));
-
-                    var reg_str:String = circon.nearID + ":" + String(rtmfp_data_counter);
-                    puts("Registering " + reg_str + " with facilitator");
-                    register_id(reg_str, fac_addr);
-                    rtmfp_data_counter++;
-                }
-
-                break;
-            }
-        }
-
-        private function poll_for_id():void
-        {
-            puts("Facilitator: got " + rcp_pairs + " connections... polling for another");
-
-            var s_f:Socket = new Socket();
-            s_f.addEventListener(Event.CONNECT, function (e:Event):void {
-                puts("Facilitator: connected to " + fac_addr.host + ":" + fac_addr.port + ".");
-                s_f.writeUTFBytes("GET / HTTP/1.0\r\n\r\n");
-            });
-            s_f.addEventListener(Event.CLOSE, function (e:Event):void {
-                puts("Facilitator: connection closed.");
-            });
-            s_f.addEventListener(IOErrorEvent.IO_ERROR, function (e:IOErrorEvent):void {
-                puts("Facilitator: I/O error: " + e.text + ".");
-            });
-            s_f.addEventListener(ProgressEvent.SOCKET_DATA, function (e:ProgressEvent):void {
-                var client:String = s_f.readMultiByte(e.bytesLoaded, "utf-8");
-                puts("Facilitator: got \"" + client + "\"");
-                if (client != "Registration list empty") {
-                    puts("Connecting to " + client + ".");
-
-                    var client_id:String = client.split(":")[0];
-                    var client_data:String = client.split(":")[1];
-
-                    clearTimeout(fac_poll_timeo_id);
-
-                    var rcp:RTMFPConnectionPair = new RTMFPConnectionPair(circon, tor_addr, output_text);
-                    rcp.addEventListener(Event.CONNECT, rcp_connect_event);
-                    rcp.addEventListener(Event.UNLOAD, function (e:Event):void {
-                        /* Failed to connect to peer... continue loop. */
-                        puts("RTMFPConnectionPair: Timed out connecting to peer!");
-                        if(rcp_pairs < max_rcp_pairs)
-                            poll_for_id();
-                    });
-                    rcp.addEventListener(Event.CLOSE, rcp_close_event);
-                    rcp.connect(client_id, client_data, DEFAULT_PEER_CON_TIMEOUT);
-                } else {
-                    /* Need to clear any outstanding timers to ensure
-                     * that only one timer ever runs. */
-                    clearTimeout(fac_poll_timeo_id);
-                    if(rcp_pairs < max_rcp_pairs)
-                        fac_poll_timeo_id = setTimeout(poll_for_id, FACILITATOR_POLL_INTERVAL);
-                }
-            });
-            s_f.addEventListener(SecurityErrorEvent.SECURITY_ERROR, function (e:SecurityErrorEvent):void {
-                puts("Facilitator: security error: " + e.text + ".");
-            });
-
-            s_f.connect(fac_addr.host, fac_addr.port);
-
-        }
-
-        private function rcp_connect_event(e:Event):void
-        {
-            puts("RTMFPConnectionPair connected");
-
-            rcp_pairs++;
-            rcp_pairs_total++;
-
-            /* Update the client count on the badge. */
-            update_client_count();
-
-            if(proxy_mode) {
-                if(rcp_pairs < max_rcp_pairs) {
-                    poll_for_id();
-                }
-            } else {
-                /* Setup listening RTMFPConnectionPair. */
-                if(rcp_pairs < max_rcp_pairs) {
-                    puts("Setting up listening RTMFPConnectionPair");
-                    var rcp:RTMFPConnectionPair = new RTMFPConnectionPair(circon, tor_addr, output_text);
-                    rcp.addEventListener(Event.CONNECT, rcp_connect_event);
-                    rcp.addEventListener(Event.CLOSE, rcp_close_event);
-                    rcp.listen(String(rtmfp_data_counter));
-                    var reg_str:String = circon.nearID + ":" + String(rtmfp_data_counter);
-                    puts("Registering " + reg_str + " with facilitator");
-                    register_id(reg_str, fac_addr);
-                    rtmfp_data_counter++;
-                }
-            }
-        }
-
-        private function rcp_close_event(e:Event):void
-        {
-            puts("RTMFPConnectionPair closed");
-
-            rcp_pairs--;
-
-            /* Update the client count on the badge. */
-            update_client_count();
-
-            /* FIXME: Do I need to unregister the event listeners so
-             * that the system can garbage collect the rcp object? */
-            if(proxy_mode) {
-                if(rcp_pairs < max_rcp_pairs) {
-                    poll_for_id();
-                }
-            } else {
-                if(rcp_pairs < max_rcp_pairs) {
-                    puts("Setting up listening RTMFPConnectionPair");
-                    var rcp:RTMFPConnectionPair = new RTMFPConnectionPair(circon, tor_addr, output_text);
-                    rcp.addEventListener(Event.CONNECT, rcp_connect_event);
-                    rcp.addEventListener(Event.CLOSE, rcp_close_event);
-                    rcp.listen(String(rtmfp_data_counter));
-                    var reg_str:String = circon.nearID + ":" + String(rtmfp_data_counter);
-                    puts("Registering " + reg_str + " with facilitator");
-                    register_id(reg_str, fac_addr);
-                    rtmfp_data_counter++;
-                }
-            }
-        }
-
-        private function register_id(id:String, fac_addr:Object):void
-        {
-            var s_f:Socket = new Socket();
-            s_f.addEventListener(Event.CONNECT, function (e:Event):void {
-                puts("Facilitator: connected to " + fac_addr.host + ":" + fac_addr.port + ".");
-                puts("Facilitator: Registering id " + id);
-                s_f.writeUTFBytes("POST / HTTP/1.0\r\n\r\nclient=" + id + "\r\n");
-            });
-            s_f.addEventListener(Event.CLOSE, function (e:Event):void {
-                puts("Facilitator: connection closed.");
-            });
-            s_f.addEventListener(IOErrorEvent.IO_ERROR, function (e:IOErrorEvent):void {
-                puts("Facilitator: I/O error: " + e.text + ".");
-            });
-            s_f.addEventListener(SecurityErrorEvent.SECURITY_ERROR, function (e:SecurityErrorEvent):void {
-                puts("Facilitator: security error: " + e.text + ".");
-            });
-
-            s_f.connect(fac_addr.host, fac_addr.port);
-        }
-
-        private function circon_timeout():void
-        {
-            puts("Cirrus server connection timed out!");
-        }
-
-        /* Parse an address in the form "host:port". Returns an Object with
-           keys "host" (String) and "port" (int). Returns null on error. */
-        private static function parse_addr_spec(spec:String):Object
-        {
-            var parts:Array;
-            var addr:Object;
-
-            parts = spec.split(":", 2);
-            if (parts.length != 2 || !parseInt(parts[1]))
-                return null;
-            addr = {}
-            addr.host = parts[0];
-            addr.port = parseInt(parts[1]);
-
-            return addr;
-        }
-    }
-}
-
-import flash.display.Sprite;
-import flash.events.Event;
-import flash.events.EventDispatcher;
-import flash.events.IOErrorEvent;
-import flash.events.ProgressEvent;
-import flash.events.SecurityErrorEvent;
-import flash.events.NetStatusEvent;
-import flash.net.Socket;
-import flash.utils.ByteArray;
-import flash.utils.clearTimeout;
-import flash.utils.getTimer;
-import flash.utils.setTimeout;
-import flash.net.NetConnection;
-import flash.net.NetStream;
-import flash.text.TextField;
-
-class RTMFPSocket extends EventDispatcher
-{
-    /* The name of the "media" to pass between peers. */
-    private var data:String;
-
-    /* Connection to the Cirrus rendezvous service.
-     * RTMFPSocket is established using this service. */
-    private var circon:NetConnection;
-
-    /* Unidirectional streams composing socket. */
-    private var send_stream:NetStream;
-    private var recv_stream:NetStream;
-
-    /* Keeps the state of our connectedness. */
-    public var connected:Boolean;
-
-    private var connect_timeo_id:uint;
-
-    private var output_text:TextField;
-
-    /* Put a string to the screen. */
-    public function puts(s:String):void
-    {
-        output_text.appendText(s + "\n");
-        output_text.scrollV = output_text.maxScrollV;
-    }
-
-    public function RTMFPSocket(circon:NetConnection, output_text:TextField)
-    {
-        this.circon = circon;
-        this.output_text = output_text;
-        connected = false;
-
-        circon.addEventListener(NetStatusEvent.NET_STATUS, circon_netstatus_event);
-        circon.addEventListener(IOErrorEvent.IO_ERROR, function (e:Event):void {
-            puts("RTMFPSocket: Cirrus connection had an IOErrorEvent.IO_ERROR event");
-        });
-        circon.addEventListener(SecurityErrorEvent.SECURITY_ERROR, function (e:Event):void {
-            puts("RTMFPSocket: Cirrus connection had a SecurityErrorEvent.SECURITY_ERROR");
-        });
-    }
-
-    public function listen(data:String):void
-    {
-        this.data = data;
-
-        send_stream = new NetStream(circon, NetStream.DIRECT_CONNECTIONS);
-        var client:Object = new Object();
-        client.onPeerConnect = send_stream_peer_connect;
-        send_stream.client = client;
-        send_stream.publish(data);
-    }
-
-    private function connect_timeout():void
-    {
-        puts("RTMFPSocket: Timed out connecting to peer");
-        close();
-        /* OK this is not so nice, because I wanted an Event.TIMEOUT event, but flash gives us none such event :( */
-        dispatchEvent(new Event(Event.UNLOAD));
-    }
-
-    public function connect(clientID:String, data:String, timeout:uint):void
-    {
-        puts("RTMFPSocket: connecting to peer...");
-
-        connect_timeo_id = setTimeout(connect_timeout, timeout);
-
-        this.data = data;
-
-        send_stream = new NetStream(circon, NetStream.DIRECT_CONNECTIONS);
-        var client:Object = new Object();
-        client.onPeerConnect = function (peer:NetStream):Boolean {
-            clearTimeout(connect_timeo_id);
-            puts("RTMFPSocket: connected to peer");
-            connected = true;
-            dispatchEvent(new Event(Event.CONNECT));
-            peer.send("setPeerConnectAcknowledged");
-            return true;
-        };
-        send_stream.client = client;
-        send_stream.publish(data);
-
-        recv_stream = new NetStream(circon, clientID);
-        var client_rtmfp:RTMFPSocketClient = new RTMFPSocketClient();
-        client_rtmfp.addEventListener(ProgressEvent.SOCKET_DATA, function (event:ProgressEvent):void {
-            dispatchEvent(event);
-        }, false, 0, true);
-        client_rtmfp.addEventListener(RTMFPSocketClient.PEER_CONNECT_ACKNOWLEDGED, function (event:Event):void {
-            /* Empty... here for symmetry. */
-        }, false, 0, true);
-
-        recv_stream.client = client_rtmfp;
-        recv_stream.play(data);
-    }
-
-    private function send_stream_peer_connect(peer:NetStream):Boolean
-    {
-        puts("RTMFPSocket: peer connecting...");
-        recv_stream = new NetStream(circon, peer.farID);
-        var client:RTMFPSocketClient = new RTMFPSocketClient();
-        client.addEventListener(ProgressEvent.SOCKET_DATA, function (event:ProgressEvent):void {
-            dispatchEvent(event);
-        }, false, 0, true);
-        client.addEventListener(RTMFPSocketClient.PEER_CONNECT_ACKNOWLEDGED, function (event:Event):void {
-            puts("RTMFPSocket: peer connected");
-            connected = true;
-            dispatchEvent(new Event(Event.CONNECT));
-        }, false, 0, true);
-        recv_stream.client = client;
-        recv_stream.play(data);
-
-        peer.send("setPeerConnectAcknowledged");
-
-        return true;
-    }
-
-    private function circon_netstatus_event(event:NetStatusEvent):void
-    {
-        switch (event.info.code) {
-        case "NetStream.Connect.Closed" :
-            puts("RTMFPSocket: NetStream connection was closed");
-
-            if(connected)
-            {
-                send_stream.close();
-                recv_stream.close();
-                connected = false;
-                dispatchEvent(new Event(Event.CLOSE));
-            }
-
-            break;
-        }
-    }
-
-
-    public function readBytes(bytes:ByteArray, offset:uint = 0, length:uint = 0):void
-    {
-        recv_stream.client.bytes.readBytes(bytes, offset, length);
-    }
-
-    public function writeBytes(bytes:ByteArray):void
-    {
-        send_stream.send("dataAvailable", bytes);
-    }
-
-    public function close():void
-    {
-        puts("RTMFPSocket: closing...");
-        send_stream.close();
-        recv_stream.close();
-        connected = false;
-    }
-}
-
-[Event(name="peerConnectAcknowledged", type="flash.events.Event")]
-dynamic class RTMFPSocketClient extends EventDispatcher
-{
-    public static const PEER_CONNECT_ACKNOWLEDGED:String = "peerConnectAcknowledged";
-
-    private var _bytes:ByteArray;
-    private var _peerID:String;
-    private var _peerConnectAcknowledged:Boolean;
-
-    public function RTMFPSocketClient()
-    {
-        super();
-        _bytes = new ByteArray();
-        _peerID = null;
-        _peerConnectAcknowledged = false;
-    }
-
-    public function get bytes():ByteArray
-    {
-        return _bytes;
-    }
-
-    public function dataAvailable(bytes:ByteArray):void
-    {
-        this._bytes.clear();
-        bytes.readBytes(this._bytes);
-        dispatchEvent(new ProgressEvent(ProgressEvent.SOCKET_DATA, false, false, this._bytes.bytesAvailable, this._bytes.length));
-    }
-
-    public function get peerConnectAcknowledged():Boolean
-    {
-        return _peerConnectAcknowledged;
-    }
-
-    public function setPeerConnectAcknowledged():void
-    {
-        _peerConnectAcknowledged = true;
-        dispatchEvent(new Event(PEER_CONNECT_ACKNOWLEDGED));
-    }
-
-    public function get peerID():String
-    {
-        return _peerID;
-    }
-
-    public function set peerID(id:String):void
-    {
-       _peerID = id;
-    }
-
-}
-
-class RTMFPConnectionPair extends EventDispatcher
-{
-    private var circon:NetConnection;
-
-    private var tor_addr:Object;
-
-    private var s_r:RTMFPSocket;
-
-    private var s_t:Socket;
-
-    private var output_text:TextField;
-
-    /* Put a string to the screen. */
-    public function puts(s:String):void
-    {
-        output_text.appendText(s + "\n");
-        output_text.scrollV = output_text.maxScrollV;
-    }
-
-    public function RTMFPConnectionPair(circon:NetConnection, tor_addr:Object, output_text:TextField)
-    {
-        this.circon = circon;
-        this.tor_addr = tor_addr;
-        this.output_text = output_text;
-    }
-
-    public function connect(clientID:String, rtmfp_data:String, timeout:uint):void
-    {
-        s_r = new RTMFPSocket(circon, output_text);
-        s_r.addEventListener(Event.CONNECT, rtmfp_connect_event);
-        s_r.addEventListener(Event.UNLOAD, function (e:Event):void {
-            dispatchEvent(new Event(Event.UNLOAD));
-        });
-        s_r.addEventListener(ProgressEvent.SOCKET_DATA, function (e:ProgressEvent):void {
-            /* It's possible that we receive data before we're connected
-             * to the tor-side of the connection. In this case we want
-             * to buffer the data. */
-            if(!s_t.connected) {
-                puts("MASSIVE ATTACK!");
-            } else {
-                var bytes:ByteArray = new ByteArray();
-                s_r.readBytes(bytes, 0, e.bytesLoaded);
-                puts("RTMFPConnectionPair: RTMFP: read " + bytes.length + " bytes.");
-                s_t.writeBytes(bytes);
-            }
-        });
-        s_r.addEventListener(Event.CLOSE, rtmfp_close_event);
-        s_r.connect(clientID, rtmfp_data, timeout);
-    }
-
-    public function listen(rtmfp_data:String):void
-    {
-        s_r = new RTMFPSocket(circon, output_text);
-        s_r.addEventListener(Event.CONNECT, rtmfp_connect_event);
-        s_r.addEventListener(ProgressEvent.SOCKET_DATA, function (e:ProgressEvent):void {
-            /* It's possible that we receive data before we're connected
-             * to the tor-side of the connection. In this case we want
-             * to buffer the data. */
-            if(!s_t.connected) {
-                puts("MASSIVE ATTACK!");
-            } else {
-                var bytes:ByteArray = new ByteArray();
-                s_r.readBytes(bytes, 0, e.bytesLoaded);
-                puts("RTMFPConnectionPair: RTMFP: read " + bytes.length + " bytes.");
-                s_t.writeBytes(bytes);
-            }
-        });
-
-        s_r.addEventListener(Event.CLOSE, rtmfp_close_event);
-        s_r.listen(rtmfp_data);
-    }
-
-    private function rtmfp_connect_event(e:Event):void
-    {
-        puts("RTMFPConnectionPair: RTMFPSocket side connected!");
-        puts("RTMFPConnectionPair: setting up tor side connection...");
-
-        /* Setup tor connection linked to RTMFPSocket. */
-        s_t = new Socket();
-        s_t.addEventListener(Event.CONNECT, function (e:Event):void {
-            puts("RTMFPConnectionPair: Tor: connected to " + tor_addr.host + ":" + tor_addr.port + ".");
-            dispatchEvent(new Event(Event.CONNECT));
-        });
-        s_t.addEventListener(Event.CLOSE, function (e:Event):void {
-            puts("RTMFPConnectionPair: Tor: closed connection.");
-            /* Close other side of connection pair if it is open and
-             * dispatch close event. */
-            if(s_r.connected)
-                s_r.close();
-            dispatchEvent(new Event(Event.CLOSE));
-        });
-        s_t.addEventListener(ProgressEvent.SOCKET_DATA, function (e:ProgressEvent):void {
-            var bytes:ByteArray = new ByteArray();
-            s_t.readBytes(bytes, 0, e.bytesLoaded);
-            puts("RTMFPConnectionPair: Tor: read " + bytes.length + " bytes.");
-            s_r.writeBytes(bytes);
-        });
-        s_t.addEventListener(IOErrorEvent.IO_ERROR, function (e:IOErrorEvent):void {
-            puts("RTMFPConnectionPair: Tor: I/O error: " + e.text + ".");
-        });
-        s_t.addEventListener(SecurityErrorEvent.SECURITY_ERROR, function (e:SecurityErrorEvent):void {
-            puts("RTMFPConnectionPair: Tor: security error: " + e.text + ".");
-        });
-
-        s_t.connect(tor_addr.host, tor_addr.port);
-    }
-
-    private function rtmfp_close_event(e:Event):void
-    {
-       puts("RTMFPConnectionPair: RTMFPSocket closed connection");
-       /* Close other side of connection pair if it is open and dispatch
-        * close event. */
-       if(s_t.connected)
-           s_t.close();
-       dispatchEvent(new Event(Event.CLOSE));
-    }
-
-}


fix square process form

fix square process form

--- src/milkshape/media/flash/src/cc/milkshape/grid/GridModel.as
+++ src/milkshape/media/flash/src/cc/milkshape/grid/GridModel.as
@@ -156,7 +156,7 @@
 			{
 				var squareObject:*;
 				// si status = false et pas de background alors c'est une booked
-				if(square.status || square.background_image != null && square.status){
+				if(square.status || (square.background_image != null && !square.status)){
 					squareObject = new SquareFull(square.pos_x + minX, square.pos_y + minY, square.background_image_path, squareSize);
 					squareObject.layers = square.layers;
 					squareObject.neighbors = square.neighbors_keys;
@@ -209,7 +209,6 @@
 		{
 			if(currentScale == maxScale)// Si on est au zoom maximal
 			{
-				trace('ok');
 				var square:Square = focusSquare;
 				if(square is SquareOpen)
 				{


naive dependency version

naive dependency version

--- fp9/src/as3isolib/display/renderers/DefaultSceneLayoutRenderer.as
+++ fp9/src/as3isolib/display/renderers/DefaultSceneLayoutRenderer.as
@@ -33,6 +33,7 @@
 	import as3isolib.core.IIsoDisplayObject;
 	import as3isolib.core.as3isolib_internal;
 	import as3isolib.display.scene.IIsoScene;
+	import flash.utils.Dictionary;

 	import flash.utils.getTimer;

@@ -54,85 +55,83 @@
 		{
 			var startTime:uint = getTimer();

-			// Rewrite by David Holz
+			// Rewrite #2 by David Holz, naive dependency version

-			// NOTE - Flash player 10 only
-			// Using scene.children because they are in last display order, scene.displayListChildren are unordered and fully resorted every time!
-			//var sortedChildren:Vector.<IIsoDisplayObject> = Vector.<IIsoDisplayObject>(scene.children);
+			// IIsoDisplayObject -> [obj that should be behind the key]
+			var dependency:Dictionary = new Dictionary();

-			// Flash player 9
-			var sortedChildren:Array = scene.children.slice();
+			var children:Array = scene.displayListChildren;

-			// Ocean sort, from http://cadaver.homeftp.net/rants/sprite.htm
-			// Starting from offset 1, make sure [N] >= [N-1].  If not, keep pushing N back in the list until it's >= the new [N-1]
-			// This sort works best when there are minor changes to the depth ordering that need to be patched up
+			// Full naive cartesian scan, see what objects are behind child[i]
+			var max:uint = children.length;
+			for (var i:uint = 0; i < max; ++i)
+			{
+				var behind:Array = [];
+
+				var objA:IIsoDisplayObject = children[i];
+				var boundsA:IBounds = objA.isoBounds;
+
+				for (var j:uint = 0; j < max; ++j)
+				{
+					var objB:IIsoDisplayObject = children[j];
+					var boundsB:IBounds = objB.isoBounds;
+
+					// See if B should go behind A
+					if (// Behind in any axis,
+					    ((boundsB.top <= boundsA.bottom) ||
+						 (boundsB.right <= boundsA.left) ||
+						 (boundsB.front <= boundsA.back))
+						&&
+						// but not in front in any other axis
+						!((boundsB.bottom >= boundsA.top) ||
+						  (boundsB.left >= boundsA.right) ||
+						  (boundsB.back >= boundsA.front)))
+					{
+						behind.push(objB);
+					}
+				}
+				dependency[objA] = behind;
+			}
+
+			// Place the children into a sorted array, using dependency ordering
+			var sortedChildren:Array = [];

-			// All of the aditional variables are to reduce the number of array accesses, which are all bounds checked by the VM.  Each removed array access lopped more time off the render.
-			var max:uint = sortedChildren.length;
-			var objB:IIsoDisplayObject = sortedChildren[0];
-			var boundsB:IBounds = objB.isoBounds;
-			for (var i:uint = 1; i < max; ++i)
+			// IIsoDisplayObject -> Boolean, true signifies it's already been put in the display list
+			var visited:Dictionary = new Dictionary();
+
+			var place:Function = function(obj:IIsoDisplayObject):void
 			{
-				var j:uint = i;
+				if (visited[obj])
+					return;
+				visited[obj] = true;

-				var objA:IIsoDisplayObject = sortedChildren[i];
-				var boundsA:IBounds = objA.isoBounds;
-
-				// There are many instances where 2 blocks can be ordered A->B in one axis, and B->A in the other
-				// We need to determine a priority order for comparing, so that they won't just toggle getting behind each other from frame to frame.
-				// Also, these mutual behindednesses can lead to the painter's algorithm type of problems and break visual sorting order.
-
-				// See if objA is behind objB, which would be out of place
-				if((boundsA.top <= boundsB.bottom) || // if A is under B, then process
-				   (!(boundsA.bottom >= boundsB.top) && // else, if A is _known not to be over B_ and ...
-				    ((boundsA.right <= boundsB.left) || // if A is left of B, then process
-					 (!(boundsA.left >= boundsB.right) && // else, if A is _known not to be right of B_ and ...
-					  (boundsA.front <= boundsB.back))))) // if A is back of B, then process
-				{
-					// Leave objB where it is so the next iteration of the main loop has it intact for reuse
-					var tempObjB:IIsoDisplayObject = objB;
-					var tempBoundsB:IBounds;
-
-					// This should be faster than 2 calls to splice(), since those 2 calls would shuffle all the way to the end of the Vector.
-					// This code only shifts the affected indexes
-					do
-					{
-						sortedChildren[j] = tempObjB;
-						--j;
-						if (0 == j)
-							break;
-						tempObjB = sortedChildren[j - 1];
-						tempBoundsB = tempObjB.isoBounds;
-					}
-					while ((boundsA.top <= tempBoundsB.bottom) || // if A is under B, then process
-				           (!(boundsA.bottom >= tempBoundsB.top) && // else, if A is _known not to be over B_ and ...
-				            ((boundsA.right <= tempBoundsB.left) || // if A is left of B, then process
-					         (!(boundsA.left >= tempBoundsB.right) && // else, if A is _known not to be right of B_ and ...
-					          (boundsA.front <= tempBoundsB.back))))) // if A is back of B, then process
-
-					//trace("moved", i, dumpBounds(boundsA), "to", j, dumpBounds(sortedChildren[j+1].isoBounds));
-
-					// Update the display order of this moved object
-					sortedChildren[j] = objA;
-					scene.setChildIndex(objA, j);
-				}
-				else
-				{
-					objB = objA;
-					boundsB = boundsA;
-				}
+				for each(var inner:IIsoDisplayObject in dependency[obj])
+					place(inner);
+				sortedChildren.push(obj);
+			};
+
+			for each(var obj:IIsoDisplayObject in children)
+			{
+				place(obj);
 			}

+			// Update the scene's ordering
+			for (i = 0; i < max; ++i)
+			{
+				var child:IIsoDisplayObject = IIsoDisplayObject(sortedChildren[i]);
+				if (child.depth != i)
+					scene.setChildIndex(child, i);
+			}
+
 			// DEBUG OUTPUT

 			//trace("--------------------");
 			//for (i = 0; i < max; ++i)
-			//	trace(dumpBounds(sortedChildren[i].isoBounds));
+			//	trace(dumpBounds(sortedChildren[i].isoBounds), dependency[sortedChildren[i]].length);

 			trace("scene layout render time", getTimer() - startTime, "ms (manual sort)");
 		}

 		//static private function dumpBounds(b:IBounds):String { return "[" + b.left + ".." + b.right + "," + b.back + ".." + b.front + "," + b.bottom + ".." + b.top + "]"; }
-
 	}
 }


add DataBindings.hasProvider()

add DataBindings.hasProvider()

--- src/aerys/minko/type/binding/DataBindings.as
+++ src/aerys/minko/type/binding/DataBindings.as
@@ -250,6 +250,11 @@
 					addProvider(provider);
 			}
 		}
+
+        public function hasProvider(provider : DataProvider) : Boolean
+        {
+            return provider in _providers;
+        }

 		private function propertyChangedHandler(source 			: IDataProvider,
 												propertyName 	: String,


Transferred from the Adobe Open Source Subversion Repository

Revision: 10948
Author:   hmuller@adobe.com
Date:     2009-10-09T13:47:09.462582Z

Log Message:
-----------
Pass the IList/getItemAt() prefetch argument along to the the AsyncListView list delegate.

QE notes: none
Doc notes: none
Bugs: sdk-23636
Reviewer:
Tests run: none
Is noteworthy for integration: no

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/AsyncListView.as

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

--- frameworks/projects/framework/src/mx/collections/AsyncListView.as
+++ frameworks/projects/framework/src/mx/collections/AsyncListView.as
@@ -547,7 +547,7 @@
         var item:Object = null;
         try
         {
-            return list.getItemAt(index);
+            return list.getItemAt(index, prefetch);
         }
         catch (ipe:ItemPendingError)
         {


Transferred from the Adobe Open Source Subversion Repository

Revision: 19342
Author:   chiedozi@adobe.com
Date:     2010-12-13T23:51:51.022293Z

Log Message:
-----------
destructionPolicy var is now a public getter

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

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

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

--- frameworks/projects/mobilecomponents/src/spark/components/View.as
+++ frameworks/projects/mobilecomponents/src/spark/components/View.as
@@ -306,6 +306,8 @@
     //  destructionPolicy
     //----------------------------------

+    private var _destructionPolicy:String = ContainerDestructionPolicy.AUTO;
+
     [Inspectable(category="General", enumeration="auto,never", defaultValue="auto")]
     /**
      *  Defines the destruction policy the view's navigator should use
@@ -320,7 +322,18 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    public var destructionPolicy:String = ContainerDestructionPolicy.AUTO;
+    public function get destructionPolicy():String
+    {
+        return _destructionPolicy;
+    }
+
+    /**
+     *  @private
+     */
+    public function set destructionPolicy(value:String):void
+    {
+        _destructionPolicy = value;
+    }

     //----------------------------------
     //  navigator


Transferred from the Adobe Open Source Subversion Repository

Revision: 18514
Author:   dthakkar@adobe.com
Date:     2010-11-10T00:38:39.528767Z

Log Message:
-----------
QE notes: Some testcases in spark formatters are failing because of behavior change. These testcases are excluded prior to submission. Globalization QE team has been informed about this.
Doc notes: Spark Formatters ASDocs are updated and also added samples for the spark formatters.
Bugs: SDK-28145, SDK-28345 ,SDK-28320 ,SDK-28287,SDK-28314
Reviewer: Gordon , Craig, Masa, Xie
Tests run: checkintests
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/styles/AdvancedStyleClient.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/globalization/MatchingCollatorExample.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/NumberValidatorTestScript.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/CurrencyValidatorTestScript.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/NumberValidatorTests.mxml</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/formatters</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/CurrencyValidatorTests.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/supportClasses/CollatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/NumberFormatter.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/formatters/examples/NumberFormatterExample1.mxml</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/supportClasses/NumberBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/BasicTests.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/formatters/examples/CurrencyFormatterExample1.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/CurrencyFormatter.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/DateTimeFormatter.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/globalization</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/bundles/en_US/validators.properties</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/SortingCollator.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/globalization/SortingCollatorExample.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/StringTools.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/globalization/StringToolsExample.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/validators/IValidator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/BasicTests-config.xml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/supportClasses/NumberValidatorBase.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/supportClasses</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/spark-manifest.xml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationValidatorBase.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/formatters/examples/NumberFormatterExample2.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/formatters/examples/CurrencyFormatterExample2.mxml</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/NumberValidator.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/CurrencyValidator.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/formatters/examples</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/validators/Validator.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationUtils.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/supportClasses/GlobalizationBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/formatters/IFormatter.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/formatters/examples/DateTimeFormatterExample.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/LastOperationStatus.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/supportClasses/NumberFormatterBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/MatchingCollator.as</path>

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

--- frameworks/projects/spark/src/spark/validators/NumberValidator.as
+++ frameworks/projects/spark/src/spark/validators/NumberValidator.as
@@ -0,0 +1,578 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2010 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package spark.validators
+{
+
+import flash.globalization.NumberFormatter;
+import flash.globalization.NumberParseResult;
+
+import mx.core.mx_internal;
+import mx.formatters.IFormatter;
+import mx.managers.ISystemManager;
+import mx.managers.SystemManager;
+import mx.validators.NumberValidatorDomainType;
+import mx.validators.ValidationResult;
+
+import spark.globalization.LastOperationStatus;
+import spark.validators.supportClasses.NumberValidatorBase;
+import spark.validators.supportClasses.GlobalizationUtils;
+import spark.formatters.NumberFormatter;
+use namespace mx_internal;
+
+[ResourceBundle("validators")]
+
+/**
+ *  The NumberValidator class ensures that a String represents a valid number
+ *  according to the conventions of a locale.  It can validate int,
+ *  uint, and Number objects.
+ *
+ *
It can ensure that the input falls within a given range
+ *  (specified by minValue and maxValue  properties),
+ *  is an integer (specified by domain  property),
+ *  is non-negative (specified by allowNegative  property),
+ *  has the grouping of digits correct per the locale conventions,
+ *  has the correct way of specifying negative numbers,
+ *  and does not exceed the specified fractionalDigits. The
+ *  validator sets default property values from the operating system supplied
+ *  locale data but they can be customized for specific needs.

+ *
+ *
This class internally uses the flash.globalization.NumberFormatter
+ *   to obtain locale-specific information.
+ *  The NumberValidator class can be used in MXML declarations or in
+ *  ActionScript code. This class uses the locale style for specifying the
+ *  requested Locale ID, and has methods and properties that are bindable.
+ *

+ *

+ *  The flash.globalization.NumberFormatter class uses the underlying
+ *  operating system for acquiring locale-specific data and parsing
+ *  functionality. In case the operating system does not provide number
+ *  formatting, this class provides fallback functionality.
+ *

+ *
+ *  @mxml
+ *
+ *
The <spark:NumberValidator> tag
+ *  inherits all of the tag attributes of its superclass,
+ *  and adds the following tag attributes:

+ *
+ *

+ *  <spark:NumberValidator
+ *    allowNegative="true|false"
+ *    decimalPointCountError="The decimal separator can only occur once."
+ *    decimalSeparator="(locale specified string or customized by user)."
+ *    domain="real|int"
+ *    exceedsMaxError="The number entered is too large."
+ *    integerError="The number must be an integer."
+ *    invalidCharError="The input contains invalid characters."
+ *    invalidFormatCharsError="One of the formatting parameters is invalid."
+ *    lowerThanMinError="The amount entered is too small."
+ *    maxValue="NaN"
+ *    minValue="NaN"
+ *    negativeError="The amount may not be negative."
+ *    negativeNumberFormatError="The negative format of the input number is
+ *    incorrect."
+ *    negativeSymbol="(locale specified read-only string)."
+ *    negativeSymbolError="The negative symbol is repeated or not in right
+ *    place."
+ *    parseError="The input string could not be parsed."
+ *    fractionalDigits="(locale specified number or customized by user)."
+ *    fractionalDigitsError="The amount entered has too many digits beyond the
+ *    decimal point."
+ *    groupingPattern="(locale specified string or customized by user)."
+ *    groupingSeparator="(locale specified string or customized by user)."
+ *    groupingSeparationError="The number digits grouping is not following the
+ *    grouping pattern."
+ *  />
+ *

+ *
+ *  @includeExample examples/NumberValidatorExample.mxml
+ *
+ *  @see flash.globalization.NumberFormatter
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10.1
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+public class NumberValidator extends NumberValidatorBase
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class Constants
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private static const NEGATIVE_NUMBER_FORMAT:String = "negativeNumberFormat";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructs a new NumberValidator object to validate numbers according
+     *  to the conventions of a given locale.
+     *

+     *  The locale for this class is supplied by the locale style.
+     *  The locale style can be set in several ways:
+     *

+     *

+     *
         *
+     *  Inheriting the style from a UIComponent by calling the UIComponent's
+     *  addStyleClient method.
+     *

+     *

+     *  By using the class in an MXML declaration and inheriting the
+     *  locale from the document that contains the declaration.
+     *  <listing version="3.0" >
+     *  <fx:Declarations>
+     *         <s:NumberValidator id="nv" />
+     *  </fx:Declarations>
+     *  </listing>
+     *

+     *

+     *  By using an MXML declaration and specifying the locale value in
+     *  the list of assignments.
+     *  <listing version="3.0" >
+     *  <fx:Declarations>
+     *      <s:NumberValidator id="nv_French_France" locale="fr_FR" />
+     *  </fx:Declarations>
+     *  </listing>
+     *

+     *

+     *  Calling the setStyle method, e.g.
+     *  nv.setStyle("locale", "fr-FR")
+     *

+     *

+     *

+     *  If the locale style is not set by one of the above techniques,
+     *  the methods of this class that depend on the locale
+     *  will throw an error.
+     *
         *
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function NumberValidator()
+    {
+        super();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  actualLocaleIDName
+    //----------------------------------
+
+    [Bindable("change")]
+
+    /**
+     *
+     *  @private
+     */
+    override public function get actualLocaleIDName():String
+    {
+        return getActualLocaleIDName(NUMBER_VALIDATOR_TYPE);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    // negativeNumberFormat
+    //----------------------------------
+
+    [Bindable("change")]
+
+    /**
+     *  A numeric value that indicates a validating pattern for negative
+     *  numbers.
+     *  This pattern defines the location of the negative symbol
+     *  or parentheses in relation to the numeric portion of the
+     *  number to be validated.
+     *
+     *
The following table summarizes the possible formats for
+     *  negative numbers. When a negative number is validated,
+     *  the minus sign represents the value of
+     *  the negativeSymbol property and the 'n' character
+     *  represents numeric value.

+     *
+     *

+     *

+     *            Negative number format type
+     *            Format
+     *

+     *

+     *            0
+     *            (n)
+     *

+     *

+     *            1
+     *            -n
+     *

+     *

+     *            2
+     *            - n
+     *

+     *

+     *            3
+     *            n-
+     *

+     *

+     *            4
+     *            n -
+     *

+     *

+     *
+     *
+     *  @default dependent on the locale and operating system.
+     *
+     *  @throws ArgumentError if the assigned value is not a number
+     *  between 0 and 4.
+     *
+     *  @see #negativeSymbol
+     *  @see #format()
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get negativeNumberFormat():uint
+    {
+        return getBasicProperty(properties, NEGATIVE_NUMBER_FORMAT);
+    }
+
+    public function set negativeNumberFormat(value:uint):void
+    {
+        if (!g11nWorkingInstance)
+        {
+            if (4 < value)
+                throw new TypeError();
+        }
+        setBasicProperty(properties, NEGATIVE_NUMBER_FORMAT, value);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties: Errors
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    // negativeNumberFormat error
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the negativeNumberFormatError property.
+     */
+    private var _negativeNumberFormatError:String;
+    private var negativeNumberFormatErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the input number's negative number format is not
+     *  following the pattern specified by the negativeNumberFormat property.
+     *
+     *  @default "The negative format of the input number is incorrect."
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get negativeNumberFormatError():String
+    {
+        return _negativeNumberFormatError;
+    }
+
+    public function set negativeNumberFormatError(value:String):void
+    {
+        negativeNumberFormatErrorOverride = value;
+
+        _negativeNumberFormatError = value ? value :
+           resourceManager.getString("validators", "negativeNumberFormatError");
+    }
+
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override mx_internal function createWorkingInstance():void
+    {
+        // release groupingPatternSymbols as it contains grouping symbols based
+        // on previous locale grouping pattern.
+        groupingPatternSymbols = null;
+        createWorkingInstanceCore(NUMBER_VALIDATOR_TYPE);
+    }
+
+    /**
+     *  @private
+     *
+     *  Override of the base class doValidation() method
+     *  to validate a number.
+     *
+     *
You do not call this method directly;
+     *  Flex calls it as part of performing a validation.
+     *  If you create a custom Validator class, you must implement this
+     *  method.

+     *
+     *  @param value Object to validate.
+     *
+     *  @return An Array of ValidationResult objects, with one ValidationResult
+     *  object for each field examined by the validator.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    override protected function doValidation(value:Object):Array
+    {
+        var results:Array = super.doValidation(value);
+
+        // Return if there are errors
+        // or if the required property is set to false and length
+        // is 0.
+        var val:String = value ? String(value) : "";
+        if (results.length > 0 || ((val.length == 0) && !required))
+            return results;
+        else
+            return validateNumber(value, null);
+    }
+
+    /**
+     *  Load the error messages from the resource bundle.
+     */
+    override protected function resourcesChanged():void
+    {
+        super.resourcesChanged();
+        loadChangedResources();
+        negativeNumberFormatError = negativeNumberFormatErrorOverride;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    [Bindable("change")]
+
+    /**
+     *  Convenience method for calling a validator from within a custom
+     *  validation function. Each of the standard Flex validators has a similar
+     *  convenience method. Caller must check the lastOperationStatus after
+     *  this.
+     *
+     *  @param value A number string to validate.
+     *
+     *  @param baseField Text representation of the subfield specified in the
+     *  value object.
+     *  For example, if the value parameter specifies value.number,
+     *  the baseField value is "number".
+     *
+     *  @return An Array of ValidationResult objects, with one ValidationResult
+     *  object for each field examined by the validator.
+     *
+     *  @see mx.validators.ValidationResult
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function validateNumber(value:Object,
+                                   baseField:String):Array
+    {
+        const maxValue:Number = Number(maxValue);
+        const minValue:Number = Number(minValue);
+        const inputStr:String = String(value);
+
+        var results:Array = [];
+
+        // if the input can be a null/empty, return no error.
+        if (!inputStr)
+            return results;
+
+        // If spark formatter is null, no-go-forward.
+        if (!g11nWorkingInstance)
+        {
+            fallbackLastOperationStatus =
+                            LastOperationStatus.LOCALE_UNDEFINED_ERROR;
+            return results;
+        }
+
+        // g11nWorkingInstance for a locale is available.
+        // strip leading and trailing white spaces.
+        const input:String = GlobalizationUtils.trim(inputStr);
+
+        const len:int = input.length;
+
+        // NumberValidatorBase has this method. Unlike flash globalization,
+        // validator gives error if decimal and grouping separator are same.
+        if (!validateNumberFormat(input, results, baseField))
+            return results;
+
+        // Parse the number string using the flash globalization NumberFormatter
+        const nf:spark.formatters.NumberFormatter =
+               g11nWorkingInstance as spark.formatters.NumberFormatter;
+        const inputNum:Number = nf.parseNumber(input);
+
+        // parseNumber() only returns PARSE_ERROR if it finds any error in input
+        // string. If there is a PARSE_ERROR, validate the input
+        // string further, detect and report the error. parse() is lenient than
+        // parseNumber() and parses to the extent possible without error. Hence
+        // it is not suitable.
+        if (nf.lastOperationStatus == LastOperationStatus.PARSE_ERROR)
+        {
+            if (!detectAndReportProblem(input, baseField, results))
+            {
+                return results;
+            }
+            else
+            {
+                results.push(new ValidationResult(
+                    true, baseField, "parseError",
+                    parseError));
+                return results;
+            }
+        }
+
+        // See if negative number is allowed.
+        if (!validateNumberNegativity(inputNum, baseField, results))
+            return results;
+
+        // If grouping separator(s) are present in the input string
+        // make sure it's followed by correct number of digits per grouping
+        // pattern. We need the original number string extracted from input
+        // string with grouping separators intact. If input string has a
+        // decimal, then we need the number string upto last digit before the
+        // decimal.
+        var valStr:String = inputNum.toString();
+        if (inputNum < 0)
+            valStr = valStr.substring(1);
+        const numStart:int = input.indexOf(valStr.charAt(0));
+        const numEnd:int = input.lastIndexOf(valStr.charAt(valStr.length-1));
+        const decimalSeparatorIndex:Number = input.indexOf(decimalSeparator);
+        const end:int = (decimalSeparatorIndex == -1) ? numEnd :
+                                                      decimalSeparatorIndex - 1;
+
+        //
+        // Make sure every character after the decimal is a digit,
+        // and that there aren't too many digits after the decimal point:
+        // if domain is int there should be none,
+        // otherwise there should be no more than specified by fractionalDigits.
+        //
+        if (!validateFractionPart(
+                            input, decimalSeparatorIndex, baseField, results))
+        {
+            return results;
+        }
+
+        if (!validateGrouping(input.substring(numStart, end), end-numStart))
+        {
+            results.push(new ValidationResult(
+                true, baseField, "groupingSeparation",
+                groupingSeparationError));
+            return results;
+        }
+
+        // Make sure the input is within the specified range.
+        // Make sure the input is within the specified range.
+        // check the range of the number.
+        if (!validateNumberRange(inputNum, baseField, results))
+            return results;
+
+        return results;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Private Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  If there is a parse error by flash.globalization.NumberFormatter, detect
+     *  the error and report it for user clarity. parse() method does not return
+     *  anything other than PARSE_ERROR.
+     */
+    private function detectAndReportProblem(input:String, baseField:String,
+                                            results:Array):Boolean
+    {
+        const len:int = input.length;
+        // Check for invalid characters in input.
+        // One of the negative format of number is enclosing in parenthesis.
+        const validChars:String = DECIMAL_DIGITS + "-" + "(" + ")" +
+            decimalSeparator + groupingSeparator;
+
+        if (validateInputCharacters(input, len, validChars))
+        {
+            results.push(new ValidationResult(
+                true, baseField, "invalidChar",
+                invalidCharError));
+            return false;
+        }
+        // Make sure there's only one decimal point.
+        else if (input.indexOf(decimalSeparator) !=
+                 input.lastIndexOf(decimalSeparator))
+        {
+            results.push(new ValidationResult(
+                true, baseField, "decimalPointCount",
+                decimalPointCountError));
+            return false;
+        }
+        // NumberValidatorBase has this method.
+        else if (!validateDecimalString(input, baseField, results))
+        {
+            return false;
+        }
+        // all errors are already checked. Only remaining error is
+        // negativeNumberFormat.
+        else if ((input.indexOf(negativeSymbol) != -1) ||
+            ((input.charAt(0) == "(") && (input.charAt(len-1) == ")")))
+
+        {
+            results.push(new ValidationResult(
+                    true, baseField, "negativeNumberFormat",
+                    negativeNumberFormatError));
+                return false;
+        }
+        return true;
+    }
+}
+}


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 19612
Author:   chiedozi@adobe.com
Date:     2011-01-05T22:48:56.580575Z

Log Message:
-----------
Fixed an issue that caused instability in the runtime when persistApplicationState was set to true at runtime

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

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

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

--- frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorApplicationBase.as
+++ frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorApplicationBase.as
@@ -261,6 +261,7 @@
     //----------------------------------

     private var _persistNavigatorState:Boolean = false;
+    private var _persistenceInitialized:Boolean = false;

     /**
      *  Toggles the application session caching feature for the application.
@@ -308,6 +309,10 @@
     public function set persistNavigatorState(value:Boolean):void
     {
         _persistNavigatorState = value;
+
+        // Register the necessary class aliases and load the shared object
+        if (_persistNavigatorState && !_persistenceInitialized)
+            initializePersistenceManager();
     }

     //----------------------------------
@@ -757,13 +762,6 @@

         if (persistNavigatorState)
         {
-            // Register aliases for custom classes that will be written to
-            // persistence store by navigator
-            registerClassAlias("ViewDescriptor", ViewDescriptor);
-            registerClassAlias("NavigationStack", NavigationStack);
-
-            persistenceManager.load();
-
             // Dispatch event for loading persistence data
             var eventDispatched:Boolean = true;
             if (hasEventListener(FlexEvent.NAVIGATOR_STATE_LOADING))
@@ -776,6 +774,32 @@
             }
         }
     }
+
+
+    //--------------------------------------------------------------------------
+    //
+    //  Private Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Method initializes the persistence manager by registering the class
+     *  aliases and loading the shared object.  This method is automatically
+     *  called by the persistNavigatorState setter.
+     */
+    private function initializePersistenceManager():void
+    {
+        // Register aliases for custom classes that will be written to
+        // persistence store by navigator
+        registerClassAlias("ViewDescriptor", ViewDescriptor);
+        registerClassAlias("NavigationStack", NavigationStack);
+
+        // Initialize and load the persisted data
+        persistenceManager.load();
+
+        _persistenceInitialized = true;
+    }
 }
 }


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

--- frameworks/projects/framework/src/mx/events/DynamicEvent.as
+++ frameworks/projects/framework/src/mx/events/DynamicEvent.as
@@ -38,6 +38,11 @@
  *  event.passsword = password; // misspelling won't be caught!
  *  dispatchEvent(event);
  *  </pre>
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public dynamic class DynamicEvent extends Event
 {
@@ -59,6 +64,11 @@
 	 *
 	 *  @param cancelable Specifies whether the behavior
 	 *  associated with the event can be prevented.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public function DynamicEvent(type:String, bubbles:Boolean = false,
 								 cancelable:Boolean = false)


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

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


Changed TestIterator methods back from private to protected

--- asunit-4.0/src/asunit4/framework/TestIterator.as
+++ asunit-4.0/src/asunit4/framework/TestIterator.as
@@ -49,7 +49,7 @@
             return _readyToTearDown;
         }

-        private function setUpNullIterators():void {
+        protected function setUpNullIterators():void {
             // Set up null iterators for access to length
             // and other properties...
             testMethods        = new ArrayIterator();
@@ -60,7 +60,7 @@
             ignoredMethods     = new ArrayIterator();
         }

-        private function setUpIterators(test:Object):void {
+        protected function setUpIterators(test:Object):void {
             afterClassMethods   = new ArrayIterator(getAfterClassMethods(test));
             afterMethods        = new ArrayIterator(getAfterMethods(test));
             beforeClassMethods  = new ArrayIterator(getBeforeClassMethods(test));
@@ -97,7 +97,7 @@
          * @param   test    An instance of a class with methods that have [Before] metadata.
          * @return  An array of Method instances.
          */
-        private function getBeforeClassMethods(test:Object):Array {
+        protected function getBeforeClassMethods(test:Object):Array {
             return getMethodsWithMetadata(test["constructor"], "BeforeClass", true);
         }

@@ -106,16 +106,17 @@
          * @param   test    An instance of a class with methods that have [Before] metadata.
          * @return  An array of Method instances.
          */
-        private function getBeforeMethods(test:Object):Array {
+        protected function getBeforeMethods(test:Object):Array {
             return getMethodsWithMetadata(test, "Before");
         }

         /**
          *
-         * @param   test    An instance of a class with methods that have [Test] metadata.
-         * @return  An array of Method instances.
-         */
-        private function getTestMethods(test:Object):Array {
+         * @param   test    An instance of a class with methods that have [Test] metadata,
+         *                  or have a methods that begin with 'test'.
+         * @return  An array of Method instances.
+         */
+        protected function getTestMethods(test:Object):Array {
             return getMethodsWithMetadata(test, "Test");
         }

@@ -124,7 +125,7 @@
          * @param   test    An instance of a class with methods that have [After] metadata.
          * @return  An array of Method instances.
          */
-        private function getAfterMethods(test:Object):Array {
+        protected function getAfterMethods(test:Object):Array {
             return getMethodsWithMetadata(test, "After");
         }

@@ -133,7 +134,7 @@
          * @param   test    An instance of a class with methods that have [After] metadata.
          * @return  An array of Method instances.
          */
-        private function getIgnoredMethods(test:Object):Array {
+        protected function getIgnoredMethods(test:Object):Array {
             return getMethodsWithMetadata(test, "Ignore");
         }

@@ -156,11 +157,11 @@
          * @param   test    An instance of a class with methods that have [Before] metadata.
          * @return  An array of Method instances.
          */
-        private function getAfterClassMethods(test:Object):Array {
+        protected function getAfterClassMethods(test:Object):Array {
             return getMethodsWithMetadata(test["constructor"], "AfterClass", true);
         }

-        private function countTestMethods(test:Object):uint {
+        protected function countTestMethods(test:Object):uint {
             return getTestMethods(test).length;
         }

@@ -239,7 +240,7 @@
             return next();
         }

-        private function updateReadyToTearDown():void {
+        protected function updateReadyToTearDown():void {
             // Used by TestRunner to remove visual
             // entities:
             if(!beforeClassMethods.hasNext() &&