Transferred from the Adobe Open Source Subversion Repository

Revision: 16659
Author:   ealimam@adobe.com
Date:     2010-06-24T19:30:51.116002Z

Log Message:
-----------
(Button Skin) Initial check-in.

Incorporates Guillermo's XD design from 6/23/2010.
Reviewed by: Glenn Ruehle

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/Button_bg_up.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/Button_bg_down.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonSkin.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonSkin.as
@@ -1,116 +1,231 @@
 package spark.skins.mobile
 {
-
-import flash.display.DisplayObject;
-import flash.events.EventDispatcher;
-import flash.text.TextField;
-import flash.text.TextFormat;
-
-import spark.components.Button;
-
-public class ButtonSkin extends SliderSkin
-{
-    public function ButtonSkin()
-    {
-        super();
-    }
-
-    //////////////////////////////////////////
-    // Properties
-    //////////////////////////////////////////
-
-    public var hostComponent:Button;
-
-    //////////////////////////////////////////
-    // Methods
-    //////////////////////////////////////////
-
-    override protected function commitCurrentState():void
-    {
-        if (currentState == "down")
-        {
-            removeChild(bgImg);
-            bgImg = new Button_bg_down();
-            addChild(bgImg);
-            invalidateDisplayList();
-        }
-        else
-        {
-            if (!(bgImg is Button_bg_up))
-            {
-                removeChild(bgImg);
-                bgImg = new Button_bg_up();
-                addChild(bgImg);
-                invalidateDisplayList();
-            }
-
-			if (currentState == "disabled")
-				bgImg.alpha = textField.alpha = 0.5;
+
+	import flash.display.DisplayObject;
+	import flash.display.GradientType;
+	import flash.events.EventDispatcher;
+	import flash.geom.Matrix;
+	import flash.text.TextField;
+	import flash.text.TextFormat;
+
+	import mx.core.UIComponent;
+	import mx.utils.ColorUtil;
+
+	import spark.components.Button;
+
+	public class ButtonSkin extends UIComponent
+	{
+		public function ButtonSkin()
+		{
+			super();
+		}
+
+		public var hostComponent:Button;
+
+		//////////////////////////////////////////
+		// Properties
+		//////////////////////////////////////////
+
+		// currentState
+		private var _currentState:String;
+
+		override public function get currentState():String
+		{
+			return _currentState;
+		}
+
+		override public function set currentState(value:String):void
+		{
+			if (value == _currentState)
+				return;
+
+			_currentState = value;
+
+			if (_currentState == "down")
+			{
+				if(bgImg != null) {
+					removeChild(bgImg);
+				}
+				bgImg = new Button_bg_down();
+				addChild(bgImg);
+				invalidateDisplayList();
+			}
 			else
-				bgImg.alpha = textField.alpha = 1;
-        }
-    }
-
-    override protected function createChildren():void
-    {
-        var tf:TextFormat = new TextFormat;
-
-        textField = new TextField();
-        tf.align = "center";
-        tf.color = getStyle("color");
-        tf.font = getStyle("fontFamily");
-        tf.size = getStyle("fontSize");
-        textField.defaultTextFormat = tf;
-
-        addChild(textField);
-
-        bgImg = new Button_bg_up();
-        addChild(bgImg);
-    }
-
-    override protected function commitProperties():void
-    {
-        textField.text = hostComponent.label;
-    }
-
-	override public function getExplicitOrMeasuredWidth():Number
-	{
-		return Math.max(70, textField.textWidth + 20);
+			{
+				if (!(bgImg is Button_bg_up))
+				{
+					if(bgImg != null) {
+						removeChild(bgImg);
+					}
+
+					bgImg = new Button_bg_up();
+					addChild(bgImg);
+					invalidateDisplayList();
+				}
+			}
+
+			if(_currentState == "disabled") {
+				alpha = 0.5;
+			}
+			else
+				alpha = 1;
+		}
+
+		//////////////////////////////////////////
+		// Methods
+		//////////////////////////////////////////
+
+		override protected function createChildren():void
+		{
+			// Set up text fields only if we have a hostComponent
+			if(hostComponent != null) {
+				var tf:TextFormat = new TextFormat;
+
+				textField = new TextField();
+				textFieldShadow = new TextField();
+
+				tf.align = "center";
+				tf.color = getStyle("color");
+				tf.font = getStyle("fontFamily");
+				tf.size = getStyle("fontSize");
+				tf.bold = getStyle("fontWeight") == "bold";
+				textField.defaultTextFormat = tf;
+				tf.color = 0x000000;
+				textFieldShadow.defaultTextFormat = tf;
+				textFieldShadow.alpha = .20;
+
+				addChild(textField);
+				addChild(textFieldShadow);
+			}
+
+			if(_currentState == "down" ) {
+				if(bgImg != null) {
+					removeChild(bgImg);
+				}
+				bgImg = new Button_bg_down();
+			}
+			else {
+				if(bgImg != null) {
+					removeChild(bgImg);
+				}
+				bgImg = new Button_bg_up();
+			}
+
+			if(bgImg != null) {
+				addChild(bgImg);
+			}
+		}
+
+		override protected function commitProperties():void
+		{
+			if(hostComponent != null) {
+				textField.text = hostComponent.label;
+				textFieldShadow.text = hostComponent.label;
+			}
+		}
+//
+//		override public function getExplicitOrMeasuredWidth():Number
+//		{
+//			if(hostComponent != null)
+//				return textField.textWidth + 20;
+//
+//			return bgImg.width;
+//		}
+//
+//		override public function getExplicitOrMeasuredHeight():Number
+//		{
+//			return bgImg.height;
+//		}
+
+		override protected function measure():void
+		{
+			// TODO: Minimum sizes should come from the embedded graphics.
+			measuredWidth = textField.textWidth + 20;
+
+			// graphic height
+			measuredHeight = 42;
+		}
+
+		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+		{
+			graphics.clear();
+
+			if(bgImg != null) {
+				bgImg.x = bgImg.y = 0.5;
+
+				// use when using fxg paths
+				//bgImg.x = bgImg.y = 0;
+				bgImg.width = unscaledWidth;
+				bgImg.height = unscaledHeight;
+			}
+
+			// Set Text/Text Shadow position and size
+			if(textField != null) {
+				// Center the label
+				textField.width = unscaledWidth;
+				textField.height = textField.textHeight + 4;
+				textField.y = Math.round((unscaledHeight - textField.height) / 2);
+
+				// Center the label shadow
+				textFieldShadow.width = unscaledWidth;
+				textFieldShadow.height = textFieldShadow.textHeight + 4;
+				textFieldShadow.y = textField.y + 1;
+
+				// Put the label on top
+				setChildIndex(textField, numChildren - 1);
+
+				// set label shadow behind main label
+				setChildIndex(textFieldShadow, numChildren - 2);
+			}
+
+			// Draw the gradient background
+			matrix.createGradientBox(unscaledWidth - 1, unscaledHeight - 2, Math.PI / 2, 0, 0);
+			var chromeColor:uint = getStyle("chromeColor");
+			colors[0] = ColorUtil.adjustBrightness2(chromeColor, 20);
+			colors[1] = chromeColor;
+			colors[2] = ColorUtil.adjustBrightness2(chromeColor, -20);
+
+			graphics.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, matrix);
+
+			// Draw the background rectangle within the border, so the corners of the rect don't spill over into the rounded corners of the Button
+			graphics.drawRect(1, 1, unscaledWidth - 2, unscaledHeight - 3);
+			graphics.endFill();
+
+			super.updateDisplayList(unscaledWidth, unscaledHeight);
+		}
+
+		override public function styleChanged(styleProp:String):void {
+			// Only deal with text if a hostComponent exists and text fields are not empty
+			if(hostComponent != null && textField != null && textFieldShadow != null) {
+				var tf:TextFormat = textField.defaultTextFormat;
+				tf.size = getStyle("fontSize");
+
+				if(getStyle("fontWeight") == "bold")
+					tf.bold = true ;
+				else if(getStyle("fontWeight") == "normal")
+					tf.bold = false;
+
+				tf.color = getStyle("color");
+				tf.align = "center";
+
+				textField.setTextFormat(tf);
+				tf.color = 0x000000;
+				textFieldShadow.setTextFormat(tf);
+				textFieldShadow.alpha = .20;
+			}
+			super.styleChanged(styleProp);
+		}
+
+		//////////////////////////////////////////
+		// Internals
+		//////////////////////////////////////////
+
+		private var textField:TextField;
+		private var textFieldShadow:TextField;
+		private var bgImg:DisplayObject;
+		private static var matrix:Matrix = new Matrix();
+		private static var alphas:Array = [1, 1, 1];
+		private static var ratios:Array = [0, 127.5, 255];
+		private static var colors:Array = [];
 	}
-
-	override public function getExplicitOrMeasuredHeight():Number
-	{
-		return 20;
-	}
-
-    override protected function measure():void
-    {
-		// !! should use graphic width/height here instead of 70/20
-        hostComponent.measuredWidth = Math.max(70, textField.textWidth + 20);
-        hostComponent.measuredHeight = 20;
-    }
-
-    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
-    {
-        // Show the graphic
-        bgImg.x = bgImg.y = 0.5;
-        bgImg.width = unscaledWidth;
-		bgImg.height = unscaledHeight;
-
-        // Center the label
-        textField.width = unscaledWidth;
-        textField.height = textField.textHeight + 4;
-        textField.y = Math.round((unscaledHeight - textField.height) / 2) + 1;
-
-        // Put the label on top
-        setChildIndex(textField, numChildren - 1);
-    }
-
-    //////////////////////////////////////////
-    // Internals
-    //////////////////////////////////////////
-
-    private var textField:TextField;
-    private var bgImg:DisplayObject;
-}
 }


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

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

