Simplify test for #11

Simplify test for #11

--- as3/test/ember/core/NodesManagerTests.as
+++ as3/test/ember/core/NodesManagerTests.as
@@ -255,16 +255,11 @@
 		[Test]
 		public function when_a_node_is_removed_during_a_loop_the_loop_isnt_disrupted():void
 		{
-			var a:Entity = _entities.create("a");
-			a.addComponent(new MockComponent());
-
-			var b:Entity = _entities.create("b");
-			b.addComponent(new MockComponent());
-
-			var c:Entity = _entities.create("c");
-			c.addComponent(new MockComponent());
-
-			var nodes:Nodes = _manager.get(MockNode);
+			for (var i:int = 0; i < 3; i++)
+				_entities.create().addComponent(new MockComponent());
+
+			var nodes:Nodes = _manager.get(MockNode);
+
 			var count:uint = 0;
 			for (var node:MockNode = nodes.head as MockNode; node; node = node.next)
 			{


Remove XMLListMap AS util

Remove XMLListMap AS util

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/calpath/xsd2bb.git/'


Ported bridge mode to ga async style, also now loading the ga.js lib if it is not on the page.

fatal: unable to access 'https://github.com/ign/gaforflash.git/': The requested URL returned error: 403


Added new Quad2D class which can be a rectangle polygon with different side lengths.

error: pathspec 'src/engine/tetragon/view/render2d/display/Quad2D.as' did not match any file(s) known to git

--- src/engine/tetragon/view/render2d/display/Quad2D.as
+++ src/engine/tetragon/view/render2d/display/Quad2D.as
@@ -0,0 +1,218 @@
+/*
+ *      _________  __      __
+ *    _/        / / /____ / /________ ____ ____  ___
+ *   _/        / / __/ -_) __/ __/ _ `/ _ `/ _ \/ _ \
+ *  _/________/  \__/\__/\__/_/  \_,_/\_, /\___/_//_/
+ *                                   /___/
+ *
+ * Tetragon : Game Engine for multi-platform ActionScript projects.
+ * http://www.tetragonengine.com/ - Copyright (C) 2012 Sascha Balkau
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package tetragon.view.render2d.display
+{
+	import tetragon.view.render2d.core.RenderSupport2D;
+	import tetragon.view.render2d.core.VertexData2D;
+
+	import flash.geom.Matrix;
+	import flash.geom.Point;
+	import flash.geom.Rectangle;
+
+
+	/**
+	 * A rectangular polygon whose vertices can have an arbitrary coordinate.
+	 */
+	public class Quad2D extends DisplayObject2D implements IQuad2D
+	{
+		//-----------------------------------------------------------------------------------------
+		// Properties
+		//-----------------------------------------------------------------------------------------
+
+		private var _tinted:Boolean;
+		/** The raw vertex data of the quad. */
+		protected var _vertexData:VertexData2D;
+
+		/** Helper objects. */
+		private static var _helperPoint:Point = new Point();
+		private static var _helperMatrix:Matrix = new Matrix();
+
+
+		//-----------------------------------------------------------------------------------------
+		// Constructor
+		//-----------------------------------------------------------------------------------------
+
+		/**
+		 *
+		 */
+		public function Quad2D(x1:Number = 0, y1:Number = 0, x2:Number = 0, y2:Number = 0,
+			x3:Number = 0, y3:Number = 0, x4:Number = 0, y4:Number = 0, color:uint = 0xFFFFFF,
+			premultipliedAlpha:Boolean = true)
+		{
+			_tinted = color != 0xFFFFFF;
+
+			_vertexData = new VertexData2D(4, premultipliedAlpha);
+			_vertexData.setPosition(0, x1, y1);
+			_vertexData.setPosition(1, x2, y2);
+			_vertexData.setPosition(2, x4, y4);
+			_vertexData.setPosition(3, x3, y3);
+			_vertexData.setUniformColor(color);
+		}
+
+
+		//-----------------------------------------------------------------------------------------
+		// Public Methods
+		//-----------------------------------------------------------------------------------------
+
+		/**
+		 * @inheritDoc
+		 */
+		public override function getBounds(targetSpace:DisplayObject2D,
+			resultRect:Rectangle = null):Rectangle
+		{
+			if (!resultRect) resultRect = new Rectangle();
+			if (targetSpace == this) // optimization
+			{
+				_vertexData.getPosition(3, _helperPoint);
+				resultRect.setTo(0.0, 0.0, _helperPoint.x, _helperPoint.y);
+			}
+			else if (targetSpace == parent && rotation == 0.0) // optimization
+			{
+				var scaleX:Number = this.scaleX;
+				var scaleY:Number = this.scaleY;
+				_vertexData.getPosition(3, _helperPoint);
+				resultRect.setTo(x - pivotX * scaleX, y - pivotY * scaleY,
+					_helperPoint.x * scaleX, _helperPoint.y * scaleY);
+				if (scaleX < 0)
+				{
+					resultRect.width *= -1;
+					resultRect.x -= resultRect.width;
+				}
+				if (scaleY < 0)
+				{
+					resultRect.height *= -1;
+					resultRect.y -= resultRect.height;
+				}
+			}
+			else
+			{
+				getTransformationMatrix(targetSpace, _helperMatrix);
+				_vertexData.getBounds(_helperMatrix, 0, 4, resultRect);
+			}
+
+			return resultRect;
+		}
+
+
+		public function getVertexColor(vertexID:int):uint
+		{
+			return _vertexData.getColor(vertexID);
+		}
+
+
+		public function setVertexColor(vertexID:int, color:uint):void
+		{
+			_vertexData.setColor(vertexID, color);
+			if (color != 0xFFFFFF) _tinted = true;
+			else _tinted = _vertexData.tinted;
+		}
+
+
+		public function getVertexAlpha(vertexID:int):Number
+		{
+			return _vertexData.getAlpha(vertexID);
+		}
+
+
+		public function setVertexAlpha(vertexID:int, alpha:Number):void
+		{
+			_vertexData.setAlpha(vertexID, alpha);
+			if (alpha != 1.0) _tinted = true;
+			else _tinted = _vertexData.tinted;
+		}
+
+
+		public function copyVertexDataTo(targetData:VertexData2D, targetVertexID:int = 0):void
+		{
+			_vertexData.copyTo(targetData, targetVertexID);
+		}
+
+
+		public override function render(support:RenderSupport2D, parentAlpha:Number):void
+		{
+			support.batchQuad(this, parentAlpha);
+		}
+
+
+		public function update(x1:Number, y1:Number, x2:Number, y2:Number, x3:Number, y3:Number,
+			x4:Number, y4:Number, color:uint):void
+		{
+			_vertexData.setPosition(0, x1, y1);
+			_vertexData.setPosition(1, x2, y2);
+			_vertexData.setPosition(2, x4, y4);
+			_vertexData.setPosition(3, x3, y3);
+			_vertexData.setUniformColor(color);
+		}
+
+
+		//-----------------------------------------------------------------------------------------
+		// Accessors
+		//-----------------------------------------------------------------------------------------
+
+		/**
+		 * Returns the color of the quad, or of vertex 0 if vertices have different colors.
+		 */
+		public function get color():uint
+		{
+			return _vertexData.getColor(0);
+		}
+		/**
+		 * Sets the colors of all vertices to a certain value.
+		 */
+		public function set color(v:uint):void
+		{
+			for (var i:int = 0; i < 4; ++i)
+			{
+				setVertexColor(i, v);
+			}
+			if (v != 0xFFFFFF || alpha != 1.0) _tinted = true;
+			else _tinted = _vertexData.tinted;
+		}
+
+
+		/**
+		 * @inheritDoc
+		 */
+		public override function set alpha(v:Number):void
+		{
+			super.alpha = v;
+			if (v < 1.0) _tinted = true;
+			else _tinted = _vertexData.tinted;
+		}
+
+
+		/**
+		 * Returns true if the quad (or any of its vertices) is non-white or non-opaque.
+		 */
+		public function get tinted():Boolean
+		{
+			return _tinted;
+		}
+	}
+}


Adapt example

Adapt example

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/sessionm/sessionm-flex.git/'


Issue 37; In path node, if first move is 'm' treate as absolute. Includes code from r157 from James.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/leymannx/svgweb.git/'


adding license, cleaning up and adding some documentation

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/rafaelcordoba/cocktail-demo.git/'


Issue 43; Add missing else precluding round capsStyle. Merged from r187 from James.


Transferred from the Adobe Open Source Subversion Repository

Revision: 9077
Author:   dloverin@adobe.com
Date:     2009-08-04T21:32:29.926994Z

Log Message:
-----------
Submit Window/WindowedApplication patch from Beau Scott.

Instead of using rawChildren.addChildAt() to add a non-content child, use rawChildren.addChild() and then set the child's index using rawChildren.setChildIndex().

QE notes: None.
Doc notes: None.
Bugs: SDK-16464
Reviewer:
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/Window.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/WindowedApplication.as</path>

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

--- frameworks/projects/airframework/src/mx/core/WindowedApplication.as
+++ frameworks/projects/airframework/src/mx/core/WindowedApplication.as
@@ -2121,6 +2121,7 @@
             _statusBar.styleName = new StyleProxy(this, statusBarStyleFilters);
             rawChildren.addChild(DisplayObject(_statusBar));
             showStatusBarChanged = true;
+            statusBarFactoryChanged = false;
         }

         if (systemManager.stage.nativeWindow.systemChrome != "none")
@@ -2315,13 +2316,17 @@
             }
             _statusBar = statusBarFactory.newInstance();
             _statusBar.styleName = new StyleProxy(this, statusBarStyleFilters);
+
             // Add it underneath the gripper.
+            rawChildren.addChild(DisplayObject(_statusBar));
             if (gripper)
-                rawChildren.addChildAt(DisplayObject(_statusBar), rawChildren.getChildIndex(gripper));
-            else
-                rawChildren.addChild(DisplayObject(_statusBar));
+            {
+                var gripperIndex:int = rawChildren.getChildIndex(DisplayObject(gripper));
+                rawChildren.setChildIndex(DisplayObject(_statusBar), gripperIndex);
+            }
             statusBarFactoryChanged = false;
             showStatusBarChanged = true;
+            statusChanged = true;
             invalidateDisplayList();
         }


I should have created this a while back. Sometimes we just want to wild-up
some custom event to communicate a value to listeners. This is for that.

CommandEvents are close, but are all dispatched using a single 'type' value,
so a single handler must have a switch statement in it (unless you're
a controller, which has magic to call the right method.)

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

error: pathspec 'src/as/com/threerings/util/ValueEvent.as' did not match any file(s) known to git

--- src/as/com/threerings/util/ValueEvent.as
+++ src/as/com/threerings/util/ValueEvent.as
@@ -0,0 +1,35 @@
+package com.threerings.util {
+
+import flash.events.Event;
+
+/**
+ * A handy event for simply dispatching a value associated with the event type.
+ */
+public class ValueEvent extends Event
+{
+    /**
+     * Accessor: get the value.
+     */
+    public function get value () :Object
+    {
+        return _value;
+    }
+
+    /**
+     * Construct the value event.
+     */
+    public function ValueEvent (type :String, value :Object)
+    {
+        super(type);
+        _value = value;
+    }
+
+    override public function clone () :Event
+    {
+        return new ValueEvent(type, _value);
+    }
+
+    /** The value. */
+    protected var _value :Object;
+}
+}


Added debug options, security fix and updated version number

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/OnCircle/vpaid-wrapper.git/'


287 AutoMap

287 AutoMap

error: pathspec 'raw/src/org/yellcorp/lib/collections/AutoMap.as' did not match any file(s) known to git

--- raw/src/org/yellcorp/lib/collections/AutoMap.as
+++ raw/src/org/yellcorp/lib/collections/AutoMap.as
@@ -0,0 +1,92 @@
+package org.yellcorp.lib.collections
+{
+import flash.utils.Proxy;
+import flash.utils.flash_proxy;
+
+
+public class AutoMap extends Proxy
+{
+    public var creationFunction:Function = null;
+
+    private var store:Object;
+    private var loopKeys:Array;
+    private var loopValues:Array;
+
+    public function AutoMap(creationFunction:Function = null)
+    {
+        store = { };
+        this.creationFunction = creationFunction;
+    }
+
+    override flash_proxy function deleteProperty(name:*):Boolean
+    {
+        return delete store[name];
+    }
+
+    override flash_proxy function getProperty(name:*):*
+    {
+        var value:*;
+
+        if (!store.hasOwnProperty(name) && creationFunction !== null)
+        {
+            if (creationFunction.length == 0)
+            {
+                value = creationFunction();
+            }
+            else
+            {
+                value = creationFunction(name);
+            }
+            store[name] = value;
+            return value;
+        }
+        else
+        {
+            return store[name];
+        }
+    }
+
+    override flash_proxy function hasProperty(name:*):Boolean
+    {
+        return store.hasOwnProperty(name);
+    }
+
+    override flash_proxy function setProperty(name:*, value:*):void
+    {
+        store[name] = value;
+    }
+
+    override flash_proxy function nextNameIndex(index:int):int
+    {
+        if (index == 0)
+        {
+            loopKeys = [ ];
+            loopValues = [ ];
+            for (var k:* in store)
+            {
+                loopKeys.push(k);
+                loopValues.push(store[k]);
+            }
+        }
+
+        if (index < loopKeys.length)
+        {
+            return index + 1;
+        }
+        else
+        {
+            return 0;
+        }
+    }
+
+    override flash_proxy function nextName(index:int):String
+    {
+        return loopKeys[index - 1];
+    }
+
+    override flash_proxy function nextValue(index:int):*
+    {
+        return loopValues[index - 1];
+    }
+}
+}


removing debug traces, listening to loading error


Provide ready state to ad.

Provide ready state to ad.

--- src/org/openvv/OVVAsset.as
+++ src/org/openvv/OVVAsset.as
@@ -399,6 +399,14 @@
 			}
 			raiseReady();
 		}
+
+		/**
+		 * Ready state from the JS code, including beacons.
+		 * @return
+		 */
+		public function isJsReady():Boolean {
+			return jsReady;
+		}
 		/**
          * When the VPAID AdVideoStart event is received, it triggers this function
          * to start the interval timer which does viewability checks every 200ms (POLL_INTERVAL)


add TorusGeometry

add TorusGeometry

error: pathspec 'src/aerys/minko/render/geometry/primitive/TorusGeometry.as' did not match any file(s) known to git

--- src/aerys/minko/render/geometry/primitive/TorusGeometry.as
+++ src/aerys/minko/render/geometry/primitive/TorusGeometry.as
@@ -0,0 +1,115 @@
+package aerys.minko.render.geometry.primitive
+{
+	import aerys.minko.render.geometry.Geometry;
+	import aerys.minko.render.geometry.stream.IVertexStream;
+	import aerys.minko.render.geometry.stream.IndexStream;
+	import aerys.minko.render.geometry.stream.StreamUsage;
+	import aerys.minko.render.geometry.stream.VertexStream;
+	import aerys.minko.render.geometry.stream.format.VertexComponent;
+	import aerys.minko.render.geometry.stream.format.VertexFormat;
+	import aerys.minko.type.math.Vector4;
+
+	public class TorusGeometry extends Geometry
+	{
+		private static const EPSILON	: Number	= 0.00001;
+		private static const DTOR 		: Number	= 0.01745329252;
+
+		private var _radius		: Number;
+		private var _tube		: Number;
+		private var _segmentsR	: uint;
+		private var _segmentsT	: uint;
+		private var _arc		: Number;
+
+		public function TorusGeometry(radius				: Number	= 100.,
+									  tube					: Number	= 40.,
+									  segmentsR				: uint		= 8,
+									  segmentsT				: uint		= 6,
+									  arc					: Number	= Math.PI * 2.,
+									  withUVs				: Boolean	= true,
+									  withNormals			: Boolean	= true,
+									  vertexStreamUsage		: uint		= StreamUsage.STATIC,
+									  indexStreamUsage		: uint		= StreamUsage.STATIC)
+		{
+			_radius = radius;
+			_tube = tube;
+			_segmentsR = segmentsR;
+			_segmentsT = segmentsT;
+			_arc = arc;
+
+			super(
+				new <IVertexStream>[buildVertexStream(vertexStreamUsage, withUVs, withNormals)],
+				buildIndexStream(indexStreamUsage)
+			);
+		}
+
+		private function buildVertexStream(usage : uint, withUVs : Boolean, withNormals : Boolean) : VertexStream
+		{
+			var vertexData	: Vector.<Number>	= new <Number>[];
+
+			for (var j : uint = 0; j <= _segmentsR; ++j)
+			{
+				for (var i : uint = 0; i <= _segmentsT; ++i)
+				{
+					var u 		: Number 	= i / _segmentsT * _arc;
+					var v 		: Number 	= j / _segmentsR * _arc;
+					var cosU	: Number	= Math.cos(u);
+					var sinU	: Number	= Math.sin(u);
+					var cosV	: Number	= Math.cos(v);
+					var x		: Number	= (_radius + _tube * cosV) * cosU;
+					var y		: Number	= (_radius + _tube * cosV) * sinU;
+					var z		: Number	= _tube * Math.sin(v);
+
+					vertexData.push(x, y, z);
+
+					if (withUVs)
+						vertexData.push(i / _segmentsT, 1 - j / _segmentsR);
+
+					if (withNormals)
+					{
+						var normalX	: Number	= x - _radius * cosU;
+						var normalY	: Number	= y - _radius * sinU;
+						var normalZ	: Number	= z;
+						var mag		: Number	= normalX * normalX + normalY * normalY
+							+ normalZ * normalZ;
+
+						normalX /= mag;
+						normalY /= mag;
+						normalZ /= mag;
+
+						vertexData.push(normalX, normalY, normalZ);
+					}
+				}
+			}
+
+			var format : VertexFormat = new VertexFormat(VertexComponent.XYZ);
+
+			if (withUVs)
+				format.addComponent(VertexComponent.UV);
+
+			if (withNormals)
+				format.addComponent(VertexComponent.NORMAL);
+
+			return new VertexStream(usage, format, vertexData);
+		}
+
+		private function buildIndexStream(usage : uint) : IndexStream
+		{
+			var indices : Vector.<uint> = new <uint>[];
+
+			for (var j : uint = 1; j <= _segmentsR; ++j)
+			{
+				for (var i : uint = 1; i <= _segmentsT; ++i)
+				{
+					var a : uint = (_segmentsT + 1) * j + i - 1;
+					var b : uint = (_segmentsT + 1) * (j - 1) + i - 1;
+					var c : uint = (_segmentsT + 1) * (j - 1) + i;
+					var d : uint = (_segmentsT + 1) * j + i;
+
+					indices.push(a, c, b, a, d, c);
+				}
+			}
+
+			return new IndexStream(usage, indices);
+		}
+	}
+}


Added missing WebSocketDataSource file.

Added missing WebSocketDataSource file.

error: pathspec 'WeaveASJS/src/weavejs/data/source/WebSocketDataSource.as' did not match any file(s) known to git

--- WeaveASJS/src/weavejs/data/source/WebSocketDataSource.as
+++ WeaveASJS/src/weavejs/data/source/WebSocketDataSource.as
@@ -0,0 +1,227 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * This file is part of Weave.
+ *
+ * The Initial Developer of Weave is the Institute for Visualization
+ * and Perception Research at the University of Massachusetts Lowell.
+ * Portions created by the Initial Developer are Copyright (C) 2008-2015
+ * the Initial Developer. All Rights Reserved.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package weavejs.data.source
+{
+	import weavejs.WeaveAPI;
+	import weavejs.api.core.ILinkableHashMap;
+	import weavejs.api.core.ILinkableVariable;
+	import weavejs.api.data.Aggregation;
+	import weavejs.api.data.ColumnMetadata;
+	import weavejs.api.data.DataType;
+	import weavejs.api.data.IAttributeColumn;
+	import weavejs.api.data.IDataSource;
+	import weavejs.api.data.IQualifiedKey;
+	import weavejs.api.data.ISelectableAttributes;
+	import weavejs.api.data.IWeaveTreeNode;
+	import weavejs.core.LinkableHashMap;
+	import weavejs.core.LinkableString;
+	import weavejs.core.LinkableVariable;
+	import weavejs.core.LinkableBoolean;
+	import weavejs.core.LinkableNumber;
+	import weavejs.data.column.DynamicColumn;
+	import weavejs.data.column.ProxyColumn;
+	import weavejs.data.column.StringColumn;
+	import weavejs.data.hierarchy.ColumnTreeNode;
+	import weavejs.data.ColumnUtils;
+	import weavejs.data.DataSourceUtils;
+	import weavejs.util.JS;
+	import weavejs.util.StandardLib;
+
+	public class WebSocketDataSource extends AbstractDataSource
+	{
+		WeaveAPI.ClassRegistry.registerImplementation(IDataSource, WebSocketDataSource, "WebSocket Data Source");
+
+		public static const DATA_COLUMNNAME_META:String = "__WebSocketJsonPropertyName__";
+
+
+		public function WebSocketDataSource()
+		{
+		}
+
+		public const keyType:LinkableString = Weave.linkableChild(this, LinkableString);
+		public const keyProperty:LinkableString = Weave.linkableChild(this, LinkableString);
+		public const keepLast:LinkableNumber = Weave.linkableChild(this, LinkableNumber, onKeepLastChange);
+		//public const selectionFeedback:LinkableBoolean = Weave.linkableChild(this, LinkableBoolean);
+		public const url:LinkableString = Weave.linkableChild(this, LinkableString, onUrlChange);
+
+
+		private var _socket:Object = null;
+		private function onUrlChange():void
+		{
+			if (_socket && _socket.readyState < 2)
+			{
+				_socket.close(1000, "No longer needed.");
+				_socket = null;
+			}
+
+			records = [];
+			propertyNames.clear();
+
+
+			_socket = new JS.global.WebSocket(url.value);
+
+			_socket.onmessage = onMessage;
+			_socket.onclose = onClose;
+			_socket.onerror = onError;
+		}
+
+		private function onClose(event:Object):void
+		{
+			_socket = null;
+		}
+
+		private function onError(event:Object):void
+		{
+			JS.error(event);
+			_socket = null;
+		}
+
+		private function onMessage(event:/*/MessageEvent/*/Object):void
+		{
+			var str:String = event.data;
+			var record:Object = JSON.parse(str);
+
+			if ((records.length == keepLast.value) && (keepLast.value > 0))
+			{
+				records.shift();
+			}
+
+			records.push(record);
+
+			/* Update set of property names */
+			for each (var key:String in JS.objectKeys(record))
+			{
+				propertyNames.add(key);
+			}
+
+			refreshAllProxyColumns();
+		}
+
+		public function getPropertyNames():Array/*/<string>/*/
+		{
+			return JS.mapKeys(propertyNames)
+		}
+
+		private function onKeepLastChange():void
+		{
+			var diff:int = records.length - keepLast.value;
+			if (diff > 0)
+			{
+				records = records.slice(diff);
+			}
+		}
+
+		/**
+		 * The session state maps a column name in dataColumns hash map to a value for its "aggregation" metadata.
+		 */
+		public const aggregationModes:ILinkableVariable = Weave.linkableChild(this, new LinkableVariable(null, typeofIsObject));
+		private function typeofIsObject(value:Object):Boolean
+		{
+			return typeof value == 'object';
+		}
+
+		private var records:Array = [];
+		private var propertyNames:Object = new JS.global.Set();
+
+		override public function getHierarchyRoot():IWeaveTreeNode
+		{
+			if (!_rootNode)
+				_rootNode = new ColumnTreeNode({
+					cacheSettings: {"label": false},
+					dataSource: this,
+					dependency: this,
+					data: this,
+					"label": getLabel,
+					hasChildBranches: false,
+					children: function():Array {
+						return JS.mapValues(propertyNames).map(
+							function (columnName:String, ..._):* {
+								var meta:Object = {};
+								meta[DATA_COLUMNNAME_META] = columnName;
+								return generateHierarchyNode(meta);
+							}
+						);
+					}
+				});
+			return _rootNode;
+		}
+
+		override protected function generateHierarchyNode(metadata:Object):IWeaveTreeNode
+		{
+			if (!metadata)
+				return null;
+
+			metadata = getColumnMetadata(metadata[DATA_COLUMNNAME_META]);
+
+			if (!metadata)
+				return null;
+
+			return new ColumnTreeNode({
+				dataSource: this,
+				idFields: [DATA_COLUMNNAME_META],
+				data: metadata
+			});
+		}
+
+		private function getColumnMetadata(dataColumnName:String):Object
+		{
+			var metadata:Object = {};
+			metadata[ColumnMetadata.KEY_TYPE] = keyType.value || DataType.STRING;
+			metadata[DATA_COLUMNNAME_META] = dataColumnName;
+			metadata[ColumnMetadata.TITLE] = dataColumnName;
+
+			var aggState:Object = aggregationModes.getSessionState();
+			var aggregation:String = aggState ? aggState[dataColumnName] : null;
+			aggregation = aggregation || Aggregation.LAST; /* Keep the last value by default, this makes more sense in streaming applications. */
+			metadata[ColumnMetadata.AGGREGATION] = aggregation;
+
+			if (aggregation != Aggregation.SAME)
+				metadata[ColumnMetadata.TITLE] = Weave.lang("{0} ({1})", metadata[ColumnMetadata.TITLE], aggregation);
+
+			return metadata;
+		}
+
+		override protected function requestColumnFromSource(proxyColumn:ProxyColumn):void
+		{
+			var columnName:String = proxyColumn.getMetadata(DATA_COLUMNNAME_META);
+
+			var keys:Array;
+			var data:Array = StandardLib.lodash.map(records, columnName);/*.map(
+				function (d:*,i:int,a:Array):*
+				{
+					return d !== undefined ? d : null;
+				}
+			);*/
+
+			if (keyProperty.value)
+			{
+				keys = StandardLib.lodash.map(records, keyProperty.value);
+			}
+			else
+			{
+				keys = StandardLib.lodash.range(data.length);
+			}
+
+			var metadata:Object = getColumnMetadata(columnName);
+
+			var dataType:String = DataSourceUtils.guessDataType(data);
+			metadata[ColumnMetadata.DATA_TYPE] = dataType;
+			proxyColumn.setMetadata(metadata);
+
+			DataSourceUtils.initColumn(proxyColumn, keys, data);
+		}
+	}
+}