--- frameworks/projects/advancedgrids/src/mx/controls/olapDataGridClasses/OLAPDataGridItemRendererProvider.as
+++ frameworks/projects/advancedgrids/src/mx/controls/olapDataGridClasses/OLAPDataGridItemRendererProvider.as
@@ -0,0 +1,80 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.controls.olapDataGridClasses
+{
+
+import mx.formatters.Formatter;
+
+/**
+ *  An OLAPDataGridItemRendererProvider instance lets you specify a formatter
+ *  for the items in the OLAPDataGrid control.
+ *
+ *  @see mx.controls.OLAPDataGrid
+ *  @see mx.formatters.Formatter
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class OLAPDataGridItemRendererProvider extends OLAPDataGridRendererProvider
+{
+	include "../../core/Version.as";
+
+	//--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    // formatter
+    //----------------------------------
+
+    /**
+     *  An instance of the Formatter class, or of a subclass of the Formatter class,
+     *  applied to the text to of the associated IOLAPElement.
+     *
+     *
For example, you apply a CurrencyFormatter formatter to an OLAPDataGrid control,
+     *  as the following example shows:

+     *
+     *

+     *  <mx:CurrencyFormatter id="usdFormatter" precision="2"
+     *      currencySymbol="$" decimalSeparatorFrom="."
+     *      decimalSeparatorTo="." useNegativeSign="true"
+     *      useThousandsSeparator="true" alignSymbol="left"/>
+     *
+     *  ...
+     *
+     *  <mx:OLAPDataGrid id="myOLAPDG"
+     *      width="100%" height="100%">
+     *
+     *      <mx:itemRendererProviders>
+     *          <mx:OLAPDataGridItemRendererProvider
+     *              uniqueName="[QuarterDim].[Quarter]"
+     *              type="{OLAPDataGrid.OLAP_HIERARCHY}"
+     *              formatter="{usdFormatter}"/>
+     *      </mx:itemRendererProviders>
+     *  </mx:OLAPDataGrid>

+     *
+     *
In this example, the uniqueName and type properties
+     *  specify that Quarter is a hierarchy of the QuarterDim dimension.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+     public var formatter:Formatter
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

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

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

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

 package mx.automation.delegates.controls
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 9895
Author:   gosmith@adobe.com
Date:     2009-09-02T01:02:10.461118Z

Log Message:
-----------
Rewrote TLFTextField.

It previously used a TLF StringTextLineFactory to implement the 'text' property; it now uses FTE directly, similar to SimpleText.

In addition, it now uses TLF's HTML importer and exporter to implement the 'htmlText' property. (Until TLF changes its HTML support to be more like the quirky HTML in TextField, getting 'htmlText' won't necessarily give you what you expect.) It renders the TextFlow produced from the htmlText by using TLF's TextContainerManager, rather than a TextFlowTextLineFactory, in order to support clickable hyperlinks and URL-loaded images.

TLFTextField does not, and will not, support scrolling, selection, editing, or setting a text format on a range with setTextFormat(). It is intended for use only in those Halo components that don't require this functionality.

A number of methods not called by the Halo components for which TLFTextField is intended have also been left unimplemented.

Since we are planning to move TLFTextField from TLF to Flex, I haven't bothered to put this code into the TLF depot. If we integrate another TLF before TLFTextField gets removed from TLF, please don't clobber this version with the older version.

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/SparkClasses.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_textField/src/flashx/textLayout/controls/TLFTextField.as</path>

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

--- frameworks/projects/spark/src/SparkClasses.as
+++ frameworks/projects/spark/src/SparkClasses.as
@@ -23,9 +23,9 @@
  *  For example, Button does not have a reference to ButtonSkin,
  *  but ButtonSkin needs to be in framework.swc along with Button.
  */
+import mx.controls.dataGridClasses.TLFDataGridItemRenderer; TLFDataGridItemRenderer;
+import mx.controls.TLFTextInput; TLFTextInput;
 import mx.core.UITLFTextField; UITLFTextField;
-import mx.controls.dataGridClasses.TLFDataGridItemRenderer; TLFDataGridItemRenderer ;
-
 import spark.core.SpriteVisualElement; SpriteVisualElement;
 import spark.skins.spark.ApplicationSkin; ApplicationSkin;
 import spark.skins.spark.BorderSkin; BorderSkin;


Transferred from the Adobe Open Source Subversion Repository

Revision: 21926
Author:   ksimm@adobe.com
Date:     2011-08-10T23:27:21.215704Z

Log Message:
-----------
1) Add the function to find the longest width year
2) Add three helper classes for DateSpinner.
3) Add the error messages for the new class OnDemandDataProvider
4) Add OnDemandDataProvider to SparkClass

QE notes: No
Doc notes: No
Bugs: No
Reviewer: Tom Kraikit
Tests run: Mustella-mobile
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/collections/OnDemandDataProvider.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/DateAndTimeRangeList.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/SparkClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/framework/bundles/en_US/collections.properties</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/DateAndTimeProvider.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/YearProvider.as</path>

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

--- frameworks/projects/spark/src/SparkClasses.as
+++ frameworks/projects/spark/src/SparkClasses.as
@@ -30,6 +30,7 @@
 import spark.core.IDisplayText; IDisplayText;
 import spark.core.IEditableText; IEditableText;
 import spark.core.SpriteVisualElement; SpriteVisualElement;
+import spark.collections.OnDemandDataProvider; OnDemandDataProvider;
 import spark.components.IconPlacement; IconPlacement;
 import spark.components.gridClasses.CellPosition; CellPosition;
 import spark.components.gridClasses.CellRegion; CellRegion;


Surely a property should not be called as a function..

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

--- src/org/igniterealtime/xiff/vcard/VCard.as
+++ src/org/igniterealtime/xiff/vcard/VCard.as
@@ -325,7 +325,7 @@
 				} );
 			}

-			var bareJID:String = user.jid.bareJID();
+			var bareJID:String = user.jid.bareJID;

 			var cachedCard:VCard = cache[ bareJID ] as VCard;
 			if ( cachedCard )