XIFF-83 Currently 195 tests, 0 failures and 0 errors. First time everything is passing.

git-svn-id: c197267f952b24206666de142881703007ca05d5@13156 b35dd754-fafc-0310-a699-88a17e54d16e

--- src/org/igniterealtime/xiff/data/xhtml/XHTMLExtension.as
+++ src/org/igniterealtime/xiff/data/xhtml/XHTMLExtension.as
@@ -92,25 +92,11 @@
 		 */
 		public function get body():String
 		{
-			var list:XMLList = xml.children().(localName() == "body");
-			if (list.length() > 0)
-			{
-				XML.prettyPrinting = false;
-				return list[0].toXMLString();
-			}
-			return null;
+			return getField("body");
 		}
 		public function set body(value:String):void
 		{
-			if (value == null)
-			{
-				delete xml.body;
-			}
-			else
-			{
-				var node:XML = new XML(value);
-				xml.body = node;
-			}
+			setField("body", value);
 		}
 	}
 }


Fix 525654 - added test for runtime Vector specialization

error: pathspec 'test/acceptance/as3/Vector/specializedAtRuntime.as' did not match any file(s) known to git

--- test/acceptance/as3/Vector/specializedAtRuntime.as
+++ test/acceptance/as3/Vector/specializedAtRuntime.as
@@ -0,0 +1,81 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is [Open Source Virtual Machine.].
+ *
+ * The Initial Developer of the Original Code is
+ * Adobe System Incorporated.
+ * Portions created by the Initial Developer are Copyright (C) 2007-2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Adobe AS3 Team
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+/**
+   Description:
+   Runtime specialization
+   Specialization of the Vector type can be done at runtime
+   instead of at compile time.
+*/
+
+function getVector() { return Vector; }
+
+var CODE = 1007; //  Instantiation attempted on a non-constructor.
+
+startTest();
+var TITLE="Runtime specialization";
+writeHeaderToLog(TITLE);
+
+var x = getVector().<int>;
+y = new x();
+
+y.push(1);
+y.push(2);
+y.push(3);
+
+AddTestCase(    "Vector constructed via runtime specialization",
+                3,
+                y.length);
+
+AddTestCase(    "Vector constructed via runtime specialization",
+                2,
+                y[1]);
+
+
+var neg_result = "Failed to catch invalid construct";
+
+try {
+   unspecialized = getVector();
+   var z = new unspecialized();
+} catch ( ex )
+{
+    neg_result = String(ex);
+}
+
+AddTestCase ( "Invalid use of unspecialized type in constructor", TYPEERROR + CODE,  typeError(neg_result));
+
+
+test();


Basic 3D vector library.

Basic 3D vector library.

git-svn-id: b675b909355d5cf946977f44a8ec5a6ceb3782e4@210 ed5b42cb-e716-0410-a449-f6a68f950b19

error: pathspec 'src/as/com/threerings/flash/Vector3.as' did not match any file(s) known to git

--- src/as/com/threerings/flash/Vector3.as
+++ src/as/com/threerings/flash/Vector3.as
@@ -0,0 +1,138 @@
+package com.threerings.flash {
+
+
+/**
+ * Basic 3D vector implementation.
+ */
+public class Vector3
+{
+    /**
+     * Infinite vector - often the result of normalizing a zero vector, or intersecting
+     * a vector with a parallel plane.
+     */
+    public static const INFINITE :Vector3 = new Vector3(Infinity, Infinity, Infinity);
+
+    /** Vector components. */
+    public var x :Number = 0;
+    public var y :Number = 0;
+    public var z :Number = 0;
+
+    /** Creates a new vector. All three X, Y, Z parameters are optional. */
+    public function Vector3 (x :Number = 0, y :Number = 0, z :Number = 0)
+    {
+        this.x = x;
+        this.y = y;
+        this.z = z;
+    }
+
+    /** Duplicates a vector. */
+    public function clone() :Vector3
+    {
+        return new Vector3 (this.x, this.y, this.z);
+    }
+
+    /** Returns this vector's length. */
+    public function length () :Number
+    {
+        if (this == INFINITE || x == Infinity || y == Infinity || z == Infinity) {
+            return Infinity;
+        } else {
+            return Math.sqrt(x * x + y * y + z * z);
+        }
+    }
+
+    /** Returns a new vector that is a normalized version of this vector. */
+    public function normalize () :Vector3
+    {
+        var len :Number = length();
+        return new Vector3 (x / len, y / len, z / len);
+    }
+
+    /** Returns the dot product of this vector with vector v. */
+    public function dot (v :Vector3) :Number
+    {
+        return x * v.x + y * v.y + z * v.z;
+    }
+
+    /** Returns a new vector that is the cross product of this vector with vector v. */
+    public function cross (v :Vector3) :Vector3
+    {
+        return new Vector3(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x);
+    }
+
+    /** Returns a new vector that is the summation of this vector with vector v. */
+    public function add (v :Vector3) :Vector3
+    {
+        return new Vector3(x + v.x, y + v.y, z + v.z);
+    }
+
+    /** Returns a new vector that is the subtraction of vector v from this vector.*/
+    public function subtract (v :Vector3) :Vector3
+    {
+        return new Vector3(x - v.x, y - v.y, z - v.z);
+    }
+
+    /**
+     * Finds the intersection of a ray emitted from s along this vector,
+     * with a plane passing through point p with normal n. Returns the point
+     * of intersection, potentially infinite if the ray and plane are parallel.
+     */
+    public function intersection (s :Vector3, p :Vector3, n :Vector3) :Vector3
+    {
+        // formula: given ray from /s/ along vector /this/, and a plane passing
+        // through /p/ with normal /n/, we find intersection parameter as:
+        //   r = (n dot this) / (n dot (p - s))
+        // and the intersection point is:
+        //   s' = s + r * this
+        var rray :Number = p.subtract(s).dot(n);
+        var rplane :Number = this.dot(n);
+        if (rplane == 0) {
+            return INFINITE; // the two shall never meet
+        } else {
+            var r :Number = rray / rplane;
+            return s.add(this.multiply(r));
+        }
+    }
+
+    /**
+     * Returns a new vector that is the result of multiplying the current vector
+     * by the specified scalar.
+     */
+    public function multiply (value :Number) :Vector3
+    {
+        return new Vector3(x * value, y * value, z * value);
+    }
+
+    /**
+     * Returns a new vector that is a copy of this vector, with each coordinate clamped
+     * to within [0, 1]. Please note that this obviously does not preserve the
+     * vector's original direction in space.
+     */
+    public function clampToUnitBox () :Vector3
+    {
+        return new Vector3(Math.min(Math.max(x, 0), 1),
+                           Math.min(Math.max(y, 0), 1),
+                           Math.min(Math.max(z, 0), 1));
+    }
+
+    /**
+     * Returns a new vector that is the linear interpolation of vectors a and b
+     * at proportion p, where p is in [0, 1], p = 0 means the result is equal to a,
+     * and p = 1 means the result is equal to b.
+     */
+    public static function interpolate (a :Vector3, b :Vector3, p :Number) :Vector3
+    {
+        // todo: maybe convert this into a non-static function, to fit the rest of the class?
+        var q :Number = 1 - p;
+        return new Vector3(q * a.x + p * b.x,
+                           q * a.y + p * b.y,
+                           q * a.z + p * b.z);
+    }
+
+
+    public function toString () :String
+    {
+        return "[" + x + ", " + y + ", " + z + "]";
+    }
+}
+}


added MethodInvokerTest

added MethodInvokerTest

error: pathspec 'test/src/as3reflect/MethodInvokerTest.as' did not match any file(s) known to git

--- test/src/as3reflect/MethodInvokerTest.as
+++ test/src/as3reflect/MethodInvokerTest.as
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2007-2009 the original author or authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+package as3reflect {
+
+	import as3reflect.testclasses.ProxiedClass;
+
+	import flexunit.framework.TestCase;
+
+	/**
+	 * Class description
+	 *
+	 * @author Christophe Herreman
+	 */
+	public class MethodInvokerTest extends TestCase {
+
+		/**
+		 * Creates a new MethodInvokerTest.
+		 */
+
+		public function MethodInvokerTest(methodName:String=null) {
+			super(methodName);
+		}
+
+		public function testInvoke_forInstanceMethod():void	{
+			var array:Array = ["a", "b", "c"];
+			var m:MethodInvoker = new MethodInvoker();
+			m.target = array;
+			m.method = "indexOf";
+			m.arguments = ["b"];
+			var result:int = m.invoke();
+			assertEquals(1, result);
+		}
+
+		public function testInvoke_forStaticMethod():void	{
+			var m:MethodInvoker = new MethodInvoker();
+			m.target = Math;
+			m.method = "sqrt";
+			m.arguments = [64];
+			var result:Number = m.invoke();
+			assertEquals(8, result);
+		}
+
+		public function testInvoke_shouldInvokePublicMethodOnProxy():void {
+			var proxy:ProxiedClass = new ProxiedClass();
+			var m:MethodInvoker = new MethodInvoker();
+			m.target = proxy;
+			m.method = "getNumber";
+			var result:Number = m.invoke();
+			assertNotNull(result);
+			assertEquals(7, result);
+		}
+
+		public function testInvoke_shouldInvokeCallPropertyOnProxyWithoutArguments():void {
+			var proxy:ProxiedClass = new ProxiedClass();
+			var m:MethodInvoker = new MethodInvoker();
+			m.target = proxy;
+			m.method = "nonExistingMethod";
+			var result:Object = m.invoke();
+			assertNotNull(result);
+			assertEquals("nonExistingMethod", result.methodName);
+		}
+
+		public function testInvoke_shouldInvokeCallPropertyOnProxyWithArguments():void {
+			var proxy:ProxiedClass = new ProxiedClass();
+			var m:MethodInvoker = new MethodInvoker();
+			m.target = proxy;
+			m.method = "nonExistingMethod";
+			m.arguments = [1, "a", true];
+			var result:Object = m.invoke();
+			assertNotNull(result);
+			assertEquals("nonExistingMethod", result.methodName);
+			assertNotNull(result.args);
+			assertEquals(3, result.args.length);
+		}
+
+	}
+}


Actionscript SetAdapter.

Actionscript SetAdapter.

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

error: pathspec 'src/as/com/threerings/presents/dobj/SetAdapter.as' did not match any file(s) known to git

--- src/as/com/threerings/presents/dobj/SetAdapter.as
+++ src/as/com/threerings/presents/dobj/SetAdapter.as
@@ -0,0 +1,64 @@
+//
+// $Id: SetAdapter.java 4191 2006-06-13 22:42:20Z ray $
+//
+// Narya library - tools for developing networked games
+// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
+// http://www.threerings.net/code/narya/
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Lesser General Public License as published
+// by the Free Software Foundation; either version 2.1 of the License, or
+// (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+package com.threerings.presents.dobj {
+
+public class SetAdapter
+    implements SetListener
+{
+    public function SetAdapter (
+        addedFn :Function = null, updatedFn :Function = null,
+        removedFn :Function = null)
+    {
+        _addedFn = addedFn;
+        _updatedFn = updatedFn;
+        _removedFn = removedFn;
+    }
+
+    // from SetListener
+    public function entryAdded (event :EntryAddedEvent) :void
+    {
+        if (_addedFn != null) {
+            _addedFn(event);
+        }
+    }
+
+    // from SetListener
+    public function entryUpdated (event :EntryUpdatedEvent) :void
+    {
+        if (_updatedFn != null) {
+            _updatedFn(event);
+        }
+    }
+
+    // from SetListener
+    public function entryRemoved (event :EntryRemovedEvent) :void
+    {
+        if (_removedFn != null) {
+            _removedFn(event);
+        }
+    }
+
+    protected var _addedFn :Function;
+    protected var _updatedFn :Function;
+    protected var _removedFn :Function;
+}
+}


A helpful class for flex.

A helpful class for flex.

git-svn-id: b675b909355d5cf946977f44a8ec5a6ceb3782e4@795 ed5b42cb-e716-0410-a449-f6a68f950b19

error: pathspec 'src/as/com/threerings/flex/LoadedAsset.as' did not match any file(s) known to git

--- src/as/com/threerings/flex/LoadedAsset.as
+++ src/as/com/threerings/flex/LoadedAsset.as
@@ -0,0 +1,116 @@
+//
+// $Id$
+
+package com.threerings.flex {
+
+import flash.display.Loader;
+import flash.display.Sprite;
+
+import mx.core.IFlexAsset;
+import mx.core.IFlexDisplayObject;
+import mx.core.IInvalidating;
+
+import com.threerings.util.MultiLoader;
+
+/**
+ * An asset that can be used in Flex, that's loaded via a Loader.
+ */
+public class LoadedAsset extends Sprite
+    implements IFlexAsset, IFlexDisplayObject
+{
+    /**
+     * @param source a String (url) or URLRequest, or Class or a ByteArray.
+     */
+    public function LoadedAsset (source :Object) :void
+    {
+        MultiLoader.getLoaders(source, handleLoaded);
+    }
+
+    override public function get height () :Number
+    {
+        return (_loader == null) ? _measHeight : super.height;
+    }
+
+    override public function set height (value :Number) :void
+    {
+        if (_loader == null) {
+            _reqHeight = value;
+        } else {
+            _loader.height = value;
+        }
+    }
+
+    override public function get width () :Number
+    {
+        return (_loader == null) ? _measWidth : super.width;
+    }
+
+    override public function set width (value :Number) :void
+    {
+        if (_loader == null) {
+            _reqWidth = value;
+        } else {
+            _loader.width = value;
+        }
+    }
+
+    // from IFlexDisplayObject
+    public function get measuredHeight () :Number
+    {
+        return _measHeight;
+    }
+
+    // from IFlexDisplayObject
+    public function get measuredWidth () :Number
+    {
+        return _measWidth;
+    }
+
+    // from IFlexDisplayObject
+    public function move (x :Number, y :Number) :void
+    {
+        this.x = x;
+        this.y = y;
+    }
+
+    // from IFlexDisplayObject
+    public function setActualSize (newWidth :Number, newHeight :Number) :void
+    {
+        width = newWidth;
+        height = newHeight;
+    }
+
+    protected function handleLoaded (loader :Loader) :void
+    {
+        _loader = loader;
+        addChild(_loader);
+
+        // Note our measured size
+        _measWidth = loader.width;
+        _measHeight = loader.height;
+
+        // set any size that was set while we were being loaded
+        if (!isNaN(_reqWidth)) {
+            loader.width = _reqWidth;
+        }
+        if (!isNaN(_reqHeight)) {
+            loader.height = _reqHeight;
+        }
+
+        // if we have a parent that knows about sizes, tell it we now know our size
+        if (parent is IInvalidating) {
+            IInvalidating(parent).invalidateSize();
+        }
+    }
+
+    protected var _loader :Loader;
+
+    // initial / base sizes
+    protected var _measWidth :Number = 0;
+    protected var _measHeight :Number = 0;
+
+    // requested sizes, during loading
+    protected var _reqWidth :Number;
+    protected var _reqHeight :Number;
+}
+}


adding Bind class and getter, "log_level" and "log_detail" getters / setters


sneaky protected

sneaky protected

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/eric-stanley/robotlegs-framework.git/'


adding more extesions

adding more extesions


The standard CursorManager is a total piece of shit.
Using the source code, I made one that takes the same idea and doesn't suck.
Errr, it doesn't suck as much. It's still very shitty to go from the fast
system cursor to a chunky custom cursor that updates position at the
framerate of the swf.

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

error: pathspec 'src/as/com/threerings/mx/managers/CursorManager.as' did not match any file(s) known to git