@@ -393,7 +393,7 @@
 		 */
 		public function _vCardSent( resultIQ:IQ ):void
 		{
-			var bareJID:String = resultIQ.to.unescaped.bareJID();
+			var bareJID:String = resultIQ.to.unescaped.bareJID;
 			if ( resultIQ.type == IQ.TYPE_ERROR )
 			{
 				dispatchEvent( new VCardEvent( VCardEvent.ERROR, cache[ bareJID ],


synthesize a filename and implement the "starting line number" param when compiling

--- axscript/mscom.as
+++ axscript/mscom.as
@@ -35,7 +35,7 @@
  * ***** END LICENSE BLOCK ***** */

 // hackery - for now, this file is "built" via:
-// % java -ea -DAS3 -Xmx200m -DAVMPLUS -classpath ../utils/asc.jar macromedia.asc.embedding.ScriptCompiler -abcfuture -builtin -import ../core/builtin.abc -import ../esc/bin/parse.es.abc -import ../esc/bin/cogen.es.abc -out axtoplevel mscom.as Domain.as ../shell/ByteArray.as && move /y ..\shell\axtoplevel.* .
+// % java -ea -DAS3 -Xmx200m -DAVMPLUS -classpath ../utils/asc.jar macromedia.asc.embedding.ScriptCompiler -abcfuture -builtin -import ../core/builtin.abc -import ../esc/bin/parse.es.abc -import ../esc/bin/cogen.es.abc -import ../esc/bin/ast.es.abc -out axtoplevel mscom.as Domain.as ../shell/ByteArray.as && move /y ..\shell\axtoplevel.* .

 package axtam
 {
@@ -215,14 +215,19 @@

     import flash.utils.*; // for our ByteArray clone - either it should die, or we rename the package in our clone!

-    public function compileString(str): ByteArray
+    public function compileString(str, fname:String = null, startLineNumber:int = 0): ByteArray
     {
         import Parse.*;
+        import Lex.*;
+
         var top = []
         var parser = new Parse.Parser(str,top);
+        parser.scan.lnCoord = startLineNumber;
         var prog = parser.program();
         var ts = prog[0]
         var nd = prog[1]
+        if (fname)
+            nd.Ast::file = fname;
         var bytes = Gen::cg(nd).getBytes();

         var b = new ByteArray();
@@ -270,7 +275,9 @@
 			if (state==axtam.com.SCRIPTSTATE_UNINITIALIZED || state==axtam.com.SCRIPTSTATE_CLOSED || state==axtam.com.SCRIPTSTATE_DISCONNECTED)
 				axtam.com.Error.throwError(axtam.com.Error.E_FAIL)

-			var bytes = compileString(code)
+			// synthesize a filename
+			var fname:String = "<script " + sourceCookie + ">"
+			var bytes = compileString(code, fname, lineNumber)

 			var scriptBlock = {'code': code,
 			                   'bytes': bytes,


Transferred from the Adobe Open Source Subversion Repository

Revision: 16890
Author:   tkraikit@adobe.com
Date:     2010-07-12T22:14:28.756571Z

Log Message:
-----------
correcting check-in to use spaces instead of tabs for indentation

Modified Paths:
--------------
/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/DataGrid.as

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

--- frameworks/projects/mx/src/mx/controls/DataGrid.as
+++ frameworks/projects/mx/src/mx/controls/DataGrid.as
@@ -5054,7 +5054,7 @@
      */
     override public function itemToLabel(data:Object):String
     {
-		return _columns[sortIndex == -1 ? 0 : sortIndex].itemToLabel(data);
+        return _columns[sortIndex == -1 ? 0 : sortIndex].itemToLabel(data);
     }

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 18719
Author:   klin@adobe.com
Date:     2010-11-18T22:06:36.395894Z

Log Message:
-----------
Cleaned up TODOs and fixed some minor bugs.

GridDimensions.as, GridRowNode.as, Grid.as
-renamed insertValuesToVector to insertElementsToVector.
-renamed clear to clearHeights. clearHeights also doesn't reset rowCount anymore.
-optimized finding the max in GridRowNode a little.

GridColumn.as
-Invalidate the grid when headerRenderer changes. Removed the TODOs here because invalidating the Grid will cause IDataGridElements to be invalidated.
-Added Bindable metadata to rendererIsEditable.

(mx) DataGrid.as, FormItem.as, FormHeading.as
-Added Alternative metadata

QE notes: No
Doc notes: No
Bugs: SDK-27958
Reviewer: Hans, Carol
Tests run: cyclone server, checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Grid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridColumn.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridRowNode.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/containers/FormItem.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridColumnHeaderGroupLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/containers/FormHeading.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridDimensions.as</path>

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

--- frameworks/projects/mx/src/mx/controls/DataGrid.as
+++ frameworks/projects/mx/src/mx/controls/DataGrid.as
@@ -544,6 +544,8 @@
 [IconFile("DataGrid.png")]

 [RequiresDataBinding(true)]
+
+[Alternative(replacement="spark.components.DataGrid", since="4.5")]

 /**
  *  The DataGrid control is like a List except that it can


OPEN - issue REPRISE-20: Enable reparenting of components
http://j.fork.de:8080/browse/REPRISE-20

	- should work now

git-svn-id: e38e7cdd6ace00d8230583a2d3b43e9a55f5c011@559 bc4816be-ef27-423a-9c4d-fc420be121a2

--- src/reprise/ui/UIObject.as
+++ src/reprise/ui/UIObject.as
@@ -47,6 +47,7 @@
 		protected var m_isFirstChild : Boolean;
 		protected var m_isLastChild : Boolean;

+		protected var m_initialized : Boolean;
 		protected var m_firstDraw : Boolean;
 		protected var m_visible : Boolean = true;
 		protected var m_isRendered : Boolean;
@@ -119,7 +120,11 @@
 			m_parentElement = parent;
 			m_rootElement = parent.m_rootElement;

-			initialize();
+			if (!m_initialized)
+			{
+				initialize();
+			}
+			invalidate();

 			dispatchEvent(new DisplayEvent(DisplayEvent.ADDED_TO_DOCUMENT, true));

@@ -144,6 +149,14 @@
 			if (child is UIObject)
 			{
 				var element : UIObject = UIObject(child);
+				if (element.m_parentElement == this)
+				{
+					return element;
+				}
+				if (element.m_parentElement)
+				{
+					element.m_parentElement.unregisterChildView(element);
+				}
 				m_contentDisplay.addChildAt(
 					child, Math.min(m_contentDisplay.numChildren, index));
 				element.setParent(this);
@@ -716,6 +729,7 @@
 		***************************************************************************/
 		protected function initialize() : void
 		{
+			m_initialized = true;
 			name = m_elementType + '_' + g_elementIDCounter++;
 			m_delayedMethods = [];
 			createDisplayClips();
@@ -724,7 +738,6 @@
 			visible = false;
 			m_keyOrder = [];
 			createChildren();
-			invalidate();
 		}

 		/**


fixed CanvasButton to work in more scenarios (ie as header renderer in Accordion)

--- src/flexlib/controls/CanvasButton.as
+++ src/flexlib/controls/CanvasButton.as
@@ -30,6 +30,10 @@
 	import mx.core.UIComponent;
 	import mx.core.UIComponentDescriptor;
 	import mx.core.mx_internal;
+	import mx.managers.IFocusManagerContainer;
+	import mx.core.IRawChildrenContainer;
+	import mx.core.IDataRenderer;
+	import flash.display.DisplayObject;

 	use namespace mx_internal;

@@ -66,18 +70,26 @@

 		public function CanvasButton():void {
 			super();
+
+
 		}
+
+		private var _childrenCreated:Boolean = false;

 		override protected function createChildren():void {
 			super.createChildren();

 			//create our canvas and add it to the display list
 			canvas = new Canvas();
-			addChild(canvas);
+			super.addChild(canvas);

 			//if child components have been specified in MXML then we need
 			//to add them all now
 			createComponents();
+
+			mouseChildren = true;
+
+			_childrenCreated = true;
 		}

@@ -126,13 +138,25 @@
 		 * the childDescriptors property with UIComponentDescriptor objects. These are used to create
 		 * the child components that are set in MXML.
 		 */
+
 		public function set childDescriptors(value:Array):void {
 			_childDescriptors = value;
+		}
+
+		mx_internal function setDocumentDescriptor(desc:UIComponentDescriptor):void {

-			// I don't know if createChildren can ever be called before the childDescriptors are set,
-			// I doubt it, but just in case we see if canvas has been created and set the children if so
-			if(canvas)
-				createComponents();
+			if (_documentDescriptor && _documentDescriptor.properties.childDescriptors) {
+            	if (desc.properties.childDescriptors) {
+                	throw new Error("Multiple sets of visual children have been specified for this component (base component definition and derived component definition).");
+				}
+			} else {
+				_documentDescriptor = desc;
+				_documentDescriptor.document = this;
+			}
+
+            if(desc.properties.childDescriptors) {
+				this.childDescriptors = desc.properties.childDescriptors;
+			}
 		}

 		/**
@@ -146,5 +170,8 @@
 				canvas.createComponentFromDescriptor(desc, true);
 			}
 		}
+
+
+
 	}
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

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

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

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

 package mx.automation.delegates.advancedDataGrid
 {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package mx.automation.delegates.advancedDataGrid
 {


update

update

--- src/model/JSFLProxy.as
+++ src/model/JSFLProxy.as
@@ -377,7 +377,7 @@
 		/**
 		 * Get armature data by name
 		 */
-		public function generateArmature(armatureName:String, mergeLayersInFolder:Boolean):void
+		public function generateArmature(armatureName:String, mergeLayersInFolder:Boolean = false):void
 		{
 			runJSFLMethod(GENERATE_ARMATURE, "dragonBones.generateArmature", armatureName, false, true, mergeLayersInFolder);
 		}


Transferred from the Adobe Open Source Subversion Repository

Revision: 8
Author:   open-source-svn-admin@adobe.com
Date:     2007-12-15T01:49:31.087529Z

Log Message:
-----------
The beginning of the open-source Flex SDK.

Populated the flex/sdk/trunk directory with an open-source subset of files from //depot/flex/sdk/...@191097 in the Faramir Perforce server. This changelist is a bit past the 3.0rc0 build.

The Ant scripts will not successfully build yet. They need to be adapted to the open-source subset.

Modified Paths:
--------------
2532 paths were modified

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

--- frameworks/projects/framework/src/mx/core/FlexApplicationBootstrap.as
+++ frameworks/projects/framework/src/mx/core/FlexApplicationBootstrap.as
@@ -0,0 +1,69 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2006-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.core
+{
+
+import flash.display.DisplayObject;
+import flash.events.Event;
+import mx.events.FlexEvent;
+
+[ExcludeClass]
+
+/**
+ *  @private
+ */
+public class FlexApplicationBootstrap extends FlexModuleFactory
+{
+	include "../core/Version.as";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+    /**
+	 *  Constructor.
+	 */
+	public function FlexApplicationBootstrap()
+    {
+        // Register for "ready" first, because we may already be ready.
+		addEventListener("ready", readyHandler);
+
+		super();
+    }
+
+	//--------------------------------------------------------------------------
+	//
+	//  Event handlers
+	//
+	//--------------------------------------------------------------------------
+
+    /**
+	 *  @private
+	 */
+    public function readyHandler(event:Event):void
+    {
+        removeEventListener("ready", readyHandler);
+
+		var o:Object = create();
+
+		if (o is DisplayObject)
+		{
+            addChild(DisplayObject(o));
+		    o.dispatchEvent(new FlexEvent(FlexEvent.APPLICATION_COMPLETE));
+		}
+
+    }
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 3385
Author:   mhorn@adobe.com
Date:     2008-09-26T19:26:26.852683Z

Log Message:
-----------
minor asdoc bug fixes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/ILayoutManagerClient.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/VideoDisplay.as</path>

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

--- frameworks/projects/framework/src/mx/managers/ILayoutManagerClient.as
+++ frameworks/projects/framework/src/mx/managers/ILayoutManagerClient.as
@@ -41,123 +41,123 @@
  */
 public interface ILayoutManagerClient extends IEventDispatcher
 {
-	//--------------------------------------------------------------------------
-	//
-	//  Properties
-	//
-	//--------------------------------------------------------------------------
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------

-	//----------------------------------
-	//  initialized
-	//----------------------------------
+    //----------------------------------
+    //  initialized
+    //----------------------------------

-	/**
-	 *  A flag that determines if an object has been through all three phases
-	 *  of layout validation (provided that any were required)
-	 *  This flag should only be modified by the LayoutManager.
-	 */
-	function get initialized():Boolean;
-
-	/**
-	 *  @private
-	 */
-	function set initialized(value:Boolean):void;
+    /**
+     *  A flag that determines if an object has been through all three phases
+     *  of layout validation (provided that any were required)
+     *  This flag should only be modified by the LayoutManager.
+     */
+    function get initialized():Boolean;
+
+    /**
+     *  @private
+     */
+    function set initialized(value:Boolean):void;

-	//----------------------------------
-	//  nestLevel
-	//----------------------------------
+    //----------------------------------
+    //  nestLevel
+    //----------------------------------

-	/**
-	 *  The top-level SystemManager has a nestLevel of 1.
-	 *  Its immediate children (the top-level Application and any pop-up
-	 *  windows) have a nestLevel of 2.
-	 *  Their children have a nestLevel of 3, and so on.
-	 *
-	 *  The nestLevel is used to sort ILayoutManagerClients
-	 *  during the measurement and layout phases.
-	 *  During the commit phase, the LayoutManager commits properties on clients
-	 *  in order of decreasing nestLevel, so that an object's
-	 *  children have already had their properties committed before Flex
-	 *  commits properties on the object itself.
-	 *  During the measurement phase, the LayoutManager measures clients
-	 *  in order of decreasing nestLevel, so that an object's
-	 *  children have already been measured before Flex measures
-	 *  the object itself.
-	 *  During the layout phase, the LayoutManager lays out clients
-	 *  in order of increasing nestLevel, so that an object
-	 *  has a chance to set the sizes of its children before the child
-	 *  objects are asked to position and size their children.
-	 */
-	function get nestLevel():int;
-
-	/**
-	 *  @private
-	 */
-	function set nestLevel(value:int):void;
+    /**
+     *  The top-level SystemManager has a nestLevel of 1.
+     *  Its immediate children (the top-level Application and any pop-up
+     *  windows) have a nestLevel of 2.
+     *  Their children have a nestLevel of 3, and so on.
+     *
+     *  The nestLevel is used to sort ILayoutManagerClients
+     *  during the measurement and layout phases.
+     *  During the commit phase, the LayoutManager commits properties on clients
+     *  in order of increasing nestLevel, so that an object's
+     *  children have already had their properties committed before Flex
+     *  commits properties on the object itself.
+     *  During the measurement phase, the LayoutManager measures clients
+     *  in order of decreasing nestLevel, so that an object's
+     *  children have already been measured before Flex measures
+     *  the object itself.
+     *  During the layout phase, the LayoutManager lays out clients
+     *  in order of increasing nestLevel, so that an object
+     *  has a chance to set the sizes of its children before the child
+     *  objects are asked to position and size their children.
+     */
+    function get nestLevel():int;
+
+    /**
+     *  @private
+     */
+    function set nestLevel(value:int):void;

-	//----------------------------------
-	//  processedDescriptors
-	//----------------------------------
+    //----------------------------------
+    //  processedDescriptors
+    //----------------------------------

-	/**
+    /**
      *  @copy mx.core.UIComponent#processedDescriptors
-	 */
-	function get processedDescriptors():Boolean;
-
-	/**
-	 *  @private
-	 */
-	function set processedDescriptors(value:Boolean):void;
+     */
+    function get processedDescriptors():Boolean;
+
+    /**
+     *  @private
+     */
+    function set processedDescriptors(value:Boolean):void;

-	//----------------------------------
-	//  updateCompletePendingFlag
-	//----------------------------------
+    //----------------------------------
+    //  updateCompletePendingFlag
+    //----------------------------------

-	/**
-	 *  A flag that determines if an object is waiting to have its
-	 *  updateComplete event dispatched.
-	 *  This flag should only be modified by the LayoutManager.
-	 */
-	function get updateCompletePendingFlag():Boolean;
-
-	/**
-	 *  @private
-	 */
-	function set updateCompletePendingFlag(value:Boolean):void;
+    /**
+     *  A flag that determines if an object is waiting to have its
+     *  updateComplete event dispatched.
+     *  This flag should only be modified by the LayoutManager.
+     */
+    function get updateCompletePendingFlag():Boolean;
+
+    /**
+     *  @private
+     */
+    function set updateCompletePendingFlag(value:Boolean):void;

-	//--------------------------------------------------------------------------
-	//
-	//  Methods
-	//
-	//--------------------------------------------------------------------------
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------

-	/**
-	 *  Validates the properties of a component.
-	 *  If the LayoutManager.invalidateProperties() method is called with
-	 *  this ILayoutManagerClient, then the validateProperties() method
-	 *  is called when it's time to commit property values.
-	 */
-	function validateProperties():void;
-
-	/**
-	 *  Validates the measured size of the component
-	 *  If the LayoutManager.invalidateSize() method is called with
-	 *  this ILayoutManagerClient, then the validateSize() method
-	 *  is called when it's time to do measurements.
-	 *
-	 *  @param recursive If true, call this method
-	 *  on the objects children.
-	 */
-	function validateSize(recursive:Boolean = false):void;
-
-	/**
-	 *  Validates the position and size of children and draws other
-	 *  visuals.
-	 *  If the LayoutManager.invalidateDisplayList() method is called with
-	 *  this ILayoutManagerClient, then the validateDisplayList() method
-	 *  is called when it's time to update the display list.
-	 */
-	function validateDisplayList():void;
+    /**
+     *  Validates the properties of a component.
+     *  If the LayoutManager.invalidateProperties() method is called with
+     *  this ILayoutManagerClient, then the validateProperties() method
+     *  is called when it's time to commit property values.
+     */
+    function validateProperties():void;
+
+    /**
+     *  Validates the measured size of the component
+     *  If the LayoutManager.invalidateSize() method is called with
+     *  this ILayoutManagerClient, then the validateSize() method
+     *  is called when it's time to do measurements.
+     *
+     *  @param recursive If true, call this method
+     *  on the objects children.
+     */
+    function validateSize(recursive:Boolean = false):void;
+
+    /**
+     *  Validates the position and size of children and draws other
+     *  visuals.
+     *  If the LayoutManager.invalidateDisplayList() method is called with
+     *  this ILayoutManagerClient, then the validateDisplayList() method
+     *  is called when it's time to update the display list.
+     */
+    function validateDisplayList():void;
 }

 }


added try/finally when keeping track of recursion

--- WeaveData/src/weave/primitives/WeaveTreeItem.as
+++ WeaveData/src/weave/primitives/WeaveTreeItem.as
@@ -125,29 +125,34 @@
 		{
 			if (!_recursion[recursionName])
 			{
-				_recursion[recursionName] = true;
-
-				if (isSimpleObject(param, 'not'))
-					param = !getBoolean(param['not'], "not_" + recursionName);
-				if (isSimpleObject(param, 'or'))
-					param = getBoolean(param['or'], "or_" + recursionName);
-				if (param is Function)
-					param = evalFunction(param as Function);
-				if (param is ILinkableVariable)
-					param = (param as ILinkableVariable).getSessionState();
-				if (param is Array)
-				{
-					var breakValue:Boolean = recursionName.indexOf("or_") == 0;
-					for each (param in param)
+				try
+				{
+					_recursion[recursionName] = true;
+
+					if (isSimpleObject(param, 'not'))
+						param = !getBoolean(param['not'], "not_" + recursionName);
+					if (isSimpleObject(param, 'or'))
+						param = getBoolean(param['or'], "or_" + recursionName);
+					if (param is Function)
+						param = evalFunction(param as Function);
+					if (param is ILinkableVariable)
+						param = (param as ILinkableVariable).getSessionState();
+					if (param is Array)
 					{
-						param = getBoolean(param, "item_" + recursionName);
-						if (param ? breakValue : !breakValue)
-							break;
+						var breakValue:Boolean = recursionName.indexOf("or_") == 0;
+						for each (param in param)
+						{
+							param = getBoolean(param, "item_" + recursionName);
+							if (param ? breakValue : !breakValue)
+								break;
+						}
 					}
-				}
-				param = param ? true : false;
-
-				_recursion[recursionName] = false;
+					param = param ? true : false;
+				}
+				finally
+				{
+					_recursion[recursionName] = false;
+				}
 			}
 			return param;
 		}
@@ -184,14 +189,19 @@
 		{
 			if (!_recursion[recursionName])
 			{
-				_recursion[recursionName] = true;
-
-				if (param is Function)
-					param = evalFunction(param as Function);
-				else
-					param = param || '';
-
-				_recursion[recursionName] = false;
+				try
+				{
+					_recursion[recursionName] = true;
+
+					if (param is Function)
+						param = evalFunction(param as Function);
+					else
+						param = param || '';
+				}
+				finally
+				{
+					_recursion[recursionName] = false;
+				}
 			}
 			return param;
 		}
@@ -206,12 +216,17 @@
 		{
 			if (!_recursion[recursionName])
 			{
-				_recursion[recursionName] = true;
-
-				if (param is Function)
-					param = evalFunction(param as Function);
-
-				_recursion[recursionName] = false;
+				try
+				{
+					_recursion[recursionName] = true;
+
+					if (param is Function)
+						param = evalFunction(param as Function);
+				}
+				finally
+				{
+					_recursion[recursionName] = false;
+				}
 			}
 			return param;
 		}


Added two World.updateLists() calls when switching Worlds, so entity lists are updated immediately before and after World.begin() is called.

--- net/flashpunk/Engine.as
+++ net/flashpunk/Engine.as
@@ -225,7 +225,9 @@
 			if (FP._world && FP._world.autoClear && FP._world._tween) FP._world.clearTweens();
 			FP._world = FP._goto;
 			FP._goto = null;
+			FP._world.updateLists();
 			FP._world.begin();
+			FP._world.updateLists();
 			FP.cleanup();
 		}


Added parseURLs().

Added parseURLs().

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

--- src/as/com/threerings/util/StringUtil.as
+++ src/as/com/threerings/util/StringUtil.as
@@ -146,6 +146,31 @@
     }

     /**
+     * Locate URLs in a string, return an array in which even elements
+     * are plain text, odd elements are urls (as Strings). Any even element
+     * may be an empty string.
+     */
+    public static function parseURLs (s :String) :Array
+    {
+        var array :Array = [];
+        while (true) {
+            var result :Object = URL_REGEXP.exec(s);
+            if (result == null) {
+                break;
+            }
+
+            var index :int = int(result.index);
+            var url :String = String(result[0]);
+            array.push(s.substring(0, index), url);
+            s = s.substring(index + url.length);
+        }
+
+        // just the string is left
+        array.push(s);
+        return array;
+    }
+
+    /**
      * Generates a string from the supplied bytes that is the hex encoded
      * representation of those byts. Returns the empty String for a
      * null or empty byte array.
@@ -188,5 +213,9 @@
     /** Hexidecimal digits. */
     protected static const HEX :Array = [ "0", "1", "2", "3", "4",
         "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" ];
+
+    /** A regular expression that finds URLs. */
+    protected static const URL_REGEXP :RegExp =
+        new RegExp("(http|https|ftp)://\\S+");
 }
 }


fixed MaterialGroup textures initialization

--- src/aerys/minko/scene/node/group/MaterialGroup.as
+++ src/aerys/minko/scene/node/group/MaterialGroup.as
@@ -34,11 +34,17 @@
 			_textures.dispatchEvent(new Event(Event.ADDED));
 		}

-		public function MaterialGroup(effect : IRenderingEffect, ...children)
+		public function MaterialGroup(effect : IRenderingEffect, ...textures)
 		{
-			super(children);
+			super();

+			initialize(effect, textures);
+		}
+
+		private function initialize(effect : IRenderingEffect, textures : Array) : void
+		{
 			_effect = effect;
+			_textures = new Group(textures);

 			actions.unshift(MaterialGroupAction.materialGroupAction,
 							new PushEffectAction());


Added ExternalInterface call to report AS test results.

--- flash/org/windmill/astest/ASTest.as
+++ flash/org/windmill/astest/ASTest.as
@@ -17,6 +17,7 @@
 package org.windmill.astest {
   import org.windmill.WMLogger;
   import flash.utils.*;
+  import flash.external.ExternalInterface;

   public class ASTest {
     public static var testClassList:Array = [];
@@ -55,13 +56,23 @@
       }
       else {
         var test:Object = ASTest.testList.shift();
+        var res:*;
+        WMLogger.log('Running ' + test.className + '.' + test.methodName + ' ...');
         try {
-          WMLogger.log('Running ' + test.className + '.' + test.methodName);
           test.instance[test.methodName].call(test.instance);
-          WMLogger.log('SUCCESS');
+          res = ExternalInterface.call('wm_asTestResult', {
+            className: test.className,
+            methodName: test.methodName
+          });
+          if (!res) {
+            WMLogger.log('SUCCESS');
+          }
         }
         catch (e:Error) {
-          WMLogger.log('ERROR: ' + e.message);
+          res = ExternalInterface.call('wm_asTestResult', e);
+          if (!res) {
+            WMLogger.log('FAILURE: ' + e.message);
+          }
         }
         setTimeout(function ():void {
           ASTest.runNextTest.call(ASTest);
@@ -113,7 +124,6 @@
         // it contains in the defined order
         var key:String;
         if ('order' in item.instance) {
-          WMLogger.log('ordering ...');
           for each (key in item.instance.order) {
             currTestList.push(createTestItem(methods[key], key));
             delete methods[key];


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

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

--- frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkButtonBarButtonAutomationImpl.as
+++ frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkButtonBarButtonAutomationImpl.as
@@ -0,0 +1,65 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package spark.automation.delegates.components
+{
+	import flash.display.DisplayObject;
+
+	import mx.automation.Automation;
+	import mx.core.mx_internal;
+
+	import spark.components.ButtonBarButton;
+
+	use namespace mx_internal;
+
+	[Mixin]
+	/**
+	 *
+	 *  Defines methods and properties required to perform instrumentation for the
+	 *  ButtonBarButton control.
+	 *
+	 *  @see spark.components.ButtonBarButton
+	 *
+	 */
+	public class SparkButtonBarButtonAutomationImpl extends SparkToggleButtonAutomationImpl
+	{
+
+		include "../../../core/Version.as";
+		//--------------------------------------------------------------------------
+		//
+		//  Class methods
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Registers the delegate class for a component class with automation manager.
+		 *
+		 *  @param root The SystemManger of the application.
+		 */
+		public static function init(root:DisplayObject):void
+		{
+			Automation.registerDelegateClass(spark.components.ButtonBarButton, SparkButtonBarButtonAutomationImpl);
+		}
+
+		/**
+		 *  Constructor.
+		 * @param obj ButtonBarButton object to be automated.
+		 */
+		public function SparkButtonBarButtonAutomationImpl(obj:spark.components.ButtonBarButton)
+		{
+			super(obj);
+
+    }
+
+
+}
+
+}


remove unused code.

remove unused code.

--- source/fairygui/GMovieClip.as
+++ source/fairygui/GMovieClip.as
@@ -11,8 +11,7 @@
 		private var _movieClip: MovieClip;

 		public function GMovieClip() {
-			super();
-			this._sizeImplType = 1;
+			super();
 		}

 		public function get color(): String {
@@ -96,7 +95,6 @@
 			_movieClip.swing = this.packageItem.swing;
 			_movieClip.repeatDelay = this.packageItem.repeatDelay;
 			_movieClip.frames = this.packageItem.frames;
-			_movieClip.boundsRect = new Rectangle(0, 0, this.sourceWidth, this.sourceHeight);
 		}

 		override public function setup_beforeAdd(buffer:ByteBuffer, beginPos:int): void {


Allow for collections with IDs to be shared, rather than copying elements

--- as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
+++ as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
@@ -329,6 +329,8 @@
             // do we have this already
             if (resultID)
                 result = objectFactory.getObjectForId(resultID);
+            if (result)
+                trace("found existing ID "+resultID);
         }

         // now look up type info if available
@@ -1002,10 +1004,19 @@
                 }
                 else
                 {
-                    value = toCollection(value);
-                    for each (var v1:* in value)
-                    {
-                        XObjUtils.addItemIfAbsent(existing, v1);
+                    // are they type equivalent?
+                    if (value is XObjUtils.classOf(existing))
+                    {
+                        // use the new collection, repalcing the old
+                        existing = value;
+                    }
+                    else
+                    {
+                        value = toCollection(value);
+                        for each (var v1:* in value)
+                        {
+                            XObjUtils.addItemIfAbsent(existing, v1);
+                        }
                     }
                 }
             }


Hack around for sending both ID and HREF during encoding to support older server semantics

--- as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as
+++ as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as
@@ -561,6 +561,11 @@
             attrList.push({propname:"id"});
         }

+        // double up on HREF as well as ID as workaround for old servers
+        if (("href" in obj) && obj["href"] && ("isByReference" in obj) && obj["isByReference"])
+        {
+            attrList.push({propname:"href"});
+        }

         if (attrList.length > 0)
         {
@@ -626,7 +631,7 @@
                     try
                     {
                         // skip anything other than ID if requested
-                        if (idOnly && attr.propname != "id")
+                        if (idOnly && attr.propname != "id" && attr.propname != "href")
                             continue;

                         attributes[name] = attrSource[attr.propname];


Remove non-applicable display level parsing.

--- src/com/esri/viewer/managers/ConfigManager.as
+++ src/com/esri/viewer/managers/ConfigManager.as
@@ -1186,10 +1186,6 @@
                     visible={veLyr.visible}
                     alpha={veLyr.alpha}
                     style={veLyr.mapStyle}/>;
-            if (veLyr.displayLevels)
-            {
-                lyrXML.@displaylevels = veLyr.displayLevels.join();
-            }
         }
         else if (layer is WebTiledLayer)
         {
@@ -1202,10 +1198,6 @@
             if (webTiledLayer.copyright)
             {
                 lyrXML.@copyright = webTiledLayer.copyright;
-            }
-            if (webTiledLayer.displayLevels)
-            {
-                lyrXML.@displaylevels = webTiledLayer.displayLevels.join();
             }
             if (webTiledLayer.subDomains)
             {


box2d version number fix

box2d version number fix

--- Box2DFlexLib/src/Box2D/utilities/Version.as
+++ Box2DFlexLib/src/Box2D/utilities/Version.as
@@ -2,7 +2,7 @@
 {
 	public class Version
 	{
-		public static const Box2d:String = "2.1 Rev158";
+		public static const Box2d:String = "2.0.1 Rev158";
 		public static const Box2dFlexLib:String = "0.2";
 	}
 }


Fix 557611  - Introduce a 'tweaks' system (r=edwsmith)

--- core/avmfeatures.as
+++ core/avmfeatures.as
@@ -53,8 +53,10 @@

        features           ::= "<features>" feature* at-least-one* at-most-one* exactly-one* "</features>"
        feature            ::= "<feature>" desc name defines+ precludes* requires* "</feature>"
+                            | "<tweak>" desc name default defines+ precludes* requires* "</tweak>"
        desc               ::= "<desc>" TEXT "</desc>"
        name               ::= "<name>" TEXT "</name>"
+       default            ::= "<default> "true" | "false" "</default>"
        defines            ::= "<defines>" TEXT "</defines>"
        precludes          ::= "<precludes>" TEXT "</precludes>"
        requires           ::= "<requires>" TEXT | at-most-one | at-least-one | exactly-one "</requires>"
@@ -80,6 +82,12 @@
          NOTE: A good description is absolutely essential.  It should
          state what the feature does, but also what the implications of
          selecting or deselecting it might be.
+
+       A TWEAK clause defines a named feature with a default value, which
+       provides an opportunity for workarounds for bugs and other very
+       minor issues.  TWEAKs should be used sparingly (and if they are
+       abused because it's convenient to introduce default values then
+       the default value facility will be removed).

        No two FEATUREs may name the same feature.

@@ -602,6 +610,8 @@
     <defines> VMCFG_TEST_API_VERSIONING </defines>
   </feature>

+  <!-- VM adjustments for various oddities: AVMTWEAK_* -->
+
 </features>;

 /****************************************************************************
@@ -626,12 +636,21 @@
     for each ( feature in FEATURES.feature )
         s += undefDefines(feature);
     s += "\n";
+    for each ( feature in FEATURES.tweak )
+        s += undefDefines(feature);
+    s += "\n";
     for each ( feature in FEATURES.feature )
         s += testDefined(feature);
     s += "\n";
+    for each ( feature in FEATURES.tweak )
+        s += testDefined(feature);
+    s += "\n";
     for each ( feature in FEATURES.feature )
         s += checkRequirements(feature);
     s += "\n";
+    for each ( feature in FEATURES.tweak )
+        s += checkRequirements(feature);
+    s += "\n";
     for each ( x in FEATURES["at-least-one"] )
         s += atLeastOne(x);
     s += "\n";
@@ -642,6 +661,9 @@
         s += exactlyOne(x);
     s += "\n";
     for each ( feature in FEATURES.feature )
+        s += defineResults(feature);
+    s += "\n";
+    for each ( feature in FEATURES.tweak )
         s += defineResults(feature);
     s += "\n";
     s += "#ifdef AVMSHELL_BUILD\n";
@@ -661,6 +683,8 @@
     s += "const char * const avmfeatures = \"\"\n"
     for each ( feature in FEATURES.feature )
         s += showFeature(feature);
+    for each ( feature in FEATURES.tweak )
+        s += showFeature(feature);
     s += ";\n\n"
     s += "#endif // AVMSHELL_BUILD\n";
     print('writing avmfeatures.cpp');
@@ -673,6 +697,8 @@
     s += "def featureSettings(o):\n";
     s += "    args = \"\"\n";
     for each ( feature in FEATURES.feature )
+        s += configureFeature(feature);
+    for each ( feature in FEATURES.tweak )
         s += configureFeature(feature);
     s += "    return args\n";

@@ -758,9 +784,23 @@
     s.push("");
     s.push("");
     s.push("/* " + name + "\n *\n" + formatFeature(feature) + "\n */");
-    s.push("#if !defined " + name + " || " + name + " != 0 && " + name + " != 1");
-    s.push("#  error \"" + name + " must be defined and 0 or 1 (only).\"");
-    s.push("#endif");
+    if (feature.name() == "tweak") {
+        s.push("#if !defined " + name);
+        if (feature.default.length() == 0)
+            fail("Tweak \"" + name + "\" is missing a 'default' clause.");
+	s.push("#  define " + name + " " + (feature["default"] == "true" ? 1 : 0));
+	s.push("#endif");
+        s.push("#if " + name + " != 0 && " + name + " != 1");
+	s.push("#  error \"" + name + " must be defined and 0 or 1 (only).\"");
+	s.push("#endif");
+    }
+    else {
+        if (feature.default.length() > 0)
+            fail("Feature \"" + name + "\" must not have a 'default' clause: " + feature.default);
+        s.push("#if !defined " + name + " || " + name + " != 0 && " + name + " != 1");
+	s.push("#  error \"" + name + " must be defined and 0 or 1 (only).\"");
+	s.push("#endif");
+    }
     return s.join("\n") + "\n";
 }

@@ -855,12 +895,18 @@
         return res;
     }

-    if (feature.name.indexOf("AVMFEATURE_") == 0) {
+    var len = 0;
+    if (feature.name.indexOf("AVMFEATURE_") == 0)
+        len = 11;
+    else if (feature.name.indexOf("AVMTWEAK_") == 0)
+        len = 9;
+
+    if (len > 0) {
         var enable = "-D" + feature.name + "=1 ";
         var disable = "-D" + feature.name + "=0 ";
         var dependent = complement(feature.name, FEATURES["at-most-one"]) +
                         complement(feature.name, FEATURES["exactly-one"]);
-        var feature = feature.name.substring(11).toLowerCase().replace(/_/g,"-");
+        var feature = feature.name.substring(len).toLowerCase().replace(/_/g,"-");

         // features without dependencies can be explicitly enabled or disabled
         if (dependent == "") {


Make setting Player.pause idempotent.

Make setting Player.pause idempotent.

--- src/goplayer/Player.as
+++ src/goplayer/Player.as
@@ -306,7 +306,7 @@

     public function set paused(value : Boolean) : void
     {
-      if (stream != null)
+      if (stream != null && _paused != value)
         _paused = value, stream.paused = value
     }


queue update

queue update

--- RNLib/src/rnlib/net/amf/RemoteAmfService.as
+++ RNLib/src/rnlib/net/amf/RemoteAmfService.as
@@ -250,7 +250,8 @@
 		public function set silentIgnoreErrors(value:Boolean):void
 		{
 			_silentIgnoreErrors = value;
-			if (value) registerErrorEvents(); else removeErrorEvents();
+			if (value) registerErrorEvents();
+			else removeErrorEvents();
 		}

 		/**
@@ -881,10 +882,12 @@
 						break;
 				}
 				return request;
-			} else if (hasProp)
+			}
+			else if (hasProp)
 			{
 				return super.callProperty.apply(null, [name].concat(rest));
-			} else
+			}
+			else
 			{
 				throw new Error("First add " + name + " to remote methods by addMethod function");
 			}
@@ -908,7 +911,8 @@
 		override flash_proxy function getProperty(name:*):*
 		{
 			if (_dynamicProperties[name])
-				return _dynamicProperties[name]; else if (_remoteMethods[name])
+				return _dynamicProperties[name];
+			else if (_remoteMethods[name])
 				return prepareDynamicFunctionForRemoteMethod(name);
 		}

@@ -934,7 +938,8 @@
 		override flash_proxy function hasProperty(name:*):Boolean
 		{
 			if (_defaultMethods.lastIndexOf(name) >= 0)
-				return true; else if (_dynamicProperties[name])
+				return true;
+			else if (_dynamicProperties[name])
 				return true;

 			return Boolean(_remoteMethods[name]);
@@ -995,8 +1000,10 @@
 		protected function concurrencyQueue(vo:MethodVO):void
 		{
 			if (_isPaused)
-				_queue.push(vo); else if (_isPendingRequest)
-				_queue.push(vo); else
+				_queue.push(vo);
+			else if (_isPendingRequest)
+				_queue.push(vo);
+			else
 				callAsyncRemoteMethod(vo);
 		}

@@ -1156,7 +1163,8 @@
 				rm.plugin = plugin;
 				rm.internalFaultHandler = onPluginFault;
 				rm.internalResultHandler = onPluginResult;
-			} else
+			}
+			else
 			{
 				rm.internalFaultHandler = onFault;
 				rm.internalResultHandler = onResult;
@@ -1198,7 +1206,8 @@
 				throw new ArgumentError("Mock method must return result as MockResponseVO object");

 			if (mockVO.interval == 0)
-				executeMockImpl(vo, mockVO); else
+				executeMockImpl(vo, mockVO);
+			else
 				setTimeout(executeMockImpl, mockVO.interval, vo, mockVO);

 			return true;
@@ -1213,7 +1222,8 @@
 		protected function executeMockImpl(vo:ResultMediatorVO, mock:MockResponseVO):void
 		{
 			if (mock.success)
-				onResult(mock.response, vo.name, vo.id, vo.uid); else
+				onResult(mock.response, vo.name, vo.id, vo.uid);
+			else
 				onFault(mock.response, vo.name, vo.id, vo.uid);
 		}

@@ -1227,7 +1237,7 @@
 		 */
 		protected function prepareResultMediator(vo:MethodVO):ResultMediatorVO
 		{
-			if(vo.isDisposed)
+			if (vo.isDisposed)
 				throw new ArgumentError("ResultMediatorVO can not be created based on disposed MethodVO");

 			var rm:ResultMediatorVO = new ResultMediatorVO();
@@ -1256,7 +1266,7 @@
 		protected function callFinalFault(vo:MethodVO, data:Object = null):void
 		{
 			// if any error handler already disposed MethodVO we can not call fault handler
-			if(vo.isDisposed)
+			if (vo.isDisposed)
 				return;

 			var rm:ResultMediatorVO = prepareResultMediator(vo);
@@ -1351,7 +1361,7 @@
 		 */
 		protected function disposePlugin(plugin:INetPlugin):void
 		{
-			if(!_plugins[plugin])
+			if (!_plugins[plugin])
 				return;

 			_plugins[plugin] = null;
@@ -1382,7 +1392,8 @@
 			{
 				plugin.addEventListener(NetPluginEvent.READY, onMultipartPluginReady, false, 0, true);
 				plugin.addEventListener(NetPluginEvent.COMPLETE, onMultipartPluginComplete, false, 0, true);
-			} else
+			}
+			else
 			{
 				plugin.addEventListener(NetPluginEvent.READY, onPluginComplete, false, 0, true);
 				plugin.addEventListener(NetPluginEvent.COMPLETE, onPluginComplete, false, 0, true);
@@ -1402,7 +1413,8 @@
 			{
 				plugin.removeEventListener(NetPluginEvent.READY, onMultipartPluginReady, false);
 				plugin.removeEventListener(NetPluginEvent.COMPLETE, onMultipartPluginComplete, false);
-			} else
+			}
+			else
 			{
 				plugin.removeEventListener(NetPluginEvent.READY, onPluginComplete, false);
 				plugin.removeEventListener(NetPluginEvent.COMPLETE, onPluginComplete, false);
@@ -1553,7 +1565,8 @@
 			{
 				if (vo.request.cacheTrigger == CacheRuleConstants.POLICY_AFTER_REQUEST && !cacheManager.isCached(cacheID))
 					cacheManager.setResponse(cacheID,
-							result); else if (vo.request.cacheTrigger == CacheRuleConstants.POLICY_BEFORE_REQUEST)
+											 result);
+				else if (vo.request.cacheTrigger == CacheRuleConstants.POLICY_BEFORE_REQUEST)
 					cacheManager.setResponse(cacheID, result);
 			}

@@ -1564,7 +1577,8 @@
 			}

 			if (vo.resultHandler != null)
-				vo.resultHandler.apply(null, res); else if (this.result != null)
+				vo.resultHandler.apply(null, res);
+			else if (this.result != null)
 				this.apply(null, res);

 			dispatchEvent(new AMFEvent(AMFEvent.RESULT, uid, res.length == 1 ? res.shift() : res));
@@ -1615,7 +1629,8 @@
 			}

 			if (vo.faultHandler != null)
-				vo.faultHandler.apply(null, res); else if (this.fault != null)
+				vo.faultHandler.apply(null, res);
+			else if (this.fault != null)
 				this.fault.apply(null, res);

 			dispatchEvent(new AMFEvent(AMFEvent.FAULT, uid, res.length == 1 ? res.shift() : res));
@@ -1733,7 +1748,8 @@
 		public function set pluginsFactories(value:Array):void
 		{
 			if (value)
-				_pluginsFactories = value.filter(filterPlugins); else
+				_pluginsFactories = value.filter(filterPlugins);
+			else
 				_pluginsFactories = null;
 		}


Transferred from the Adobe Open Source Subversion Repository

Revision: 12863
Author:   sbreinbe@adobe.com
Date:     2009-12-11T21:18:02.442564Z

Log Message:
-----------
Fix class referenced in Alternative metadata.
Alternative metadata for Box, HBox, VBox, Canvas, and Tile still used the obsolete Border classname rather than BorderContainer.

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Box.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Canvas.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Tile.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/VBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/HBox.as</path>

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

--- frameworks/projects/mx/src/mx/containers/Tile.as
+++ frameworks/projects/mx/src/mx/containers/Tile.as
@@ -139,7 +139,7 @@
  *  or use the TileGroup container.
  */
 [Alternative(replacement="spark.components.TileGroup", since="4.0")]
-[Alternative(replacement="spark.components.Border", since="4.0")]
+[Alternative(replacement="spark.components.BorderContainer", since="4.0")]

 /**
  *  A Halo Tile container lays out its children


removec public AtlasTexture.bitmapData getter

--- src/aerys/minko/scene/node/texture/TextureAtlas.as
+++ src/aerys/minko/scene/node/texture/TextureAtlas.as
@@ -23,8 +23,6 @@
 		public function get ressource() 	: TextureRessource	{ return _ressource; }
 		public function get version() 		: uint				{ return _version; }
 		public function get size() 			: uint				{ return _bitmapData.width; }
-
-		public function get bitmapData()	: BitmapData	{ return _bitmapData; }

 		public function TextureAtlas(size 				: uint 		= 2048,
 									 transparent 		: Boolean 	= true,


organizing code

organizing code

Change-Id: I259266cdabbe65f2cc12d78912b3b8d5c5017559

--- WeaveAdmin/src/weave/services/WeaveAdminService.as
+++ WeaveAdmin/src/weave/services/WeaveAdminService.as
@@ -19,8 +19,6 @@

 package weave.services
 {
-	import avmplus.DescribeType;
-
 	import flash.events.Event;
 	import flash.events.IOErrorEvent;
 	import flash.events.ProgressEvent;
@@ -39,8 +37,10 @@
 	import mx.utils.ObjectUtil;
 	import mx.utils.StringUtil;

+	import avmplus.DescribeType;
+
+	import weave.api.registerLinkableChild;
 	import weave.api.core.ILinkableObject;
-	import weave.api.registerLinkableChild;
 	import weave.compiler.StandardLib;
 	import weave.core.CallbackCollection;
 	import weave.services.beans.ConnectionInfo;
@@ -85,7 +85,7 @@
 		{
 			adminService = registerLinkableChild(this, new AMF3Servlet(url + "/AdminService"));
 			dataService = registerLinkableChild(this, new AMF3Servlet(url + "/DataService"));
-			queue = registerLinkableChild(this, new AsyncInvocationQueue(true));
+			queue = registerLinkableChild(this, new AsyncInvocationQueue(true)); // paused

 			var info:* = describeTypeJSON(this, DescribeType.METHOD_FLAGS);
 			for each (var item:Object in info.traits.methods)
@@ -108,7 +108,46 @@
 		private var dataService:AMF3Servlet;
 		private var propertyNameLookup:Dictionary = new Dictionary(); // Function -> String
 		private var methodHooks:Object = {}; // methodName -> Array (of MethodHook)
-        [Bindable] public var initialized:Boolean = false;
+        [Bindable] public var initialized:Boolean = false;
+		[Bindable] public var migrationProgress:String = '';
+
+		//////////////////////////////
+		// Initialization
+
+		private function initializeAdminService():void
+		{
+			var req:URLRequest = new URLRequest(adminService.servletURL);
+			req.data = new URLVariables();
+			req.method = URLRequestMethod.GET;
+			req.data["method"] = "initializeAdminService";
+			var stream:URLStream = new URLStream();
+			stream.addEventListener(ProgressEvent.PROGRESS, progressHandler);
+			stream.addEventListener(Event.COMPLETE, initializeAdminServiceComplete);
+			stream.addEventListener(IOErrorEvent.IO_ERROR, initializeAdminServiceError);
+			stream.load(req);
+		}
+		private function progressHandler(event:ProgressEvent):void
+		{
+			var stream:URLStream = event.target as URLStream;
+			if (stream.bytesAvailable > 0)
+			{
+				var text:String = migrationProgress;
+				text += "\n" + stream.readMultiByte(stream.bytesAvailable, "iso-8859-01");
+				text = StandardLib.replace(text, "\r\n", "\n");
+				text = StringUtil.trim(text).split('\n').pop();
+				migrationProgress = text;
+			}
+		}
+		private function initializeAdminServiceComplete(event:Event):void
+		{
+			initialized = true;
+			queue.begin();
+		}
+		private function initializeAdminServiceError(event:IOErrorEvent):void
+		{
+			messageDisplay(event.type, event.text, true);
+		}
+
 		/**
 		 * @param method A pointer to a function of this WeaveAdminService.
 		 * @param captureHandler Receives the parameters of the RPC call with the 'this' pointer set to the AsyncToken object.
@@ -266,45 +305,6 @@
 			messageDisplay(event.fault.name, msg, true);
 		}

-		//////////////////////////////
-		// Initialization
-
-		[Bindable] public var migrationProgress:String = '';
-
-		private function initializeAdminService():void
-		{
-            var req:URLRequest = new URLRequest(adminService.servletURL);
-            req.data = new URLVariables();
-            req.method = URLRequestMethod.GET;
-            req.data["method"] = "initializeAdminService";
-            var loader:URLStream = new URLStream();
-            loader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
-            loader.addEventListener(Event.COMPLETE, initializeAdminServiceComplete);
-            loader.addEventListener(IOErrorEvent.IO_ERROR, initializeAdminServiceError);
-            loader.load(req);
-		}
-		private function progressHandler(event:ProgressEvent):void
-		{
-			var stream:URLStream = event.target as URLStream;
-			if (stream.bytesAvailable > 0)
-			{
-				var text:String = migrationProgress;
-				text += "\n" + stream.readMultiByte(stream.bytesAvailable, "iso-8859-01");
-				text = StandardLib.replace(text, "\r\n", "\n");
-				text = StringUtil.trim(text).split('\n').pop();
-				migrationProgress = text;
-			}
-		}
-        private function initializeAdminServiceComplete(event:Event):void
-        {
-            initialized=true;
-			queue.begin();
-        }
-        private function initializeAdminServiceError(event:IOErrorEvent):void
-        {
-            messageDisplay(event.type, event.text, true);
-        }
-
 		public function checkDatabaseConfigExists():AsyncToken
 		{
 			return invokeAdmin(checkDatabaseConfigExists, arguments);


Put bufferTime back to 0.1

Put bufferTime back to 0.1

--- src/org/mangui/hls/stream/HLSNetStream.as
+++ src/org/mangui/hls/stream/HLSNetStream.as
@@ -92,7 +92,7 @@
         /** Create the buffer. **/
         public function HLSNetStream(connection : NetConnection, hls : HLS, streamBuffer : StreamBuffer) : void {
             super(connection);
-            super.bufferTime = 3.0;
+            super.bufferTime = 0.1;
             _hls = hls;
 			_hls.addEventListener(HLSEvent.AUDIO_TRACK_SWITCH, _audioTrackSwitch);
             _skippedDuration = _watchedDuration = _droppedFrames = _lastNetStreamTime = 0;


fix FRAGMENT_PLAYING event not being raised after seek for video fragment when using alt audio

--- src/org/mangui/hls/stream/StreamBuffer.as
+++ src/org/mangui/hls/stream/StreamBuffer.as
@@ -145,7 +145,7 @@

         public function appendTags(fragmentType : int, tags : Vector.<FLVTag>, min_pts : Number, max_pts : Number, continuity : int, start_position : Number) : void {
             // compute playlist sliding here :  it is the difference between  expected start position and real start position
-            var sliding:Number = 0, next_relative_start_pos: Number = start_position + (max_pts - min_pts) / 1000;
+            var sliding:Number = 0, next_relative_start_pos: Number = start_position + (max_pts - min_pts) / 1000, headerAppended : Boolean = false, metaAppended : Boolean = false;
             if(_hls.type == HLSTypes.LIVE) {
                 if(fragmentType == HLSLoaderTypes.FRAGMENT_MAIN) {
                     // if -1 : it is not the first appending for this fragment type : we can compute playlist sliding
@@ -172,6 +172,7 @@
                     case FLVTag.AAC_HEADER:
                     case FLVTag.AVC_HEADER:
                         _headerTags.push(tagData);
+                        headerAppended = true;
                         break;
                     case FLVTag.AAC_RAW:
                     case FLVTag.MP3_RAW:
@@ -182,10 +183,21 @@
                         break;
                     case FLVTag.METADATA:
                         _metaTags.push(tagData);
+                        metaAppended = true;
                         break;
                     default:
                 }
             }
+
+            if(_use_altaudio) {
+                if(headerAppended) {
+                    _headerTags = _headerTags.sort(compareTags);
+                }
+                if(metaAppended) {
+                    _metaTags = _metaTags.sort(compareTags);
+                }
+            }
+
             if (_hls.seekState == HLSSeekStates.SEEKING) {
                 /* if in seeking mode, force timer start here, this could help reducing the seek time by 100ms */
                 _timer.start();
@@ -362,9 +374,6 @@
                 if (max_pos >= _seek_position_requested) {
                     // inject enough tags to reach seek position
                     duration = _seek_position_requested + MAX_NETSTREAM_BUFFER_SIZE - min_min_pos;
-                    /* force header tag sorting here : it is mandatory  for seek filtering logic
-                    in case of alt audio tracks, audio/video headers might be not be sorted correctly */
-                    _headerTags = _headerTags.sort(compareTags);
                 }
             }
             if (duration > 0) {
@@ -395,8 +404,8 @@

         /* filter/tweak tags to seek accurately into the stream */
         private function seekFilterTags(tags : Vector.<FLVData>, start_position : Number) : Vector.<FLVData> {
-            var aacIdx : int,avcIdx : int,disIdx : int,metIdx : int,keyIdx : int,lastIdx : int;
-            aacIdx = avcIdx = disIdx = metIdx = keyIdx = lastIdx = -1;
+            var aacIdx : int,avcIdx : int,disIdx : int,metIdxMain : int,metIdxAltAudio : int, keyIdx : int,lastIdx : int;
+            aacIdx = avcIdx = disIdx = metIdxMain = metIdxAltAudio = keyIdx = lastIdx = -1;
             var filteredTags : Vector.<FLVData>=  new Vector.<FLVData>();
             var idx2Clone : Vector.<int> = new Vector.<int>();

@@ -412,7 +421,11 @@
                             disIdx = i;
                             break;
                         case FLVTag.METADATA:
-                            metIdx = i;
+                            if(data.loaderType == HLSLoaderTypes.FRAGMENT_MAIN) {
+                                metIdxMain = i;
+                            } else {
+                                metIdxAltAudio = i;
+                            }
                             break;
                         case FLVTag.AAC_HEADER:
                             aacIdx = i;
@@ -447,7 +460,8 @@
             }
             // inject discontinuity/metadata/AVC header/AAC header if available
             if (disIdx != -1)  idx2Clone.push(disIdx);
-            if (metIdx != -1)  idx2Clone.push(metIdx);
+            if (metIdxMain != -1)  idx2Clone.push(metIdxMain);
+            if (metIdxAltAudio != -1)  idx2Clone.push(metIdxAltAudio);
             if (aacIdx != -1)  idx2Clone.push(aacIdx);
             if (avcIdx != -1)  idx2Clone.push(avcIdx);


StreamBuffer : track backBuffer length in debug2 logs

--- src/org/mangui/hls/stream/StreamBuffer.as
+++ src/org/mangui/hls/stream/StreamBuffer.as
@@ -593,7 +593,7 @@
              * this is to ensure that accurate seeking will work appropriately
              */
             CONFIG::LOGGING {
-                Log.debug2("position/duration/total/audio/video/NetStream bufferLength/audioExpected/videoExpected:" + position.toFixed(2) + "/" + duration.toFixed(2) + "/" + bufLen.toFixed(2) + "/" + audioBufferLength.toFixed(2) + "/" + videoBufferLength.toFixed(2) + "/" + netStreamBuffer.toFixed(2) + "/" + audioExpected + "/" + videoExpected);
+                Log.debug("position/duration/buffer/backBuffer/audio/video/NetStream bufferLength/audioExpected/videoExpected:" + position.toFixed(2) + "/" + duration.toFixed(2) + "/" + bufLen.toFixed(2) + "/" + backBufferLength.toFixed(2) + "/" + audioBufferLength.toFixed(2) + "/" + videoBufferLength.toFixed(2) + "/" + netStreamBuffer.toFixed(2) + "/" + audioExpected + "/" + videoExpected);
             }

             var tagDuration : Number = 0;


implemented SessionStateLog serialize() and deserialize()

Change-Id: I48441caa35d7387070c0b91c88fb36d62b0420aa

--- WeaveCore/src/weave/core/SessionStateLog.as
+++ WeaveCore/src/weave/core/SessionStateLog.as
@@ -19,6 +19,8 @@

 package weave.core
 {
+	import flash.utils.ByteArray;
+
 	import mx.utils.ObjectUtil;

 	import weave.api.WeaveAPI;
@@ -169,16 +171,28 @@
 			saveDiff(true);
 		}

+		/**
+		 * This will undo a number of steps from the saved history.
+		 * @param numberOfSteps The number of steps to undo.
+		 */
 		public function undo(numberOfSteps:int = 1):void
 		{
 			applyDiffs(-numberOfSteps);
 		}

+		/**
+		 * This will redo a number of steps that have been previously undone.
+		 * @param numberOfSteps The number of steps to redo.
+		 */
 		public function redo(numberOfSteps:int = 1):void
 		{
 			applyDiffs(numberOfSteps);
 		}

+		/**
+		 * @private
+		 * @param delta The number of steps to undo (negative) or redo (positive).
+		 */
 		private function applyDiffs(delta:int):void
 		{
 			var stepsRemaining:int = Math.min(Math.abs(delta), delta < 0 ? _undoHistory.length : _redoHistory.length);
@@ -258,11 +272,62 @@
 			}
 			trace('undo ['+h+']','redo ['+f+']');
 		}
+
+		/**
+		 * This version number is used to detect old history formats generated by serialize().
+		 * This value should be incremented each time modifications to this class would result in a different serialization format.
+		 */
+		private static const _serializationVersion:int = 0;
+
+		/**
+		 * This will write the session state log to a ByteArray.
+		 * @param output The output ByteArray.
+		 */
+		public function serialize(output:ByteArray):void
+		{
+			synchronizeNow();
+
+			output.writeInt(_serializationVersion);
+
+			output.writeObject(_prevState);
+			output.writeObject(_undoHistory);
+			output.writeObject(_redoHistory);
+			output.writeInt(_serial);
+		}
+
+		/**
+		 * This will load a session state log from a ByteArray.
+		 * @param input The ByteArray containing the output from seralize().
+		 */
+		public function deserialize(input:ByteArray):void
+		{
+			var version:int = input.readInt();
+			if (version != _serializationVersion)
+				throw new Error("Unsupported Weave file version");
+
+			_prevState = input.readObject();
+			_undoHistory = input.readObject();
+			_redoHistory = input.readObject();
+			_serial = input.readInt();
+
+			_undoActive = false;
+			_redoActive = false;
+			_saveLater = false;
+			_savePending = false;
+
+			getCallbackCollection(this).triggerCallbacks();
+		}
 	}
 }
+import flash.net.registerClassAlias;
+import flash.utils.getQualifiedClassName;

 internal class LogEntry
 {
+	{ /** begin static code block **/
+		registerClassAlias(getQualifiedClassName(LogEntry), LogEntry);
+	} /** end static code block **/
+
 	public function LogEntry(id:int, forward:Object, backward:Object)
 	{
 		this.id = id;


fixed compiler warning

fixed compiler warning

--- WeaveCore/src/weave/core/WeaveXMLEncoder.as
+++ WeaveCore/src/weave/core/WeaveXMLEncoder.as
@@ -124,7 +124,7 @@
 				else if (array.length == 0 || arrayType == Object || arrayType == DynamicState)
 				{
 					encoding = DYNAMIC_ENCODING;
-					for each (var item:Object in array)
+					for each (item in array)
 					{
 						if (!DynamicState.objectHasProperties(item) || !item[DynamicState.CLASS_NAME])
 						{


Check filter before sort otherwise items are not added if they pas stem filter function

--- frameworks/projects/framework/src/mx/collections/ListCollectionView.as
+++ frameworks/projects/framework/src/mx/collections/ListCollectionView.as
@@ -594,19 +594,19 @@
         var listIndex:int = index;

         // if we're sorted addItemAt is meaningless, just add to the end
-        if (localIndex && sort)
+		if (localIndex && filterFunction != null)
+		{
+			// if end of filtered list, put at end of source list
+			if (listIndex == localIndex.length)
+				listIndex = list.length;
+				// if somewhere in filtered list, find it and insert before it
+				// or at beginning
+			else
+				listIndex = list.getItemIndex(localIndex[index]);
+		}
+		else if (localIndex && sort)
         {
             listIndex = list.length;
-        }
-        else if (localIndex && filterFunction != null)
-        {
-            // if end of filtered list, put at end of source list
-            if (listIndex == localIndex.length)
-                listIndex = list.length;
-            // if somewhere in filtered list, find it and insert before it
-            // or at beginning
-            else
-                listIndex = list.getItemIndex(localIndex[index]);
         }
 		// List is sorted or filtered but refresh has not been called
 		// Just add to end of list
@@ -688,14 +688,10 @@
     {
         var i:int;

-        if (localIndex && sort)
-        {
-            var startIndex:int = findItem(item, Sort.FIRST_INDEX_MODE);
-            if (startIndex == -1)
-                return -1;
-
-            var endIndex:int = findItem(item, Sort.LAST_INDEX_MODE);
-            for (i = startIndex; i <= endIndex; i++)
+        if (localIndex && filterFunction != null)
+        {
+            var len:int = localIndex.length;
+            for (i = 0; i < len; i++)
             {
                 if (localIndex[i] == item)
                     return i;
@@ -703,17 +699,21 @@

             return -1;
         }
-        else if (localIndex && filterFunction != null)
-        {
-            var len:int = localIndex.length;
-            for (i = 0; i < len; i++)
-            {
-                if (localIndex[i] == item)
-                    return i;
-            }
-
-            return -1;
-        }
+		else if (localIndex && sort)
+		{
+			var startIndex:int = findItem(item, Sort.FIRST_INDEX_MODE);
+			if (startIndex == -1)
+				return -1;
+
+			var endIndex:int = findItem(item, Sort.LAST_INDEX_MODE);
+			for (i = startIndex; i <= endIndex; i++)
+			{
+				if (localIndex[i] == item)
+					return i;
+			}
+
+			return -1;
+		}
 		// List is sorted or filtered but refresh has not been called
 		else if (localIndex)
 		{
@@ -1154,18 +1154,25 @@
             {
                 var item:Object = items[i];

-                if (sort)
+				if (filterFunction != null)
+				{
+					if (filterFunction(item))
+					{
+						loc = getFilteredItemIndex(item);
+						if (firstOne)
+						{
+							addLocation = loc;
+							firstOne = false;
+						}
+					}
+					else
+					{
+						loc = -1;
+					}
+				}
+				else if (sort)
                 {
                     loc = findItem(item, Sort.ANY_INDEX_MODE, true);
-                    if (firstOne)
-                    {
-                        addLocation = loc;
-                        firstOne = false;
-                    }
-                }
-                else if (filterFunction != null && filterFunction(item))
-                {
-                    loc = getFilteredItemIndex(item);
                     if (firstOne)
                     {
                         addLocation = loc;
@@ -1479,7 +1486,7 @@
                 //if there is a property see if it affects the sort
                 updateEntry.move =
                     updateEntry.move
-                    || filterFunction != null && filterFunction(item)
+                    || filterFunction != null
                     || !updateInfo.property
                     || (sort && sort.propertyAffectsSort(String(updateInfo.property)));
             }
@@ -1611,6 +1618,7 @@
                 }
                 localIndex = tmp;
             }
+
             if (sort)
             {
                 sort.sort(localIndex);
@@ -1665,10 +1673,7 @@
                 localIndex.splice(removeLocation, 1);
             }

-            var addLocation:int = -1;
-
-			if (filterFunction == null || filterFunction(item))
-				addLocation = addItemsToView([item], removeLocation, false);
+            var addLocation:int = addItemsToView([item], removeLocation, false);

             if (dispatch)
             {