--- src/as/com/threerings/mx/managers/CursorManager.as
+++ src/as/com/threerings/mx/managers/CursorManager.as
@@ -0,0 +1,300 @@
+package com.threerings.mx.managers {
+
+import flash.display.DisplayObject;
+import flash.display.InteractiveObject;
+import flash.display.Sprite;
+import flash.events.MouseEvent;
+import flash.text.TextField;
+import flash.text.TextFieldType;
+import flash.ui.Mouse;
+
+import mx.core.Application;
+import mx.managers.SystemManager;
+import mx.styles.CSSStyleDeclaration;
+import mx.styles.StyleManager;
+
+import com.threerings.util.HashMap;
+
+/**
+ */
+public class CursorManager
+{
+    public static const SYSTEM_CURSOR :int = 0;
+
+    public static const BUSY_CURSOR :int = 1;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Makes the cursor visible.
+     *  Cursor visibility is not reference-counted.
+     *  A single call to the showCursor() method
+     *  always shows the cursor regardless of how many calls
+     *  to the hideCursor() method were made.
+     */
+    public static function showCursor () :void
+    {
+        if (_currentCursorId == SYSTEM_CURSOR) {
+            Mouse.show();
+        } else {
+            _cursorHolder.visible = true;
+        }
+    }
+
+    /**
+     *  Makes the cursor invisible.
+     *  Cursor visibility is not reference-counted.
+     *  A single call to the hideCursor() method
+     *  always hides the cursor regardless of how many calls
+     *  to the showCursor() method were made.
+     */
+    public static function hideCursor () :void
+    {
+        _cursorHolder.visible = false;
+        Mouse.hide();
+    }
+
+    public static function getCurrentCursorId () :int
+    {
+        return _currentCursorId;
+    }
+
+    /**
+     *  Creates a new cursor.
+     *
+     *  @param cursorClass Class of the cursor to display.
+     *
+     *  @param xOffset Number that specifies the x offset
+     *  of the cursor, in pixels, relative to the mouse pointer.
+     *  The default value is 0.
+     *
+     *  @param yOffset Number that specifies the y offset
+     *  of the cursor, in pixels, relative to the mouse pointer.
+     *  The default value is 0.
+     *
+     *  @return The ID of the cursor.
+     */
+    public static function addCursor (
+            cursorClass :Class, xOffset :int = 0, yOffset :int = 0) :int
+    {
+        var cursorId :int = _nextCursorId++;
+
+        var rec :CursorRecord = new CursorRecord(cursorClass);
+        rec.x = xOffset;
+        rec.y = yOffset;
+
+        _cursors.put(cursorId, rec);
+
+        return cursorId;
+    }
+
+    /**
+     * Set the current cursor.
+     */
+    public static function setCursor (id :int) :void
+    {
+        if (id == _currentCursorId) {
+            return;
+        }
+
+        if (!_initialized) {
+            // oh, let's set it up
+            _systemManager = Application.application.systemManager;
+
+            // set up the busy cursor
+            var cursorManagerStyleDeclaration :CSSStyleDeclaration =
+                StyleManager.getStyleDeclaration("CursorManager");
+            var busyCursorClass :Class =
+                cursorManagerStyleDeclaration.getStyle("busyCursor");
+            _busyCursor = new CursorRecord(busyCursorClass);
+
+            // The first time a cursor is requested of the CursorManager,
+            // create a Sprite to hold the cursor symbol
+            _cursorHolder = new Sprite();
+            _cursorHolder.mouseEnabled = false;
+            _systemManager.cursorChildren.addChild(_cursorHolder);
+
+            _initialized = true;
+        }
+
+        // figure out what the new cursor will be like
+        var rec :CursorRecord;
+        if (id == BUSY_CURSOR) {
+            rec = _busyCursor;
+
+        } else if (id != SYSTEM_CURSOR) {
+            rec = (_cursors.get(id) as CursorRecord);
+            if (rec == null) {
+                // a bogus id was specified
+                // TODO: throw an error?
+                return;
+            }
+        }
+
+        if (rec != null && (rec.cursor is Class)) {
+            // go ahead and instantiate the class
+            try {
+                var disp :DisplayObject = new (rec.cursor as Class);
+                rec.cursor = disp;
+                if (disp is InteractiveObject) {
+                    (disp as InteractiveObject).mouseEnabled = false;
+                }
+
+            } catch (err :Error) {
+                // this cursor is not usable, bail
+                return;
+            }
+        }
+
+        // always remove any custom cursors from the hierarchy
+        if (_cursorHolder.numChildren > 0) {
+            _cursorHolder.removeChildAt(0);
+        }
+
+        if (id != SYSTEM_CURSOR) {
+            Mouse.hide();
+            var currentCursor :DisplayObject = (rec.cursor as DisplayObject);
+            _cursorHolder.addChild(currentCursor);
+            _cursorHolder.x = _systemManager.mouseX + rec.x;
+            _cursorHolder.y = _systemManager.mouseY + rec.y;
+
+            _currentXOffset = rec.x;
+            _currentYOffset = rec.y;
+            _systemManager.stage.addEventListener(
+                MouseEvent.MOUSE_MOVE, mouseMoveHandler);
+
+
+        } else {
+            _currentXOffset = 0;
+            _currentYOffset = 0;
+            _systemManager.stage.removeEventListener(
+                MouseEvent.MOUSE_MOVE, mouseMoveHandler);
+
+            Mouse.show();
+        }
+
+        _currentCursorId = id;
+    }
+
+    /**
+     *  Removes a cursor from the cursor list.
+     *  If the cursor being removed is the currently displayed cursor,
+     *  the CursorManager displays the next cursor in the list, if one exists.
+     *  If the list becomes empty, the CursorManager displays
+     *  the default system cursor.
+     *
+     *  @param cursorID ID of cursor to remove.
+     */
+    public static function removeCursor (id :int) :void
+    {
+        var rec :CursorRecord = (_cursors.remove(id) as CursorRecord);
+
+        if (rec != null && id == _currentCursorId) {
+            setCursor(SYSTEM_CURSOR);
+        }
+    }
+
+    /**
+     *  Removes all of the cursors from the cursor list
+     *  and restores the system cursor.
+     */
+    public static function removeAllCursors () :void
+    {
+        _cursors.clear();
+
+        if (_currentCursorId != BUSY_CURSOR) {
+            setCursor(SYSTEM_CURSOR);
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class event handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private static function mouseMoveHandler (event :MouseEvent) :void
+    {
+        _cursorHolder.x = _systemManager.mouseX + _currentXOffset;
+        _cursorHolder.y = _systemManager.mouseY + _currentYOffset;
+
+        var target :Object = event.target;
+
+        // Do target test.
+        if (!_overTextField &&
+                target is TextField && target.type == TextFieldType.INPUT) {
+            _overTextField = true;
+            _showSystemCursor = true;
+
+        } else if (_overTextField &&
+                !(target is TextField && target.type == TextFieldType.INPUT)) {
+            _overTextField = false;
+            _showCustomCursor = true;
+        }
+
+        // Handle switching between system and custom cursor.
+        if (_showSystemCursor) {
+            _showSystemCursor = false;
+            _cursorHolder.visible = false;
+            Mouse.show();
+        }
+        if (_showCustomCursor) {
+            _showCustomCursor = false;
+            _cursorHolder.visible = true;
+            Mouse.hide();
+        }
+    }
+
+    /** A mapping of all assigned cursor ids. */
+    private static const _cursors :HashMap = new HashMap();
+
+    private static var _currentCursorId :int = 0; // SYSTEM_CURSOR
+
+    private static var _nextCursorId :int = 2; // skip BUSY
+
+    private static var _initialized :Boolean = false;
+
+    private static var _cursorHolder :Sprite;
+
+    private static var _currentXOffset :int = 0;
+    private static var _currentYOffset :int = 0;
+
+    /** A record for the busy cursor (where it can't be removed). */
+    private static var _busyCursor :CursorRecord;
+
+    private static var _overTextField :Boolean = false;
+
+    private static var _overLink :Boolean = false;
+
+    private static var _showSystemCursor :Boolean = false;
+
+    private static var _showCustomCursor :Boolean = false;
+
+    private static var _systemManager :SystemManager = null;
+}
+}
+
+
+/**
+ */
+class CursorRecord extends Object
+{
+    public function CursorRecord (clazz :Class)
+    {
+        cursor = clazz;
+    }
+
+    /** The class, or instantiated cursor. */
+    public var cursor :Object
+
+    /** The x/y offset for the hotspot. */
+    public var x :Number;
+    public var y :Number;
+}


implement tests

implement tests

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/MerlinDS/utils.git/'


bug 615544: add regression testcase for interp/jit difference with unset variables showing null/undefined (r=cpeyer)

error: pathspec 'test/acceptance/regress/bug_615544.as' did not match any file(s) known to git

--- test/acceptance/regress/bug_615544.as
+++ test/acceptance/regress/bug_615544.as
@@ -0,0 +1,78 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is [Open Source Virtual Machine.].
+ *
+ * The Initial Developer of the Original Code is
+ * Adobe System Incorporated.
+ * Portions created by the Initial Developer are Copyright (C) 2011
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Adobe AS3 Team
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+On an unset variable in a class inside a with block with jit and hybrid shells the value is null and
+with interp the value is undefined.
+*/
+
+package {
+
+    var SECTION = "Regression Tests";       // provide a document reference (ie, Actionscript section)
+    var VERSION = "AS3";        // Version of ECMAScript or ActionScript
+    var TITLE   = "Bug 615544";       // Provide ECMA section title or a description
+
+    // 1st bug example using with
+    var actualValue;
+    class class1 {}
+    public class Bug615544 {
+        public function Bug615544() {
+            var cl:class1=new class1();
+            var undef1;
+            var undefR;
+            with (cl) {
+                undefR=undef1;
+            }
+            actualValue=undefR;
+       }
+    }
+
+    // 2nd bug example
+    var foo;
+    class test2 {
+        var bar;
+    }
+    var o=new test2();
+    o.bar=foo;
+
+    var testclass:Bug615544=new Bug615544();
+    startTest();
+    AddTestCase("bug 615544: unset variable in 'with' block  causes 'null/undefined inconsistency'", undefined, actualValue);
+    AddTestCase("bug 615544: unset variable 'null/undefined' causes 'null/undefined inconsistency'", undefined, o.bar);
+    test();
+
+}


qnd: added checksum (kalsig)

qnd: added checksum (kalsig)

git-svn-id: 8a2ccb88241e16c78017770bc38d91d6d5396a5a@77532 6b8eccd3-e8c5-4e7d-8186-e12b5326b719

--- generator/sources/as3/com/kaltura/delegates/WebDelegateBase.as
+++ generator/sources/as3/com/kaltura/delegates/WebDelegateBase.as
@@ -27,308 +27,341 @@
 // ===================================================================================================
 package com.kaltura.delegates {

-	import com.kaltura.config.IKalturaConfig;
-	import com.kaltura.config.KalturaConfig;
-	import com.kaltura.core.KClassFactory;
-	import com.kaltura.errors.KalturaError;
-	import com.kaltura.events.KalturaEvent;
-	import com.kaltura.net.KalturaCall;
-
-	import flash.events.ErrorEvent;
-	import flash.events.Event;
-	import flash.events.EventDispatcher;
-	import flash.events.HTTPStatusEvent;
-	import flash.events.IOErrorEvent;
-	import flash.events.SecurityErrorEvent;
-	import flash.events.TimerEvent;
-	import flash.net.FileReference;
-	import flash.net.URLLoader;
-	import flash.net.URLLoaderDataFormat;
-	import flash.net.URLRequest;
-	import flash.net.URLRequestMethod;
-	import flash.utils.Timer;
-	import flash.utils.getDefinitionByName;
-
-	public class WebDelegateBase extends EventDispatcher implements IKalturaCallDelegate {
-
-		public static var CONNECT_TIME : int = 60000; //60 secs
-		public static var LOAD_TIME : int = 60000; //60 secs
-
-		protected var connectTimer:Timer;
-		protected var loadTimer:Timer;
-
-		protected var _call:KalturaCall;
-		protected var _config:KalturaConfig;
-
-		protected var loader:URLLoader;
-		protected var fileRef:FileReference;
-
-		//Setters & getters
-		public function get call():KalturaCall { return _call; }
-		public function set call(newVal:KalturaCall):void { _call = newVal; }
-
-		public function get config():IKalturaConfig { return _config; }
-		public function set config(newVal:IKalturaConfig):void { _config = newVal as KalturaConfig; }
-
-		public function WebDelegateBase(call:KalturaCall = null , config:KalturaConfig = null)
-		{
-			this.call = call;
-			this.config = config;
-			if(!call) return; //maybe a multi request
-			if (call.useTimeout) {
-				connectTimer = new Timer(CONNECT_TIME, 1);
-				connectTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onConnectTimeout);
-
-				loadTimer = new Timer(LOAD_TIME, 1);
-				loadTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onLoadTimeOut);
-			}
-			execute();
-		}
-
-		public function close():void {
-			try {
-				loader.close();
-			} catch (e:*) { }
-
-			if (call.useTimeout) {
-				connectTimer.stop();
-				loadTimer.stop();
-			}
-		}
-
-		protected function onConnectTimeout(event:TimerEvent):void {
-			var kError:KalturaError = new KalturaError();
-			//kError.errorCode =
-			kError.errorMsg = "Connection Timeout: " + CONNECT_TIME/1000 + " sec with no post command from kaltura client.";
-			_call.handleError(kError);
-			dispatchEvent(new KalturaEvent(KalturaEvent.FAILED, false, false, false, null, kError));
-
-			loadTimer.stop();
-			close();
-		}
-
-		protected function onLoadTimeOut(event:TimerEvent):void {
-			connectTimer.stop();
-
-			close();
-
-			var kError:KalturaError = new KalturaError();
-			kError.errorMsg = "Post Timeout: "+ LOAD_TIME/1000 + " sec with no post result.";
-			_call.handleError(kError);
-			dispatchEvent(new KalturaEvent(KalturaEvent.FAILED, false, false, false, null, kError));
-		}
-
-		protected function execute():void {
-			if (call == null) { throw new Error('No call defined.'); }
-			post(); //post the call
-		}
-
-		/**
-		 * Helper function for sending the call straight to the server
-		 */
-		protected function post():void {
-
-			addOptionalArguments();
-
-			formatRequest();
-
-			sendRequest();
-
-			if (call.useTimeout) {
-				connectTimer.start();
-			}
-		}
-
-		protected function formatRequest():void
-		{
-			//The configuration is stronger then the args
-			if(_config.partnerId != null && _call.args["partnerId"] == -1)
-				_call.setRequestArgument("partnerId", _config.partnerId);
-
-			if (_config.ks != null)
-				_call.setRequestArgument("ks", _config.ks);
-
-			if(_config.clientTag != null)
-				_call.setRequestArgument("clientTag", _config.clientTag);
-
-			_call.setRequestArgument("ignoreNull", _config.ignoreNull);
-
-			//Create signature hash.
-			//call.setRequestArgument("kalsig", getMD5Checksum(call));
-		}
-
-		protected function sendRequest():void {
-
-			//construct the loader
-			createURLLoader();
-
-			//create the service request for normal calls
-			var url : String = _config.protocol + _config.domain +"/"+_config.srvUrl+"?service="+call.service+"&action="+call.action;
-
-			if( _call.method == URLRequestMethod.GET )url += "&";
-
-			var req:URLRequest = new URLRequest( url );
-			req.contentType = "application/x-www-form-urlencoded";
-			req.method = call.method;
-			req.data = call.args;
-
-			loader.dataFormat = URLLoaderDataFormat.TEXT;
-			loader.load(req);
-		}
-
-		protected function createURLLoader():void {
-			loader = new URLLoader();
-			loader.addEventListener(Event.COMPLETE, onDataComplete);
-			loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHTTPStatus);
-			loader.addEventListener(IOErrorEvent.IO_ERROR, onError);
-			loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onError);
-			loader.addEventListener(Event.OPEN, onOpen);
-		}
-
-		protected function onHTTPStatus(event:HTTPStatusEvent):void { }
-
-		protected function onOpen(event:Event):void {
-			if (call.useTimeout) {
-				connectTimer.stop();
-				loadTimer.start();
-			}
-		}
-
-		protected function addOptionalArguments():void {
-			//add optional args here
-		}
-
-		// Event Handlers
-		protected function onDataComplete(event:Event):void {
-			try{
-				handleResult( XML(event.target.data) );
-			}
-			catch( e:Error )
-			{
-				var kErr : KalturaError = new KalturaError();
-				kErr.errorCode = String(e.errorID);
-				kErr.errorMsg = e.message;
-				_call.handleError( kErr );
-			}
-		}
-
-		protected function onError( event:ErrorEvent ):void {
-			clean();
-			var kError:KalturaError = createKalturaError( event, loader.data);
-
-			if(!kError)
-			{
-				kError.errorMsg = event.text;
-				//kError.errorCode;
-			}
-
-			call.handleError(kError);
-
-			dispatchEvent(new KalturaEvent(KalturaEvent.FAILED, false, false, false, null, kError));
-		}
-
-		/**
-		 * parse the server's response and let the call process it.
-		 * @param result	server's response
-		 */
-		protected function handleResult(result:XML):void {
-			clean();
-
-			var error:KalturaError = validateKalturaResponse(result);
-
-			if (error == null) {
-				var digestedResult : Object = parse(result);
-				call.handleResult( digestedResult );
-			} else {
-				call.handleError(error);
-			}
-		}
-
-		/**
-		 * stop timers and clean event listeners
-		 */
-		protected function clean():void {
-			if (call.useTimeout) {
-				connectTimer.stop();
-				loadTimer.stop();
-			}
-
-			if (loader == null) { return; }
-
-			loader.removeEventListener(Event.COMPLETE, onDataComplete);
-			loader.removeEventListener(IOErrorEvent.IO_ERROR, onError);
-			loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onError);
-			loader.removeEventListener(Event.OPEN, onOpen);
-		}
-
-		/**
-		 * create the correct object and populate it with the given values. if the needed class is not found
-		 * in the file, a generic object is created with attributes matching the XML attributes.
-		 * Override this parssing function in the specific delegate to create the correct object.
-		 * @param	result	instance attributes
-		 * @return an instance of the class declared by the given XML.
-		 * */
-		public function parse( result : XML ) : *
-		{
-			//by defualt create the response object
-			var cls : Class;
-			try
-			{
-				cls = getDefinitionByName('com.kaltura.vo.'+ result.result.objectType) as Class;
-			}
-			catch( e : Error )
-			{
-				cls = Object;
-			}
-			var obj : * = (new KClassFactory( cls )).newInstanceFromXML( result.result );
-			return obj;
-		}
-
-		/**
-		 * If the result string holds an error, return a KalturaError object with
-		 * relevant values. <br/>
-		 * Overide this to create validation object and fill it.
-		 * @param result	the string returned from the server.
-		 * @return	matching error object
-		 */
-		protected function validateKalturaResponse(result:String) : KalturaError
-		{
-			var kError : KalturaError = null;
-			var xml : XML = XML(result);
-			if(xml.result.hasOwnProperty('error')){
-				kError = new KalturaError();
-				kError.errorCode = String(xml.result.error.code);
-				kError.errorMsg = xml.result.error.message;
-				dispatchEvent(new KalturaEvent(KalturaEvent.FAILED, false, false, false, null, kError));
-			}
-
-			return kError;
-		}
-
-		//Overide this to create error object and fill it
-		protected function createKalturaError( event : ErrorEvent , loaderData : * ) : KalturaError
-		{
-			var ke : KalturaError = new KalturaError();
-			return ke;
-		}
-
-
-		/**
-		 * create the url that is used for serve actions
-		 * @param call	the KalturaCall that defines the required parameters
-		 * @return URLRequest with relevant parameters
-		 * */
-		public function getServeUrl(call:KalturaCall):URLRequest
-		{
-			var url : String = _config.protocol + _config.domain +"/"+_config.srvUrl+"?service="+call.service+"&action="+call.action;
-			for (var key:String in call.args) {
-				url += "&" + key + "=" + call.args[key];
-			}
-			var req:URLRequest = new URLRequest( url );
-			req.contentType = "application/x-www-form-urlencoded";
-			req.method = call.method;
-//			req.data = call.args;
-			return req;
-		}
+	      import com.kaltura.config.IKalturaConfig;
+      import com.kaltura.config.KalturaConfig;
+      import com.kaltura.core.KClassFactory;
+      import com.kaltura.errors.KalturaError;
+      import com.kaltura.events.KalturaEvent;
+      import com.kaltura.net.KalturaCall;
+      import com.kaltura.encryption.MD5;
+
+      import flash.events.ErrorEvent;
+      import flash.events.Event;
+      import flash.events.EventDispatcher;
+      import flash.events.HTTPStatusEvent;
+      import flash.events.IOErrorEvent;
+      import flash.events.SecurityErrorEvent;
+      import flash.events.TimerEvent;
+      import flash.net.FileReference;
+      import flash.net.URLLoader;
+      import flash.net.URLLoaderDataFormat;
+      import flash.net.URLRequest;
+      import flash.net.URLRequestMethod;
+      import flash.utils.Timer;
+      import flash.utils.getDefinitionByName;
+
+      public class WebDelegateBase extends EventDispatcher implements IKalturaCallDelegate {
+
+            public static var CONNECT_TIME : int = 60000; //60 secs
+            public static var LOAD_TIME : int = 60000; //60 secs
+
+            protected var connectTimer:Timer;
+            protected var loadTimer:Timer;
+
+            protected var _call:KalturaCall;
+            protected var _config:KalturaConfig;
+
+            protected var loader:URLLoader;
+            protected var fileRef:FileReference;
+
+            //Setters & getters
+            public function get call():KalturaCall { return _call; }
+            public function set call(newVal:KalturaCall):void { _call = newVal; }
+
+            public function get config():IKalturaConfig { return _config; }
+            public function set config(newVal:IKalturaConfig):void { _config = newVal as KalturaConfig; }
+
+            public function WebDelegateBase(call:KalturaCall = null , config:KalturaConfig = null)
+            {
+                  this.call = call;
+                  this.config = config;
+                  if(!call) return; //maybe a multi request
+                  if (call.useTimeout) {
+                        connectTimer = new Timer(CONNECT_TIME, 1);
+                        connectTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onConnectTimeout);
+
+                        loadTimer = new Timer(LOAD_TIME, 1);
+                        loadTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onLoadTimeOut);
+                  }
+                  execute();
+            }
+
+            public function close():void {
+                  try {
+                        loader.close();
+                  } catch (e:*) { }
+
+                  if (call.useTimeout) {
+                        connectTimer.stop();
+                        loadTimer.stop();
+                  }
+            }
+
+            protected function onConnectTimeout(event:TimerEvent):void {
+                  var kError:KalturaError = new KalturaError();
+                  //kError.errorCode =
+                  kError.errorMsg = "Connection Timeout: " + CONNECT_TIME/1000 + " sec with no post command from kaltura client.";
+                  _call.handleError(kError);
+                  dispatchEvent(new KalturaEvent(KalturaEvent.FAILED, false, false, false, null, kError));
+
+                  loadTimer.stop();
+                  close();
+            }
+
+            protected function onLoadTimeOut(event:TimerEvent):void {
+                  connectTimer.stop();
+
+                  close();
+
+                  var kError:KalturaError = new KalturaError();
+                  kError.errorMsg = "Post Timeout: "+ LOAD_TIME/1000 + " sec with no post result.";
+                  _call.handleError(kError);
+                  dispatchEvent(new KalturaEvent(KalturaEvent.FAILED, false, false, false, null, kError));
+            }
+
+            protected function execute():void {
+                  if (call == null) { throw new Error('No call defined.'); }
+                  post(); //post the call
+            }
+
+            /**
+            * Helper function for sending the call straight to the server
+            */
+            protected function post():void {
+
+                  addOptionalArguments();
+
+                  formatRequest();
+
+                  sendRequest();
+
+                  if (call.useTimeout) {
+                        connectTimer.start();
+                  }
+            }
+
+            protected function formatRequest():void
+            {
+                  //The configuration is stronger then the args
+                  if(_config.partnerId != null && _call.args["partnerId"] == -1)
+                        _call.setRequestArgument("partnerId", _config.partnerId);
+
+                  if (_config.ks != null)
+                        _call.setRequestArgument("ks", _config.ks);
+
+                  if(_config.clientTag != null)
+                        _call.setRequestArgument("clientTag", _config.clientTag);
+
+                  _call.setRequestArgument("ignoreNull", _config.ignoreNull);
+
+                  //Create signature hash.
+                  //call.setRequestArgument("kalsig", getMD5Checksum(call));
+            }
+
+            protected function getMD5Checksum(call:KalturaCall):String
+            {
+                  var props:Array = new Array();
+                  for each(var prop:String in call.args)
+                  props.push(prop);
+
+                  props.push("service");
+                  props.push("action");
+                  props.sort();
+
+                  var s:String;
+                  for each(prop in props)
+                  {
+                        s += prop;
+
+                        if (prop == "service")
+                              s += call.service;
+                        else if (prop == "action")
+                              s += call.action;
+                        else
+                              s += call.args[prop];
+                  }
+
+                  return MD5.encrypt(s);
+            }
+
+            protected function sendRequest():void {
+
+                  //construct the loader
+                  createURLLoader();
+
+                  //Create signature hash.
+                  var kalsig:String = getMD5Checksum(call);
+
+
+                  //create the service request for normal calls
+                  var url : String = _config.protocol + _config.domain +"/"+_config.srvUrl+"?service="+call.service+"&action="+call.action+"&kalsig="+kalsig;;
+
+                  if( _call.method == URLRequestMethod.GET )url += "&";
+
+                  var req:URLRequest = new URLRequest( url );
+                  req.contentType = "application/x-www-form-urlencoded";
+                  req.method = call.method;
+                  req.data = call.args;
+
+                  loader.dataFormat = URLLoaderDataFormat.TEXT;
+                  loader.load(req);
+            }
+
+            protected function createURLLoader():void {
+                  loader = new URLLoader();
+                  loader.addEventListener(Event.COMPLETE, onDataComplete);
+                  loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHTTPStatus);
+                  loader.addEventListener(IOErrorEvent.IO_ERROR, onError);
+                  loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onError);
+                  loader.addEventListener(Event.OPEN, onOpen);
+            }
+
+            protected function onHTTPStatus(event:HTTPStatusEvent):void { }
+
+            protected function onOpen(event:Event):void {
+                  if (call.useTimeout) {
+                        connectTimer.stop();
+                        loadTimer.start();
+                  }
+            }
+
+            protected function addOptionalArguments():void {
+                  //add optional args here
+            }
+
+            // Event Handlers
+            protected function onDataComplete(event:Event):void {
+                  try{
+                        handleResult( XML(event.target.data) );
+                  }
+                  catch( e:Error )
+                  {
+                        var kErr : KalturaError = new KalturaError();
+                        kErr.errorCode = String(e.errorID);
+                        kErr.errorMsg = e.message;
+                        _call.handleError( kErr );
+                  }
+            }
+
+            protected function onError( event:ErrorEvent ):void {
+                  clean();
+                  var kError:KalturaError = createKalturaError( event, loader.data);
+
+                  if(!kError)
+                  {
+                        kError.errorMsg = event.text;
+                        //kError.errorCode;
+                  }
+
+                  call.handleError(kError);
+
+                  dispatchEvent(new KalturaEvent(KalturaEvent.FAILED, false, false, false, null, kError));
+            }
+
+            /**
+            * parse the server's response and let the call process it.
+             * @param result  server's response
+            */
+            protected function handleResult(result:XML):void {
+                  clean();
+
+                  var error:KalturaError = validateKalturaResponse(result);
+
+                  if (error == null) {
+                        var digestedResult : Object = parse(result);
+                        call.handleResult( digestedResult );
+                  } else {
+                        call.handleError(error);
+                  }
+            }
+
+            /**
+            * stop timers and clean event listeners
+             */
+            protected function clean():void {
+                  if (call.useTimeout) {
+                        connectTimer.stop();
+                        loadTimer.stop();
+                  }
+
+                  if (loader == null) { return; }
+
+                  loader.removeEventListener(Event.COMPLETE, onDataComplete);
+                  loader.removeEventListener(IOErrorEvent.IO_ERROR, onError);
+                  loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onError);
+                  loader.removeEventListener(Event.OPEN, onOpen);
+            }
+
+            /**
+            * create the correct object and populate it with the given values. if the needed class is not found
+             * in the file, a generic object is created with attributes matching the XML attributes.
+            * Override this parssing function in the specific delegate to create the correct object.
+            * @param   result      instance attributes
+            * @return an instance of the class declared by the given XML.
+            * */
+            public function parse( result : XML ) : *
+            {
+                  //by defualt create the response object
+                  var cls : Class;
+                  try
+                  {
+                        cls = getDefinitionByName('com.kaltura.vo.'+ result.result.objectType) as Class;
+                  }
+                  catch( e : Error )
+                  {
+                        cls = Object;
+                  }
+                  var obj : * = (new KClassFactory( cls )).newInstanceFromXML( result.result );
+                  return obj;
+            }
+
+            /**
+            * If the result string holds an error, return a KalturaError object with
+             * relevant values. <br/>
+            * Overide this to create validation object and fill it.
+            * @param result  the string returned from the server.
+            * @return  matching error object
+             */
+            protected function validateKalturaResponse(result:String) : KalturaError
+            {
+                  var kError : KalturaError = null;
+                  var xml : XML = XML(result);
+                  if(xml.result.hasOwnProperty('error')){
+                        kError = new KalturaError();
+                        kError.errorCode = String(xml.result.error.code);
+                        kError.errorMsg = xml.result.error.message;
+                        dispatchEvent(new KalturaEvent(KalturaEvent.FAILED, false, false, false, null, kError));
+                  }
+
+                  return kError;
+            }
+
+            //Overide this to create error object and fill it
+            protected function createKalturaError( event : ErrorEvent , loaderData : * ) : KalturaError
+            {
+                  var ke : KalturaError = new KalturaError();
+                  return ke;
+            }
+
+
+            /**
+            * create the url that is used for serve actions
+            * @param call    the KalturaCall that defines the required parameters
+             * @return URLRequest with relevant parameters
+            * */
+            public function getServeUrl(call:KalturaCall):URLRequest
+            {
+                  var url : String = _config.protocol + _config.domain +"/"+_config.srvUrl+"?service="+call.service+"&action="+call.action;
+                  for (var key:String in call.args) {
+                        url += "&" + key + "=" + call.args[key];
+                  }
+                  var req:URLRequest = new URLRequest( url );
+                  req.contentType = "application/x-www-form-urlencoded";
+                  req.method = call.method;
+//                req.data = call.args;
+                  return req;
+            }
+      }
+
 	}
 }


Added a JavaScriptCanvas component which reads from an existing HTML Canvas element.

error: pathspec 'WeaveUI/src/weave/ui/JavaScriptCanvas.as' did not match any file(s) known to git

--- WeaveUI/src/weave/ui/JavaScriptCanvas.as
+++ WeaveUI/src/weave/ui/JavaScriptCanvas.as
@@ -0,0 +1,82 @@
+package weave.ui
+{
+	import weave.compiler.StandardLib;
+	import weave.api.core.ILinkableObject;
+
+	import mx.containers.Canvas;
+	import mx.controls.Image;
+
+	import flash.events.Event;
+	import flash.utils.Timer;
+	import flash.utils.getTimer;
+	import flash.events.TimerEvent;
+
+	public class JavaScriptCanvas extends Canvas implements ILinkableObject
+	{
+		private var buffers:Vector.<Image> = new Vector.<Image>(2, true);
+		private var buffer_index:int = 0;
+		private var lastUpdate:int = 0;
+		private var forceReadTimer:Timer;
+
+		public var sourceId:String = null;
+
+
+		public function JavaScriptCanvas()
+		{
+			super();
+		}
+
+		override protected function createChildren():void
+		{
+			lastUpdate = getTimer();
+			forceReadTimer = new Timer(250);
+			buffers[0] = new Image();
+			buffers[1] = new Image();
+
+			buffers[0].addEventListener(Event.COMPLETE, readFromCanvas);
+			buffers[1].addEventListener(Event.COMPLETE, readFromCanvas);
+			forceReadTimer.addEventListener(TimerEvent.TIMER, readFromCanvas);
+
+			addChild(buffers[0]);
+			addChild(buffers[1]);
+
+			super.createChildren();
+
+			forceReadTimer.start();
+		}
+
+		public function readFromCanvas(evt:Event):void
+		{
+			/* Only execute on the timer tick if we haven't loaded recently */
+			if (evt.type == TimerEvent.TIMER && (getTimer() < (lastUpdate + 200)) ) return;
+
+			if (evt.type == TimerEvent.TIMER) weaveTrace("timed out, jumpstarting canvas read");
+
+			var content:String;
+
+			/* TODO convert to raw ExternalInterface */
+			if (sourceId) content = JavaScript.exec(
+				{elementId: sourceId},
+				"var canvas = document.getElementById(elementId);",
+				"return canvas && canvas.toDataURL && canvas.toDataURL().split(',').pop();");
+
+			if (sourceId && content)
+			{
+				setImage(content);
+			}
+
+
+		}
+
+		public function setImage(base64:String):void
+		{
+			lastUpdate = getTimer();
+
+			setChildIndex(buffers[buffer_index], 0);
+
+			buffer_index = (buffer_index + 1) % 2;
+
+			buffers[buffer_index].source = StandardLib.atob(base64);
+		}
+	}
+}


Issue 82; Draw the symbol when it is referenced. Do not draw the symbol when it is defined.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/leymannx/svgweb.git/'


Test class for cloning of PropertyLevelCopyableCloneableClass.

error: pathspec 'dolly-framework/src/test/actionscript/dolly/CloningOfPropertyLevelCopyableCloneableClassTest.as' did not match any file(s) known to git

--- dolly-framework/src/test/actionscript/dolly/CloningOfPropertyLevelCopyableCloneableClassTest.as
+++ dolly-framework/src/test/actionscript/dolly/CloningOfPropertyLevelCopyableCloneableClassTest.as
@@ -0,0 +1,56 @@
+package dolly {
+
+import dolly.core.dolly_internal;
+import dolly.data.PropertyLevelCopyableCloneableClass;
+
+import org.as3commons.reflect.Type;
+
+use namespace dolly_internal;
+
+public class CloningOfPropertyLevelCopyableCloneableClassTest {
+
+	private var propertyLevelCopyableCloneable:PropertyLevelCopyableCloneableClass;
+	private var propertyLevelCopyableCloneableType:Type;
+
+	[Before]
+	public function before():void {
+		propertyLevelCopyableCloneable = new PropertyLevelCopyableCloneableClass();
+		propertyLevelCopyableCloneable.property1 = "property1 value";
+		propertyLevelCopyableCloneable.writableField1 = "writableField1 value";
+		propertyLevelCopyableCloneableType = Type.forInstance(propertyLevelCopyableCloneable);
+	}
+
+	[After]
+	public function after():void {
+		propertyLevelCopyableCloneable = null;
+		propertyLevelCopyableCloneableType = null;
+	}
+
+	/**
+	 * Cloner.findingAllWritableFieldsForType() method will throw CloningError in this case
+	 * because PropertyLevelCopyableCloneableClass class is not cloneable indeed.
+	 */
+	[Test(expects="dolly.core.errors.CloningError")]
+	public function findingAllWritableFieldsForType():void {
+		Cloner.findAllWritableFieldsForType(propertyLevelCopyableCloneableType);
+	}
+
+	/**
+	 * Cloner.clone() method will throw CloningError in this case
+	 * because PropertyLevelCopyableCloneableClass class is not cloneable indeed.
+	 */
+	[Test(expects="dolly.core.errors.CloningError")]
+	public function cloningByCloner():void {
+		Cloner.clone(propertyLevelCopyableCloneable);
+	}
+
+	/**
+	 * Method clone() will throw CloningError in this case
+	 * because PropertyLevelCopyableCloneableClass class is not cloneable indeed.
+	 */
+	[Test(expects="dolly.core.errors.CloningError")]
+	public function cloningByCloneFunction():void {
+		clone(propertyLevelCopyableCloneable);
+	}
+}
+}


Added ConstrainedSprite to help with maintained aspect ratio assets - like images

git-svn-id: 02605e11d3a461bc7e12f3f3880edf4b0c8dcfd0@4681 3e7533ad-8678-4d30-8e38-00a379d3f0d0

error: pathspec 'src/flash/display/ConstrainedSprite.as' did not match any file(s) known to git

--- src/flash/display/ConstrainedSprite.as
+++ src/flash/display/ConstrainedSprite.as
@@ -0,0 +1,83 @@
+package flash.display {
+	import flash.events.Event;
+	import flash.geom.Rectangle;
+	import flash.utils.clearTimeout;
+	import flash.utils.setTimeout;
+
+
+	public class ConstrainedSprite extends Sprite {
+
+		private var _width:Number;
+		private var _height:Number;
+
+		override public function set width(width:Number):void {
+			_width = width;
+			drawChildren();
+		}
+
+		override public function get width():Number {
+			return _width;
+		}
+
+		override public function set height(height:Number):void {
+			_height = height;
+			drawChildren();
+		}
+
+		override public function get height():Number {
+			return _height;
+		}
+
+		private function drawChildren():void {
+			var rect:Rectangle;
+			if(!isNaN(_width) && !isNaN(_height) && _width != 0 && _height != 0) {
+				visibleChildren(function(child:DisplayObject, index:int):void {
+					if(child.width > 0 && child.height > 0) {
+						rect = constrainedSize(child.width, child.height, _width, _height);
+						child.width = rect.width;
+						child.height = rect.height;
+						child.x = Math.round((_width/2) - (child.width/2));
+						child.y = Math.round((_height/2) - (child.height/2));
+
+					}
+				})
+			}
+		}
+
+		private function visibleChildren(handler:Function):void {
+			var len:Number = numChildren;
+			var child:DisplayObject;
+			for(var i:int; i < len; i++) {
+				child = getChildAt(i);
+				if(child.visible) {
+					handler.apply(handler, [child, i]);
+				}
+			}
+		}
+
+		private function constrainedSize(ow:int, oh:int, cw:int, ch:int):Rectangle {
+			var w:int;
+			var h:int;
+
+			if (ow/oh > cw/ch) {
+				w = cw;
+				h = (w/ow) * oh;
+			}
+			else if (ow/oh < cw/ch) {
+				h = ch;
+				w = (h/oh) * ow;
+			}
+			else {
+				if (ow > oh) {
+					w = cw;
+					h = (w/ow)*oh;
+				}
+				else {
+					h = ch;
+					w = (h/oh)*ow;
+				}
+			}
+			return new Rectangle(0, 0, w, h);
+		}
+	}
+}


Generic control for scrolling a display object around within its parent.
This doesn't (seem to) work quite right because of the way Flash does
handles component dimensions. It's designed to be overridden.

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

error: pathspec 'src/as/com/threerings/mx/controls/ScrollBox.as' did not match any file(s) known to git

--- src/as/com/threerings/mx/controls/ScrollBox.as
+++ src/as/com/threerings/mx/controls/ScrollBox.as
@@ -0,0 +1,147 @@
+package com.threerings.mx.controls {
+
+import flash.display.DisplayObject;
+import flash.display.Graphics;
+import flash.display.Sprite;
+
+import flash.events.Event;
+import flash.events.MouseEvent;
+
+import flash.geom.Matrix;
+import flash.geom.Rectangle;
+
+import mx.containers.Canvas;
+
+/**
+ * A control for scrolling some component separately.
+ */
+public class ScrollBox extends Canvas
+{
+    public function ScrollBox (
+        target :DisplayObject, maxWidth :int, maxHeight :int)
+    {
+        _target = target;
+        _maxWidth = maxWidth;
+        _maxHeight = maxHeight;
+
+        opaqueBackground = 0xFFFFFF;
+
+        _box = new Sprite();
+        rawChildren.addChild(_box);
+
+        recheckBounds();
+
+        // TODO: only when something changes
+        addEventListener(Event.ENTER_FRAME, enterFrame);
+
+        _box.addEventListener(MouseEvent.MOUSE_DOWN, spritePressed);
+    }
+
+    override public function setActualSize (w :Number, h :Number) :void
+    {
+        super.setActualSize(w, h);
+
+        recheckBounds();
+
+        graphics.clear();
+        graphics.lineStyle(1, 0);
+        graphics.drawRect(0, 0, width, height);
+    }
+
+    protected function enterFrame (vent :Event) :void
+    {
+        if (!_dragging) {
+            recheckBounds();
+        }
+    }
+
+    /**
+     * Get the bounds of the scrollable area. Broken-out for easy overridding.
+     */
+    protected function getScrollBounds () :Rectangle
+    {
+        var bounds :Rectangle = _target.transform.pixelBounds;
+//        var m :Matrix = _target.transform.concatenatedMatrix;
+//        bounds.topLeft = m.transformPoint(bounds.topLeft);
+//        bounds.bottomRight = m.transformPoint(bounds.bottomRight);
+        return bounds;
+    }
+
+    protected function recheckBounds () :void
+    {
+        var bounds :Rectangle = getScrollBounds();
+
+        // see what's visible, what's not..
+        var scroller :Rectangle = _target.scrollRect;
+        if (scroller == null) {
+            scroller = bounds.clone();
+        }
+
+        if ((_bounds != null) && _bounds.equals(bounds) &&
+                (_scroller != null) && _scroller.equals(scroller)) {
+            return;
+        }
+
+        _bounds = bounds.clone();
+        _scroller = scroller;
+
+        _scale = Math.min(1,
+            Math.min(_maxWidth / _bounds.width, _maxHeight / _bounds.height));
+        width = _scale * _bounds.width;
+        height = _scale * _bounds.height;
+
+        drawBox(_box, _scroller.width * _scale, _scroller.height * _scale);
+
+        _box.x = (_scroller.x - _bounds.x) * _scale;
+        _box.y = (_scroller.y - _bounds.y) * _scale;
+    }
+
+    protected function drawBox (box :Sprite, ww :Number, hh :Number) :void
+    {
+        var g :Graphics = _box.graphics;
+        g.clear();
+        g.beginFill(0x0000FF);
+        g.drawRect(0, 0, ww, hh);
+        g.endFill();
+    }
+
+    protected function spritePressed (evt :MouseEvent) :void
+    {
+        _box.addEventListener(Event.ENTER_FRAME, boxUpdate);
+        _box.startDrag(true,
+            new Rectangle(0, 0, width - _box.width, height - _box.height));
+        stage.addEventListener(MouseEvent.MOUSE_UP, spriteReleased);
+        _dragging = true;
+    }
+
+    protected function spriteReleased (evt :MouseEvent) :void
+    {
+        stage.removeEventListener(MouseEvent.MOUSE_UP, spriteReleased);
+        _box.stopDrag();
+        _box.removeEventListener(Event.ENTER_FRAME, boxUpdate);
+        _dragging = false;
+    }
+
+    protected function boxUpdate (evt :Event) :void
+    {
+        var r :Rectangle = _target.scrollRect;
+        r.x = (_box.x / _scale) + _bounds.x;
+        r.y = (_box.y / _scale) + _bounds.y;
+        _target.scrollRect = r;
+    }
+
+    protected var _dragging :Boolean;
+
+    protected var _target :DisplayObject;
+
+    protected var _maxWidth :int;
+    protected var _maxHeight :int;
+
+    protected var _box :Sprite;
+
+    protected var _scale :Number;
+
+    protected var _bounds :Rectangle;
+    protected var _scroller :Rectangle;
+}
+}


starting Processes implementation

starting Processes implementation

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/rafaelcordoba/cocktail-demo.git/'


webcam flash change

webcam flash change

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/cybersky/live.git/'