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

--- frameworks/projects/charts/src/mx/charts/renderers/ShadowBoxItemRenderer.as
+++ frameworks/projects/charts/src/mx/charts/renderers/ShadowBoxItemRenderer.as
@@ -0,0 +1,216 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.charts.renderers
+{
+
+import flash.display.Graphics;
+import flash.filters.DropShadowFilter;
+import flash.geom.Rectangle;
+import mx.charts.chartClasses.GraphicsUtilities;
+import mx.graphics.IFill;
+import mx.graphics.IStroke;
+import mx.skins.ProgrammaticSkin;
+import mx.core.IDataRenderer;
+import mx.graphics.SolidColor;
+import mx.utils.ColorUtil;
+import mx.charts.ChartItem;
+
+/**
+ *  A simple chart itemRenderer implementation
+ *  that fills a rectangular area and surrounds it with a drop shadow.
+ *  This class can be used as an itemRenderer for ColumnSeries, BarSeries, AreaSeries, LineSeries,
+ *  PlotSeries, and BubbleSeries objects.
+ *  It renders its area on screen using the fill and stroke styles
+ *  of its associated series.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class ShadowBoxItemRenderer extends ProgrammaticSkin implements IDataRenderer
+{
+    include "../../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class constants
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	private static var FILTERS:Array /* of BitMapFilter */ =
+		[ new DropShadowFilter(2, 45, 0.2 * 0xFFFFFF) ];
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class variables
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	private static var rcFill:Rectangle = new Rectangle();
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  Constructor.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public function ShadowBoxItemRenderer()
+	{
+		super();
+
+		filters = FILTERS;
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+	//  data
+    //----------------------------------
+
+	/**
+	 *  @private
+	 *  Storage for the data property.
+	 */
+	private var _data:Object;
+
+	[Inspectable(environment="none")]
+
+	/**
+	 *  The chartItem that this itemRenderer is displaying.
+	 *  This value is assigned by the owning series
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public function get data():Object
+	{
+		return _data;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set data(value:Object):void
+	{
+		if (_data == value)
+			return;
+		_data = value;
+	}
+
+	//--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	override protected function updateDisplayList(unscaledWidth:Number,
+												   unscaledHeight:Number):void
+	{
+		super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+		var fill:IFill;
+		var state:String = "";
+
+		if (_data is ChartItem && _data.hasOwnProperty('fill'))
+		{
+		 	fill = _data.fill;
+		 	state = _data.currentState;
+		}
+		else
+		 	fill = GraphicsUtilities.fillFromStyle(getStyle('fill'));
+
+        var color:uint;
+		var adjustedRadius:Number = 0;
+
+		switch (state)
+		{
+			case ChartItem.FOCUSED:
+			case ChartItem.ROLLOVER:
+				if (styleManager.isValidStyleValue(getStyle('itemRollOverColor')))
+					color = getStyle('itemRollOverColor');
+				else
+					color = ColorUtil.adjustBrightness2(GraphicsUtilities.colorFromFill(fill),-20);
+				fill = new SolidColor(color);
+				adjustedRadius = getStyle('adjustedRadius');
+				if (!adjustedRadius)
+					adjustedRadius = 0;
+				break;
+			case ChartItem.DISABLED:
+				if (styleManager.isValidStyleValue(getStyle('itemDisabledColor')))
+					color = getStyle('itemDisabledColor');
+				else
+					color = ColorUtil.adjustBrightness2(GraphicsUtilities.colorFromFill(fill),20);
+				fill = new SolidColor(GraphicsUtilities.colorFromFill(color));
+				break;
+			case ChartItem.FOCUSEDSELECTED:
+			case ChartItem.SELECTED:
+				if (styleManager.isValidStyleValue(getStyle('itemSelectionColor')))
+					color = getStyle('itemSelectionColor');
+				else
+					color = ColorUtil.adjustBrightness2(GraphicsUtilities.colorFromFill(fill),-30);
+				fill = new SolidColor(color);
+				adjustedRadius = getStyle('adjustedRadius');
+				if (!adjustedRadius)
+					adjustedRadius = 0;
+				break;
+		}
+
+		var stroke:IStroke = getStyle("stroke");
+
+		var w:Number = stroke ? stroke.weight / 2 : 0;
+
+		rcFill.left = rcFill.left - adjustedRadius;
+		rcFill.top = rcFill.top - adjustedRadius;
+		rcFill.right = unscaledWidth;
+		rcFill.bottom = unscaledHeight;
+
+		var g:Graphics = graphics;
+		g.clear();
+		g.moveTo(w - adjustedRadius, w - adjustedRadius);
+		if (stroke)
+			stroke.apply(g,null,null);
+		if (fill)
+			fill.begin(g, rcFill,null);
+		g.lineTo(unscaledWidth - w + 2 * adjustedRadius, w - adjustedRadius);
+		g.lineTo(unscaledWidth - w + 2 * adjustedRadius, unscaledHeight + 2 * adjustedRadius - w);
+		g.lineTo(w - adjustedRadius, unscaledHeight + 2 * adjustedRadius - w);
+		g.lineTo(w - adjustedRadius, w - adjustedRadius);
+		if (fill)
+			fill.end(g);
+	}
+}
+
+}


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

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

 package mx.managers
 {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

--- frameworks/projects/mx/src/mx/controls/listClasses/ListBaseContentHolder.as
+++ frameworks/projects/mx/src/mx/controls/listClasses/ListBaseContentHolder.as
@@ -32,6 +32,11 @@

 /**
  *  Background color of the component.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="backgroundColor", type="uint", format="Color", inherit="no")]

@@ -50,6 +55,11 @@
  *  alternating row colors can show through the control.
  *
  *  @see mx.controls.listClasses.ListBase
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class ListBaseContentHolder extends UIComponent
 {
@@ -65,6 +75,11 @@
      *  Constructor.
      *
      *  @param parentList The list-based control.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function ListBaseContentHolder(parentList:ListBase)
     {
@@ -103,6 +118,11 @@
     /**
      *  The layer in the content defined by the :istbase.listContent property
      *  where all selection and highlight indicators are drawn.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public var selectionLayer:Sprite;

@@ -110,6 +130,11 @@
      *  A hash table of data provider item renderers currently in view.
      *  The table is indexed by the data provider item's UID and is used
      *  to quickly get the renderer used to display a particular item.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public var visibleData:Object = {};

@@ -118,6 +143,11 @@
      *  the item renderer instances that render each data provider item.
      *  This is a two-dimensional, row-major array, which means
      *  an Array of rows that are Arrays of columns.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public var listItems:Array = [];

@@ -125,6 +155,11 @@
      *  An Array of ListRowInfo objects that cache row heights and
      *  other tracking information for the rows defined in
      *  the listItems property.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public var rowInfo:Array = [];

@@ -133,6 +168,11 @@
      *  data provider and pass the items to the renderers.
      *  At the end of any sequence of code, it must always
      *  be positioned at the top-most visible item being displayed.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public var iterator:IViewCursor;

@@ -224,6 +264,11 @@
      *  @param unscaledHeight Specifies the height of the component, in pixels,
      *  in the component's coordinates, regardless of the value of the
      *  scaleY property of the component.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     override protected function updateDisplayList(unscaledWidth:Number,
                                                   unscaledHeight:Number):void
@@ -260,6 +305,11 @@
      *  by the ListBase.listContent property.
      *
      *  @see mx.controls.listClasses.ListBase#listContent
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public var leftOffset:Number = 0;

@@ -268,6 +318,11 @@
      *  by the ListBase.listContent property.
      *
      *  @see mx.controls.listClasses.ListBase#listContent
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public var topOffset:Number = 0;

@@ -276,6 +331,11 @@
      *  by the ListBase.listContent property.
      *
      *  @see mx.controls.listClasses.ListBase#listContent
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public var rightOffset:Number = 0;

@@ -284,6 +344,11 @@
      *  by the ListBase.listContent property.
      *
      *  @see mx.controls.listClasses.ListBase#listContent
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public var bottomOffset:Number = 0;

@@ -293,6 +358,11 @@
      *  by the ListBase.listContent property.
      *
      *  @see mx.controls.listClasses.ListBase#listContent
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get heightExcludingOffsets():Number
     {
@@ -305,6 +375,11 @@
      *  by the ListBase.listContent property.
      *
      *  @see mx.controls.listClasses.ListBase#listContent
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get widthExcludingOffsets():Number
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 7346
Author:   jszeto@adobe.com
Date:     2009-05-27T22:42:37.331591Z

Log Message:
-----------
DropDownList user interaction bug fix

http://bugs.adobe.com/jira/browse/SDK-21346 - PopUpAnchor popUp is not bindable

Added Bindable metadata to popUp property

http://bugs.adobe.com/jira/browse/SDK-21307 - DropDownList doesn't open on first click when escape was previously used

Fixed ButtonBase.set keepDown to restore the button into the proper state.

QE Notes: None
Doc Notes: None
Bugs: SDK-21346, SDK-21307
Reviewer: Glenn

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/PopUpAnchor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ButtonBase.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as
@@ -547,7 +547,10 @@
 			return;

 		_keepDown = value;
-		invalidateSkinState();
+		if (_keepDown)
+			invalidateSkinState();
+		else
+			invalidateButtonState();
 	}

 	/**


Transferred from the Adobe Open Source Subversion Repository

Revision: 5361
Author:   mhorn@adobe.com
Date:     2009-03-17T21:14:43.852314Z

Log Message:
-----------
minor ASDoc updates

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

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

--- frameworks/projects/mx/src/mx/controls/DataGrid.as
+++ frameworks/projects/mx/src/mx/controls/DataGrid.as
@@ -253,7 +253,7 @@

 /**
  *  The color of the vertical grid lines.
- *  @default 0x666666
+ *  @default 0xCCCCCC
  *
  *  @langversion 3.0
  *  @playerversion Flash 9
@@ -264,12 +264,13 @@

 /**
  *  The color of the horizontal grid lines.
-  *
-  *  @langversion 3.0
-  *  @playerversion Flash 9
-  *  @playerversion AIR 1.1
-  *  @productversion Flex 3
-  */
+ * @default 0xF7F7F7
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
 [Style(name="horizontalGridLineColor", type="uint", format="Color", inherit="yes")]

 /**
@@ -287,7 +288,7 @@

 /**
  *  The color of the row background when the user rolls over the row.
- *  @default 0xE3FFD6
+ *  @default 0xB2E1FF
  *
  *  @langversion 3.0
  *  @playerversion Flash 9
@@ -299,7 +300,7 @@
 /**
  *  The color of the background for the row when the user selects
  *  an item renderer in the row.
- *  @default 0xCDFFC1
+ *  @default 0x7FCEFF
  *
  *  @langversion 3.0
  *  @playerversion Flash 9
@@ -335,7 +336,7 @@
 /**
  *  The class to use as the skin that defines the appearance of the
  *  background of the column headers in a DataGrid control.
- *  @default mx.skins.halo.DataGridHeaderSeparator
+ *  @default mx.skins.halo.DataGridHeaderBackgroundSkin
  *
  *  @langversion 3.0
  *  @playerversion Flash 9
@@ -587,16 +588,16 @@
  *    headerDragProxyStyleName="headerDragProxyStyle"
  *    headerSeparatorSkin="DataGridHeaderSeparator"
  *    headerStyleName="dataGridStyles"
- *    horizontalGridLineColor="No default"
+ *    horizontalGridLineColor="0xF7F7F7"
  *    horizontalGridLines="false|true"
  *    horizontalLockedSeparatorSkin="undefined"
  *    horizontalSeparatorSkin="undefined"
  *    iconColor="0x111111"
- *    rollOverColor="#E3FFD6"
- *    selectionColor="#CDFFC1"
+ *    rollOverColor="0xB2E1FF"
+ *    selectionColor="0x7FCEFF"
  *    sortArrowSkin="DataGridSortArrow"
  *    stretchCursor=""cursorStretch" symbol from the Assets.swf file"
- *    verticalGridLineColor="#666666"
+ *    verticalGridLineColor="0xCCCCCC"
  *    verticalGridLines="false|true"
  *    verticalLockedSeparatorSkin="undefined"
  *    verticalSeparatorSkin="undefined"


Transferred from the Adobe Open Source Subversion Repository

Revision: 16889
Author:   tkraikit@adobe.com
Date:     2010-07-12T21:55:00.628423Z

Log Message:
-----------
Fix for bug 26659: when sorting or using type-ahead, sortIndex should be applied to array of all columns, not just displayed columns.

QE notes: -
Doc notes: -
Bugs: -
Reviewer: klin
Tests run: checkintests, mustella
Is noteworthy for integration: -

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

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1268104 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 displayableColumns[sortIndex == -1 ? 0 : sortIndex].itemToLabel(data);
+		return _columns[sortIndex == -1 ? 0 : sortIndex].itemToLabel(data);
     }

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


fix autosizing

fix autosizing

--- frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/TextFieldViewBase.as
+++ frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/TextFieldViewBase.as
@@ -23,6 +23,7 @@

 	import org.apache.flex.core.CSSTextField;
 	import org.apache.flex.core.IBeadView;
+    import org.apache.flex.core.ILayoutChild;
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.core.ITextModel;
 	import org.apache.flex.core.IUIBase;
@@ -92,11 +93,18 @@
             _textModel.addEventListener("htmlChange", htmlChangeHandler);
             IEventDispatcher(_strand).addEventListener("widthChanged", widthChangeHandler);
             IEventDispatcher(_strand).addEventListener("heightChanged", heightChangeHandler);
+            IEventDispatcher(_strand).addEventListener("sizeChanged", sizeChangeHandler);
 			DisplayObjectContainer(value).addChild(_textField);
 			if (_textModel.text !== null)
 				text = _textModel.text;
 			if (_textModel.html !== null)
 				html = _textModel.html;
+
+            var ilc:ILayoutChild = host as ILayoutChild;
+
+            autoHeight = ilc.isHeightSizedToContent();
+            autoWidth = ilc.isWidthSizedToContent();
+
 		}

         /**
@@ -188,8 +196,8 @@
 			html = _textModel.html;
 		}

-        private var autoHeight:Boolean = true;
-        private var autoWidth:Boolean = true;
+        private var autoHeight:Boolean;
+        private var autoWidth:Boolean;
         private var inHeightChange:Boolean = false;
         private var inWidthChange:Boolean = false;

@@ -221,6 +229,25 @@
             }
         }

+        private function sizeChangeHandler(event:Event):void
+        {
+            var ilc:ILayoutChild = host as ILayoutChild;
+
+            autoHeight = ilc.isHeightSizedToContent();
+            if (!autoHeight)
+            {
+                textField.autoSize = "none";
+                textField.height = DisplayObject(_strand).height;
+            }
+
+            autoWidth = ilc.isWidthSizedToContent();
+            if (!autoWidth)
+            {
+                textField.autoSize = "none";
+                textField.width = DisplayObject(_strand).width;
+            }
+        }
+
         /**
          *  @copy org.apache.flex.core.IBeadView#viewHeight
          *


Transferred from the Adobe Open Source Subversion Repository

Revision: 11966
Author:   aharui@adobe.com
Date:     2009-11-19T00:21:41.792188Z

Log Message:
-----------
Move focusSkinExclusions into Skin (from SparkSkin) and add suggestedFocusSkinExclusions to SkinnableComponent.

QE Notes: None
Doc Notes: new API (suggestedFocusSkinExclusions)
Bugs: SDK-19255
Reviewer: Glenn
API Change: Yes
Is noteworthy for integration: Yes
tests: checkintests mustella/gumbo/components/TextInput, TextArea, CheckBox, RadioButton

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/TextAreaSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Skin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/HighlightBitmapCaptureSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/ScrollerSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/CheckBoxSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/SparkSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/CheckBoxSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/RadioButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/RadioButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/ComboBoxTextInputSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/TextInputSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/CheckBox.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as
@@ -199,6 +199,27 @@
         dispatchEvent(new Event("skinChanged"));
     }

+    //----------------------------------
+    //  suggestedFocusSkinExclusions
+    //----------------------------------
+
+    /**
+     *  An Array that lists the skin parts that will be
+     *  excluded from bitmaps captured and used to
+     *  show focus.  This list is only used if
+     *  the skin has a null focusSkinExclusions property.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get suggestedFocusSkinExclusions():Array
+    {
+        return null;
+    }
+
+
     //--------------------------------------------------------------------------
     //
     //  Overridden properties


Transferred from the Adobe Open Source Subversion Repository

Revision: 6218
Author:   gpburch@adobe.com
Date:     2009-04-23T18:01:46.118886Z

Log Message:
-----------
Removed remaining reference to getSkinPartMetadata and changed the implementation to rely on the new code generated by the compiler which populates the skinParts array.

Reviewed By: Glenn & Jason S.

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/SkinnableComponent.as

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as
@@ -15,21 +15,16 @@
 import flash.display.DisplayObject;
 import flash.events.Event;
 import flash.geom.Point;
-import flash.system.ApplicationDomain;
 import flash.utils.*;

-import spark.components.supportClasses.Skin;
 import mx.core.ClassFactory;
 import mx.core.IFactory;
-import mx.core.IFlexModuleFactory;
 import mx.core.IInvalidating;
 import mx.core.ILayoutElement;
 import mx.core.IVisualElement;
 import mx.core.UIComponent;
 import mx.core.mx_internal;
 import mx.events.PropertyChangeEvent;
-import mx.managers.ISystemManager;
-import mx.modules.ModuleManager;

 //--------------------------------------
 //  Styles
@@ -526,30 +521,25 @@
      */
     protected function clearSkinParts():void
     {
-        var className:String = getQualifiedClassName(this);
-        var parts:Array = getSkinPartMetadata(className);
-
-        if (parts)
-        {
-            for (var i:int = 0; i < parts.length; i++)
+        if (skinParts)
+        {
+            for (var id:String in skinParts)
             {
-                var skinPart:SkinPartInfo = parts[i];
-                var skinPartID:String = skinPart.id;
-
-                if (this[skinPartID] != null)
+                if (this[id] != null)
                 {
-                if (!(this[skinPartID] is IFactory))
-                {
-                    partRemoved(skinPartID, this[skinPartID]);
+                    if (!(this[id] is IFactory))
+                    {
+                        partRemoved(id, this[id]);
+                    }
+                    else
+                    {
+                        var len:int = numDynamicParts(id);
+                        for (var j:int = 0; j < len; j++)
+                            removeDynamicPartInstance(id, getDynamicPartAt(id, j));
+                    }
                 }
-                else
-                {
-                    var len:int = numDynamicParts(skinPartID);
-                    for (var j:int = 0; j < len; j++)
-                        removeDynamicPartInstance(skinPartID, getDynamicPartAt(skinPartID, j));
-                }
-            }
-                this[skinPartID] = null;
+
+                this[id] = null;
             }
         }
     }
@@ -749,86 +739,6 @@

         return null;
     }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Methods - Part Metadata
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     *  Cache of found skin parts.
-     */
-    private static var skinPartsByClassName:Dictionary;
-
-    /**
-     *  @private
-     *  Find the skin part metadata for a given className.
-     */
-    private function getSkinPartMetadata(className:String):Array
-    {
-        // Check cached values first
-        if (!skinPartsByClassName)
-            skinPartsByClassName = new Dictionary(true);
-
-        var skinParts:Array = skinPartsByClassName[className];
-
-        if (skinParts != null)
-            return skinParts;
-
-        var myApplicationDomain:ApplicationDomain;
-
-        var factory:IFlexModuleFactory = ModuleManager.getAssociatedFactory(this);
-        if (factory != null)
-        {
-            myApplicationDomain = ApplicationDomain(factory.info()["currentDomain"]);
-        }
-        else
-        {
-            myApplicationDomain = systemManager ?
-                                    systemManager.loaderInfo.applicationDomain :
-                                    ApplicationDomain.currentDomain;
-        }
-
-        // If the application domain is null it is because the application that this
-        // component lives in has been unloaded.
-        if (myApplicationDomain == null)
-            return null;
-
-        var type:Class = myApplicationDomain.getDefinition(className) as Class;
-        skinParts = new Array;
-
-        var des:XML = flash.utils.describeType(type);
-
-        // Find Part metadata on variables
-        var metadata:XMLList = des.factory.variable.metadata.(@name == "SkinPart");
-        var skinPartInfo:SkinPartInfo;
-        var i:int;
-
-        for (i = 0; i < metadata.length(); i++)
-        {
-            skinPartInfo = new SkinPartInfo();
-
-            skinPartInfo.id = metadata[i].parent().@name;
-            skinPartInfo.required = !(metadata[i].arg.(@key == "required").@value == "false");
-            skinParts.push(skinPartInfo);
-        }
-
-        // Find Part metadata on getter/setters
-        metadata = des.factory.accessor.metadata.(@name == "SkinPart");
-        for (i = 0; i < metadata.length(); i++)
-        {
-            skinPartInfo = new SkinPartInfo();
-
-            skinPartInfo.id = metadata[i].parent().@name;
-            skinPartInfo.required = !(metadata[i].arg.(@key == "required").@value == "false");
-            skinParts.push(skinPartInfo);
-        }
-
-        skinPartsByClassName[className] = skinParts;
-        return skinParts;
-    }

     //---------------------------------
     //  Utility methods for subclasses
@@ -943,23 +853,15 @@
      */
     private function skin_propertyChangeHandler(event:PropertyChangeEvent):void
     {
-        var className:String = getQualifiedClassName(this);
-        var parts:Array = getSkinPartMetadata(className);
-
-        if (parts)
-        {
-            for (var i:int = 0; i < parts.length; i++)
+        if (skinParts)
+        {
+            var skinPartID:String = event.property as String;
+            if(skinParts[skinPartID] != null)
             {
-                var skinPart:SkinPartInfo = parts[i];
+                this[skinPartID] = event.newValue;

-                if (event.property == skinPart.id)
-                {
-                    this[skinPart.id] = event.newValue;
-
-                    if (!(this[skinPart.id] is IFactory))
-                        partAdded(skinPart.id, this[skinPart.id]);
-                    break;
-                }
+                if (!(this[skinPartID] is IFactory))
+                    partAdded(skinPartID, this[skinPartID]);
             }
         }
     }


Bugfix: in foreach mode, we need to report back if a source is already complete.

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


qnd: remove spaces

qnd: remove spaces

git-svn-id: 3f608e5a9a704dd448217c0a64c508e7f145cfa1@82444 6b8eccd3-e8c5-4e7d-8186-e12b5326b719

--- plugins/listPlugin/src/listPluginCode.as
+++ plugins/listPlugin/src/listPluginCode.as
@@ -174,8 +174,6 @@
 		override public function set enabled(value:Boolean):void
 		{
 			_klist.enabled = value;
-
-
 		}

 	}


Fix possible 'Unhandled NetStatusEvent: NetStream.Seek.Failed'.  This error can be thrown if a sound connects and goes to play while it is being destroyed.  I think the event handlers are unbound and in play() we try to set the position which throws the error.

--- src/SoundManager2_SMSound_AS3.as
+++ src/SoundManager2_SMSound_AS3.as
@@ -643,9 +643,16 @@
       // for the record, I'm sure this is completely wrong. ;)
       ns.removeEventListener(AsyncErrorEvent.ASYNC_ERROR, doAsyncError);
       ns.removeEventListener(NetStatusEvent.NET_STATUS, doNetStatus);
+      ns.addEventListener(NetStatusEvent.NET_STATUS, dummyNetStatusHandler);
       ns.removeEventListener(IOErrorEvent.IO_ERROR, doIOError);
       // KJV Stop listening for NetConnection events on the sound
       nc.removeEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
     }
+
+    // Prevents possible 'Unhandled NetStatusEvent' condition if a sound is being
+    // destroyed and interacted with at the same time.
+    public function dummyNetStatusHandler(e: NetStatusEvent) : void {
+      // Don't do anything
+    }
   }
 }


Fixed a bug where suppressDefaultPlayerStates was not reset if duration is 0.

--- src/engine/tetragon/systems/racetrack/RacetrackSystem.as
+++ src/engine/tetragon/systems/racetrack/RacetrackSystem.as
@@ -249,6 +249,7 @@
 			_fastestLapTime = 0;

 			_allowControls = true;
+			_suppressDefaultPlayerStates = false;

 			if (_progressSignal) _progressSignal.dispatch(_progress);
 		}
@@ -1178,11 +1179,6 @@
 		private function switchObjectState(object:RTObject, stateID:String, duration:Number,
 			completeCallback:Function = null):void
 		{
-			if (object.isPlayer)
-			{
-				_suppressDefaultPlayerStates = true;
-			}
-
 			if (completeCallback != null)
 			{
 				if (!object.sequenceCompleteSignal) object.sequenceCompleteSignal = new Signal();
@@ -1197,6 +1193,7 @@
 			{
 				if (duration > 0.0)
 				{
+					if (object.isPlayer) _suppressDefaultPlayerStates = true;
 					if (!object.interval) object.interval = new Interval(0, 0, null, null);
 					else object.interval.reset();
 					object.interval.delay = duration * 1000;


Transferred from the Adobe Open Source Subversion Repository

Revision: 5099
Author:   gauravj@adobe.com
Date:     2009-02-27T03:43:02.639229Z

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

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

Modified Paths:
--------------
147 paths were modified

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

--- frameworks/projects/rpc/src/mx/utils/RPCObjectUtil.as
+++ frameworks/projects/rpc/src/mx/utils/RPCObjectUtil.as
@@ -23,6 +23,11 @@
 /**
  *  The RPCObjectUtil class is a subset of ObjectUtil, removing methods
  *  that create dependency issues when RPC messages are in a bootstrap loader.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class RPCObjectUtil
 {
@@ -30,6 +35,11 @@

     /**
     *  Array of properties to exclude from debugging output.
+    *
+    *  @langversion 3.0
+    *  @playerversion Flash 9
+    *  @playerversion AIR 1.1
+    *  @productversion Flex 3
     */
     private static var defaultToStringExcludes:Array = ["password", "credentials"];

@@ -180,6 +190,11 @@
      *          yetDeeper = (Object)#0
      *

      *
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public static function toString(value:Object,
                                     namespaceURIs:Array = null,
@@ -380,6 +395,11 @@
      *
name: String containing the name of the class;

      *
properties: Sorted list of the property names of the specified object.

      *

+    *
+    *  @langversion 3.0
+    *  @playerversion Flash 9
+    *  @playerversion AIR 1.1
+    *  @productversion Flex 3
     */
     public static function getClassInfo(obj:Object,
                                         excludes:Array = null,


Transferred from the Adobe Open Source Subversion Repository

Revision: 9581
Author:   gosmith@adobe.com
Date:     2009-08-25T17:51:18.608886Z

Log Message:
-----------
Reverted unintended recent change to TLFTextField. When I integrated a new TLF yesterday, I accidentally checked in some changes to TLFTextField that aren't ready yet.

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

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_textField/src/flashx/textLayout/controls/TLFTextField.as

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

--- frameworks/projects/spark/src/mx/core/FTETextField.as
+++ frameworks/projects/spark/src/mx/core/FTETextField.as
@@ -7,8 +7,14 @@
 //  NOTICE: Adobe permits you to use, modify, and distribute this file
 //  in accordance with the terms of the license agreement accompanying it.
 //
-////////////////////////////////////////////////////////////////////////////////
-
+//////////////////////////////////////////////////////////////////////////////////
+//
+//ADOBE SYSTEMS INCORPORATED
+//Copyright 2009 Adobe Systems Incorporated
+//All Rights Reserved.
+//
+//in accordance with the terms of the license agreement accompanying it.
+//
 package flashx.textLayout.controls
 {

@@ -25,52 +31,32 @@
 import flash.text.TextFormat;
 import flash.text.TextFormatAlign;
 import flash.text.TextLineMetrics;
-import flash.text.engine.FontLookup;
 import flash.text.engine.FontPosture;
 import flash.text.engine.FontWeight;
 import flash.text.engine.Kerning;
-import flash.text.engine.SpaceJustifier;
-import flash.text.engine.TextBlock;
-import flash.text.engine.TextElement;
 import flash.text.engine.TextLine;

-import flashx.textLayout.compose.ITextLineCreator;
-import flashx.textLayout.conversion.ITextExporter;
 import flashx.textLayout.conversion.ITextImporter;
 import flashx.textLayout.conversion.TextConverter;
-import flashx.textLayout.elements.TextFlow;
-import flashx.textLayout.factory.TextFlowTextLineFactory;
+import flashx.textLayout.debug.assert;
+import flashx.textLayout.compose.ITextLineCreator;
+import flashx.textLayout.factory.StringTextLineFactory;
 import flashx.textLayout.formats.LineBreak;
 import flashx.textLayout.formats.TextDecoration;
-import flashx.textLayout.formats.TextLayoutFormat;
+import flashx.textLayout.formats.TextLayoutFormatValueHolder;

 /**
  *  TLFTextField is a Sprite which displays text by using the new
  *  Text Layout Framework to implement the old TextField API.
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @langversion 3.0
  */
 public class TLFTextField extends Sprite
 {
     // Current slot count: 32
     // (1 for every type except 2 for Number)

-	//--------------------------------------------------------------------------
-	//
-	//  Class initialization
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  @private
-	 */
-	private static function initClass():void
-	{
-	}
-
-	initClass();
-
     //--------------------------------------------------------------------------
     //
     //  Class constants
@@ -109,9 +95,9 @@
 	private static const FLAG_WORD_WRAP_CHANGED:uint = 1 << 18;

 	/**
-	 *  @private
-	 *  Masks for bits inside the 'flags' var
-	 *  tracking misc boolean variables.
+	 * @private
+	 * Masks for bits inside the 'flags' var
+	 * tracking misc boolean variables.
 	 */
 	private static const FLAG_SCROLL_RECT_IS_SET:uint = 1 << 19;
 	private static const FLAG_VALIDATE_IN_PROGRESS:uint = 1 << 20;
@@ -138,132 +124,19 @@
     /**
      *  @private
      */
-    private static var plainTextImporter:ITextImporter =
+    private static var textImporter:ITextImporter =
     	TextConverter.getImporter(TextConverter.PLAIN_TEXT_FORMAT);

-	/**
-	 *  @private
-	 */
-	private static var plainTextExporter:ITextExporter =
-		TextConverter.getExporter(TextConverter.PLAIN_TEXT_FORMAT);
-
-		/**
-	 *  @private
-	 */
-	private static var htmlImporter:ITextImporter =
-		TextConverter.getImporter(TextConverter.HTML_FORMAT);
-
-	/**
-	 *  @private
-	 */
-	private static var htmlExporter:ITextExporter =
-		TextConverter.getExporter(TextConverter.HTML_FORMAT);
-
-	/**
-	 *  @private
-	 */
-    private static var factory:TextFlowTextLineFactory =
-    	new TextFlowTextLineFactory();
+    /**
+     *  @private
+     */
+    private static var htmlTextImporter:ITextImporter =
+    	TextConverter.getImporter(TextConverter.TEXT_LAYOUT_FORMAT);
+    	// TLF needs TEXT_FIELD_HTML_FORMAT
+
+    private static var factory:StringTextLineFactory = new StringTextLineFactory();

-	// We can re-use single instances of a few FTE classes over and over,
-	// since they just serve as a factory for the TextLines that we care about.
-
-	/**
-	 *  @private
-	 */
-	private static var staticTextBlock:TextBlock = new TextBlock();
-
-	/**
-	 *  @private
-	 */
-	private static var staticTextElement:TextElement = new TextElement();
-
-	/**
-	 *  @private
-	 */
-	private static var staticSpaceJustifier:SpaceJustifier =
-		new SpaceJustifier();
-
-	/**
-	 *  @private
-	 *  A reference to the recreateTextLine() method in staticTextBlock,
-	 *  if it exists. This method was added in player 10.1.
-	 *  It allows better performance by making it possible to reuse
-	 *  existing TextLines instead of having to create new ones.
-	 */
-	private static var recreateTextLine:Function =
-		"recreateTextLine" in staticTextBlock ?
-		staticTextBlock["recreateTextLine"] :
-		null;
-
-	//--------------------------------------------------------------------------
-	//
-	//  Class methods
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  @private
-	 */
-	private static function rint(x:Number):Number
-	{
-		var i:Number = Math.round(x);
-		if (i - 0.5 == x && i & 1)
-			--i;
-		return i;
-	}
-
-	/**
-	 *  @private
-	 */
-	private static function createDefaultTextFormat():TextFormat
-	{
-		// TODO: is font value platform-dependent???
-		var ret:TextFormat = new TextFormat("Times New Roman", 12, 0x000000, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0);
-		ret.blockIndent = 0;
-		ret.bullet = false;
-		ret.kerning = false;
-		ret.leading = 0;
-		ret.letterSpacing = 0;
-		ret.tabStops = []; // does not work. Flash apparently detects when an empty array is assigned to tabStops and assigns null instead.
-		return ret;
-	}
-
-	/**
-	 *  @private TODO
-	 */
-	private static function createTextFormatCopy(obj:TextFormat):TextFormat
-	{
-		var ret:TextFormat = new TextFormat(obj.font, obj.size, obj.color, obj.bold, obj.italic, obj.underline, obj.url, obj.target, obj.align, obj.leftMargin, obj.rightMargin, obj.indent);
-		ret.blockIndent = obj.blockIndent;
-		ret.bullet = obj.bullet;
-		ret.kerning = obj.kerning;
-		ret.leading = obj.leading;
-		ret.letterSpacing = obj.letterSpacing;
-		ret.tabStops = obj.tabStops;
-		return ret;
-	}
-
-	/**
-	 *  @private TODO
-	 */
-	private static function intToHexColor(color:Object):String
-	{
-		if (color == null)
-			return "000000";
-		var colorInt:int = int(color);
-		var s:String = new String();
-		var hexCode:Array = [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F" ];
-		for (var i:int = 0; i < 6; ++i)
-		{
-			var c:int = colorInt & 15;
-			s = hexCode[c] + s;
-			colorInt >>= 4;
-		}
-		return s;
-	}
-
-	//--------------------------------------------------------------------------
+    //--------------------------------------------------------------------------
     //
     //  Constructor
     //
@@ -271,14 +144,13 @@

 	/**
 	 *  Constructor.
-	 *  @playerversion Flash 10
-	 *  @playerversion AIR 1.5
-	 *  @langversion 3.0
+	 * @playerversion Flash 10
+	 * @playerversion AIR 1.5
+	 * @langversion 3.0
 	 */
 	public function TLFTextField()
 	{
 		super();
-
 		addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
 	}

@@ -306,11 +178,13 @@
     /**
      *  @private
      */
-    private var hostFormat:TextLayoutFormat = new TextLayoutFormat();
-
-    /**
-     *  @private
-     */
+    private var hostContainerFormat:TextLayoutFormatValueHolder = new TextLayoutFormatValueHolder();
+    private var hostParagraphFormat:TextLayoutFormatValueHolder = new TextLayoutFormatValueHolder();
+    private var hostCharacterFormat:TextLayoutFormatValueHolder = new TextLayoutFormatValueHolder();
+
+    /**
+    * @private
+    */
     private var _textLineCreator:ITextLineCreator;

     //--------------------------------------------------------------------------
@@ -318,6 +192,7 @@
     //  Overridden properties: DisplayObject
     //
     //--------------------------------------------------------------------------
+

     //----------------------------------
     //  height
@@ -432,9 +307,9 @@

     /**
      *  @copy flash.text.TextField#alwaysShowSelection
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get alwaysShowSelection():Boolean
     {
@@ -467,9 +342,9 @@

     /**
      *  @copy flash.text.TextField#antiAliasType
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get antiAliasType():String
     {
@@ -511,9 +386,9 @@

     /**
      *  @copy flash.text.TextField#autoSize
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get autoSize():String
     {
@@ -539,7 +414,7 @@

     	_autoSize = value;

-    	if (_autoSize != TextFieldAutoSize.NONE)
+    	if ( _autoSize != TextFieldAutoSize.NONE )
     		_maxScrollH = 0;

     	// The border and background may need to be redrawn,
@@ -563,9 +438,9 @@

     /**
      *  @copy flash.text.TextField#background
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get background():Boolean
     {
@@ -601,9 +476,9 @@

     /**
      *  @copy flash.text.TextField#backgroundColor
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get backgroundColor():uint
     {
@@ -635,9 +510,9 @@

     /**
      *  @copy flash.text.TextField#border
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get border():Boolean
     {
@@ -674,9 +549,9 @@

     /**
      *  @copy flash.text.TextField#borderColor
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get borderColor():uint
     {
@@ -713,9 +588,9 @@

     /**
      *  @copy flash.text.TextField#bottomScrollV
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get bottomScrollV():int
     {
@@ -731,9 +606,9 @@

     /**
      *  @copy flash.text.TextField#caretIndex
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get caretIndex():int
     {
@@ -747,9 +622,9 @@

     /**
      *  @copy flash.text.TextField#condenseWhite
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get condenseWhite():Boolean
     {
@@ -774,17 +649,41 @@
     //----------------------------------
     //  defaultTextFormat
     //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _defaultTextFormat:TextFormat = createDefaultTextFormat();
+    static private function createDefaultTextFormat( ): TextFormat
+    {
+      	// TODO: is font value platform-dependent???
+	  	var ret:TextFormat = new TextFormat("Times New Roman", 12, 0x000000, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0);
+		ret.blockIndent = 0;
+		ret.bullet = false;
+		ret.kerning = false;
+		ret.leading = 0;
+		ret.letterSpacing = 0;
+		ret.tabStops = new Array(); // does not work. Flash apparently detects when an empty array is assigned to tabStops and assigns null instead.
+		return ret;
+    }
+
+    static private function createTextFormatCopy( obj:TextFormat ): TextFormat
+    {
+    	var ret:TextFormat = new TextFormat(obj.font,obj.size,obj.color,obj.bold,obj.italic,obj.underline,obj.url,obj.target,obj.align,obj.leftMargin,obj.rightMargin,obj.indent);
+		ret.blockIndent = obj.blockIndent;
+		ret.bullet = obj.bullet;
+		ret.kerning = obj.kerning;
+		ret.leading = obj.leading;
+		ret.letterSpacing = obj.letterSpacing;
+		ret.tabStops = obj.tabStops;
+		return ret;
+    }
+
+    /**
+     *  @private
+     */
+    private var _defaultTextFormat:TextFormat = createDefaultTextFormat( );

     /**
      *  @copy flash.text.TextField#defaultTextFormat
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get defaultTextFormat():TextFormat
     {
@@ -803,7 +702,7 @@
     	if (value == _defaultTextFormat)
     		return;

-    	_defaultTextFormat = createTextFormatCopy(value);
+    	_defaultTextFormat = createTextFormatCopy( value );

     	setFlag(FLAG_DEFAULT_TEXT_FORMAT_CHANGED);

@@ -823,9 +722,9 @@

     /**
      *  @copy flash.text.TextField#displayAsPassword
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get displayAsPassword():Boolean
     {
@@ -864,9 +763,9 @@

     /**
      *  @copy flash.text.TextField#embedFonts
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get embedFonts():Boolean
     {
@@ -905,9 +804,9 @@

     /**
      *  @copy flash.text.TextField#gridFitType
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get gridFitType():String
     {
@@ -950,20 +849,20 @@

     /**
      *  @copy flash.text.TextField#htmlText
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get htmlText():String
     {
     	if (_htmlText == null)
     	{
 			var htmlPreText:String;
-			if (_text.length && _text.charCodeAt(_text.length - 1) == 13)
+			if ( _text.length && _text.charCodeAt( _text.length - 1 ) == 13 )
 				htmlPreText = _text.substr(0, _text.length - 1); // trim at most 1 trailing CR
 			else
 				htmlPreText = _text;
-			var lines:Array =  htmlPreText.split(/\r/);
+			var lines:Array =  htmlPreText.split( /\r/ );

 			// TODO: is font value platform-dependent???
 			var htmlFont:String = _defaultTextFormat.font ? _defaultTextFormat.font : "Times New Roman";
@@ -999,8 +898,8 @@
     		// but that's not what TextField does.
     	}

-//    	if (value == htmlText)
-//    		return;
+    	if (value == htmlText)
+    		return;

     	_htmlText = value;

@@ -1032,9 +931,9 @@

     /**
      *  @copy flash.text.TextField#length
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get length():int
     {
@@ -1052,9 +951,9 @@

     /**
      *  @copy flash.text.TextField#maxChars
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get maxChars():int
     {
@@ -1090,13 +989,13 @@

     /**
      *  @copy flash.text.TextField#maxScrollH
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get maxScrollH():int
     {
-    	if (_autoSize == TextFieldAutoSize.NONE)
+    	if ( _autoSize == TextFieldAutoSize.NONE )
     		validateNow();

     	return _maxScrollH;
@@ -1113,9 +1012,9 @@

     /**
      *  @copy flash.text.TextField#maxScrollV
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get maxScrollV():int
     {
@@ -1130,9 +1029,9 @@

     /**
      *  @copy flash.text.TextField#mouseWheelEnabled
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get mouseWheelEnabled():Boolean
     {
@@ -1160,9 +1059,9 @@

      /**
      *  @copy flash.text.TextField#multiline
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get multiline():Boolean
     {
@@ -1195,9 +1094,9 @@

     /**
      *  @copy flash.text.TextField#numLines
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get numLines():int
     {
@@ -1217,9 +1116,9 @@

     /**
      *  @copy flash.text.TextField#restrict
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get restrict():String
     {
@@ -1252,9 +1151,9 @@

     /**
      *  @copy flash.text.TextField#scrollH
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get scrollH():int
     {
@@ -1295,9 +1194,9 @@

     /**
      *  @copy flash.text.TextField#scrollV
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get scrollV():int
     {
@@ -1333,9 +1232,9 @@

     /**
      *  @copy flash.text.TextField#selectable
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get selectable():Boolean
     {
@@ -1366,9 +1265,9 @@

     /**
      *  @copy flash.text.TextField#selectionBeginIndex
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get selectionBeginIndex():int
     {
@@ -1384,9 +1283,9 @@

     /**
      *  @copy flash.text.TextField#selectionEndIndex
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get selectionEndIndex():int
     {
@@ -1407,9 +1306,9 @@

     /**
      *  @copy flash.text.TextField#sharpness
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get sharpness():Number
     {
@@ -1452,9 +1351,9 @@

     /**
      *  @copy flash.text.TextField#styleSheet
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get styleSheet():StyleSheet
     {
@@ -1487,6 +1386,26 @@
     	// scrollH/scrollV/bottomScrollV?
     }

+    /**
+     *  @private
+     */
+    static private function intToHexColor( color:Object ):String
+    {
+    	if ( color == null )
+    		return "000000";
+    	var colorInt:int = int(color);
+    	var s:String = new String();
+    	var hexCode:Array = ["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];
+    	for (var i:int = 0; i < 6; ++i)
+    	{
+    		var c:int = colorInt & 15;
+    		s = hexCode[c] + s;
+    		colorInt >>= 4;
+    	}
+    	return s;
+    }
+
+
     //----------------------------------
     //  text
     //----------------------------------
@@ -1498,9 +1417,9 @@

     /**
      *  @copy flash.text.TextField#text
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get text():String
     {
@@ -1516,7 +1435,7 @@
     	if (value == null)
     		throw new TypeError("Parameter text must be non-null.");

-    	var noNewlineText:String = value.replace(/\n/g, "\r");
+    	var noNewlineText:String = value.replace( /\n/g, "\r" );

     	if (noNewlineText == _text)
     		return;
@@ -1527,6 +1446,8 @@

     	// signals that htmlText needs to be regenerated
     	_htmlText = null;
+
+

     	setFlag(FLAG_TEXT_CHANGED |
     			FLAG_GRAPHICS_INVALID |
@@ -1557,9 +1478,9 @@

     /**
      *  @copy flash.text.TextField#textColor
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get textColor():uint
     {
@@ -1598,9 +1519,9 @@

     /**
      *  @copy flash.text.TextField#textHeight
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get textHeight():Number
     {
@@ -1620,9 +1541,9 @@

     /**
      *  @copy flash.text.TextField#textWidth
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get textWidth():Number
     {
@@ -1642,9 +1563,9 @@

     /**
      *  @copy flash.text.TextField#thickness
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get thickness():Number
     {
@@ -1684,9 +1605,9 @@

     /**
      *  @copy flash.text.TextField#type
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get type():String
     {
@@ -1732,9 +1653,9 @@
     }
     /**
      *  @copy flash.text.TextField#useRichTextClipboard
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function set useRichTextClipboard(value:Boolean):void
     {
@@ -1754,9 +1675,9 @@

     /**
      *  @copy flash.text.TextField#wordWrap
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get wordWrap():Boolean
     {
@@ -1790,9 +1711,9 @@
     /**
 	 * Gets and sets the ITextLineCreator instance to be used for creating TextLines.  Override this if you need lines to be created in a different
 	 * SWF context than the one containing the TLF code.  The framework will supply a default implementation of ITextLineCreator if none is supplied by the caller.
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function get textLineCreator():ITextLineCreator
     {
@@ -1811,9 +1732,9 @@

     /**
      *  @copy flash.text.TextField#appendText()
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function appendText(newText:String):void
     {
@@ -1822,9 +1743,9 @@

     /**
      *  @copy flash.text.TextField#getCharBoundaries()
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function getCharBoundaries(charIndex:int):Rectangle
     {
@@ -1833,9 +1754,9 @@

     /**
      *  @copy flash.text.TextField#getCharIndexAtPoint()
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function getCharIndexAtPoint(x:Number, y:Number):int
     {
@@ -1844,9 +1765,9 @@

     /**
      *  @copy flash.text.TextField#getFirstCharInParagraph()
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function getFirstCharInParagraph(charIndex:int):int
     {
@@ -1855,9 +1776,9 @@

     /**
      *  @copy flash.text.TextField#getLineIndexAtPoint()
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function getLineIndexAtPoint(x:Number, y:Number):int
     {
@@ -1866,9 +1787,9 @@

     /**
      *  @copy flash.text.TextField#getLineIndexOfChar()
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function getLineIndexOfChar(charIndex:int):int
     {
@@ -1877,9 +1798,9 @@

     /**
      *  @copy flash.text.TextField#getLineLength()
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function getLineLength(lineIndex:int):int
     {
@@ -1888,34 +1809,34 @@

     /**
      *  @copy flash.text.TextField#getLineMetrics()
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function getLineMetrics(lineIndex:int):TextLineMetrics
     {
     	validateNow();

-    	if (lineIndex < 0 || lineIndex >= numChildren)
-    		throw new RangeError("The supplied index is out of bounds"); // matching TextField behavior
-
-    	var textLine:TextLine = TextLine(getChildAt(lineIndex));
+    	if ( lineIndex < 0 || lineIndex >= numChildren )
+    		throw new RangeError( "The supplied index is out of bounds" ); // matching TextField behavior
+
+    	var textLine:TextLine = TextLine( getChildAt( lineIndex ) );
     	var height:Number;
     	if (lineIndex == this.numChildren - 1)
     	 	height = Number(_defaultTextFormat.size) + 2; /// how to correctly determine "height" here?
     	else
     	{
-	    	var nextTextLine:TextLine = TextLine(getChildAt(lineIndex + 1));
+	    	var nextTextLine:TextLine = TextLine( getChildAt( lineIndex + 1 ) );
     		height = nextTextLine.y - textLine.y;
     	}
-    	return new TextLineMetrics(textLine.x, textLine.width, height, textLine.ascent, textLine.descent, height - textLine.ascent - textLine.descent);
+    	return new TextLineMetrics( textLine.x, textLine.width, height, textLine.ascent, textLine.descent, height - textLine.ascent - textLine.descent );
     }

     /**
      *  @copy flash.text.TextField#getLineOffset()
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function getLineOffset(lineIndex:int):int
     {
@@ -1924,9 +1845,9 @@

     /**
      *  @copy flash.text.TextField#getLineText()
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function getLineText(lineIndex:int):String
     {
@@ -1935,9 +1856,9 @@

     /**
      *  @copy flash.text.TextField#getParagraphLength()
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function getParagraphLength(charIndex:int):int
     {
@@ -1946,9 +1867,9 @@

     /**
      *  @copy flash.text.TextField#getTextFormat()
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function getTextFormat(beginIndex:int = -1, endIndex:int = -1):TextFormat
     {
@@ -1957,9 +1878,9 @@

     /**
      *  @copy flash.text.TextField#replaceSelectedText()
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function replaceSelectedText(value:String):void
     {
@@ -1968,22 +1889,22 @@

     /**
      *  @copy flash.text.TextField#replaceText()
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function replaceText(beginIndex:int, endIndex:int,
     							newText:String):void
     {
-    	if (beginIndex <= endIndex)
-    		text = text.substring(0, beginIndex) + newText + text.substring(endIndex);
+    	if ( beginIndex <= endIndex )
+    		text = text.substring( 0, beginIndex ) + newText + text.substring( endIndex );
     }

     /**
      *  @copy flash.text.TextField#setSelection()
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function setSelection(beginIndex:int, endIndex:int):void
     {
@@ -1992,9 +1913,9 @@

     /**
      *  @copy flash.text.TextField#setTextFormat()
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function setTextFormat(format:TextFormat,
                            		  beginIndex:int = -1,
@@ -2007,9 +1928,9 @@

     /**
      *  @copy flash.text.TextField#getImageReference()
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @langversion 3.0
+     * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @langversion 3.0
      */
     public function getImageReference(id:String):DisplayObject
     {
@@ -2026,24 +1947,18 @@
      *  @private
      */
     private function testFlag(mask:uint):Boolean
-    {
-    	return (flags & mask) != 0;
-    }
+    { return (flags & mask) != 0; }

     /**
      *  @private
      */
     private function setFlag(mask:uint):void
-    {
-    	flags |= mask;
-    }
+    { flags |= mask; }

     private function clearFlag(mask:uint):void
-    {
-    	flags &= ~mask;
-    }
-
-    private function setFlagToValue(mask:uint, value:Boolean):void
+    { flags &= ~mask; }
+
+    private function setFlagToValue(mask:uint,value:Boolean):void
     {
     	if (value)
     		flags |= mask;
@@ -2058,11 +1973,18 @@
      */
     private function invalidate():void
     {
-		//TODO
-		//CONFIG::debug { assert(!testFlag(FLAG_VALIDATE_IN_PROGRESS), "invalidating during validateNow()"); }
+		CONFIG::debug { assert( !testFlag(FLAG_VALIDATE_IN_PROGRESS), "invalidating during validateNow()"); }

     	if (stage)
     		stage.invalidate();
+    }
+
+    static private function rint(x:Number):Number
+    {
+    	var i:Number = Math.round(x);
+    	if ( i - 0.5 == x && i & 1 )
+    		--i;
+    	return i;
     }

     /**
@@ -2074,12 +1996,8 @@
      */
     private function validateNow():void
     {
-    	if (!testFlag(ALL_INVALIDATION_FLAGS) ||
-    		testFlag(FLAG_VALIDATE_IN_PROGRESS))
-    	{
+    	if ( !testFlag( ALL_INVALIDATION_FLAGS ) || testFlag( FLAG_VALIDATE_IN_PROGRESS) )
     		return;
-    	}
-
     	setFlag(FLAG_VALIDATE_IN_PROGRESS);

     	// Determine the TLF formats based on the TextField's defaultTextFormat.
@@ -2087,16 +2005,16 @@
     	{
 			textFormatToTLFFormats();

-			hostFormat.lineBreak = LineBreak.EXPLICIT;
-			hostFormat.paddingLeft = 2;
-			hostFormat.paddingTop = 4;
-			hostFormat.paddingRight = 2;
-			hostFormat.paddingBottom = 2;
+			hostContainerFormat.lineBreak = LineBreak.EXPLICIT;
+			hostContainerFormat.paddingLeft = 2;
+			hostContainerFormat.paddingTop = 4;
+			hostContainerFormat.paddingRight = 2;
+			hostContainerFormat.paddingBottom = 2;
    		}

     	if (testFlag(FLAG_WORD_WRAP_CHANGED))
     	{
-    		hostFormat.lineBreak =
+    		hostContainerFormat.lineBreak =
     			wordWrap ? LineBreak.TO_FIT : LineBreak.EXPLICIT;
     	}

@@ -2134,7 +2052,7 @@
     		}
     	}

-    	clearFlag(ALL_INVALIDATION_FLAGS | FLAG_VALIDATE_IN_PROGRESS);
+    	clearFlag(ALL_INVALIDATION_FLAGS|FLAG_VALIDATE_IN_PROGRESS);
     }

     /**
@@ -2142,81 +2060,36 @@
      */
     private function textFormatToTLFFormats():void
     {
-    	hostFormat.textAlign =
-    		_defaultTextFormat.align ?
-    		_defaultTextFormat.align :
-    		TextFormatAlign.LEFT;
-
-    	hostFormat.textAlignLast = hostFormat.textAlign;
-
+    	hostParagraphFormat.textAlign = _defaultTextFormat.align ? _defaultTextFormat.align : TextFormatAlign.LEFT;;
+    	hostParagraphFormat.textAlignLast = hostParagraphFormat.textAlign;
     	//_defaultTextFormat.blockIndent
-
-    	hostFormat.fontWeight =
-    		_defaultTextFormat.bold ?
-    		FontWeight.BOLD :
-    		FontWeight.NORMAL;
-
+    	hostCharacterFormat.fontWeight = _defaultTextFormat.bold ?
+    								 FontWeight.BOLD :
+    								 FontWeight.NORMAL;
     	//_defaultTextFormat.bullet
-
-    	hostFormat.color =
-    		_defaultTextFormat.color ?
-    		_defaultTextFormat.color :
-    		0;
-
+    	hostCharacterFormat.color = _defaultTextFormat.color ? _defaultTextFormat.color : 0;
     	// TODO: is font value platform-dependent???
-    	hostFormat.fontFamily =
-    		_defaultTextFormat.font ?
-    		_defaultTextFormat.font :
-    		"Times New Roman";
-
+    	hostCharacterFormat.fontFamily = _defaultTextFormat.font ? _defaultTextFormat.font : "Times New Roman";
     	//_defaultTextFormat.indent;
-
-    	hostFormat.fontStyle =
-    		_defaultTextFormat.italic ?
-    		FontPosture.ITALIC :
-    		FontPosture.NORMAL;
-
-    	hostFormat.kerning =
-    		_defaultTextFormat.kerning ?
-    		Kerning.ON :
-    		Kerning.OFF;
-
-    	hostFormat.fontLookup =
-    		testFlag(FLAG_EMBED_FONTS) ?
-    		FontLookup.EMBEDDED_CFF :
-    		FontLookup.DEVICE;
-
+    	hostCharacterFormat.fontStyle = _defaultTextFormat.italic ?
+    								FontPosture.ITALIC :
+    								FontPosture.NORMAL;
+    	hostCharacterFormat.kerning = _defaultTextFormat.kerning ?
+    							  Kerning.ON :
+    							  Kerning.OFF;
+    	hostCharacterFormat.fontLookup = testFlag(FLAG_EMBED_FONTS) ?
+    								flash.text.engine.FontLookup.EMBEDDED_CFF :
+    								flash.text.engine.FontLookup.DEVICE;
     	//_defaultTextFormat.leading
-
-    	hostFormat.paragraphStartIndent =
-    		_defaultTextFormat.leftMargin ?
-    		_defaultTextFormat.leftMargin :
-    		0;
-
-    	hostFormat.trackingRight =
-    		_defaultTextFormat.letterSpacing ?
-    		_defaultTextFormat.letterSpacing :
-    		0;
-
-    	hostFormat.paragraphEndIndent =
-    		_defaultTextFormat.rightMargin ?
-    		_defaultTextFormat.rightMargin :
-    		0;
-
-    	hostFormat.fontSize =
-    		_defaultTextFormat.size ?
-    		_defaultTextFormat.size :
-    		12;
-
-    	hostFormat.tabStops = _defaultTextFormat.tabStops;
-
+    	hostParagraphFormat.paragraphStartIndent = _defaultTextFormat.leftMargin ? _defaultTextFormat.leftMargin : 0;
+    	hostCharacterFormat.trackingRight = _defaultTextFormat.letterSpacing? _defaultTextFormat.letterSpacing : 0;
+    	hostParagraphFormat.paragraphEndIndent = _defaultTextFormat.rightMargin ? _defaultTextFormat.rightMargin : 0;
+    	hostCharacterFormat.fontSize = _defaultTextFormat.size ? _defaultTextFormat.size : 12;
+    	hostParagraphFormat.tabStops = _defaultTextFormat.tabStops;
     	//_defaultTextFormat.target
-
-    	hostFormat.textDecoration =
-    		_defaultTextFormat.underline ?
-    		TextDecoration.UNDERLINE :
-    		TextDecoration.NONE;
-
+    	hostCharacterFormat.textDecoration = _defaultTextFormat.underline ?
+    									 TextDecoration.UNDERLINE :
+    									 TextDecoration.NONE;
     	//textFormat.url
     }

@@ -2237,34 +2110,30 @@

     	_bottomScrollV = 0;

-    	var textFlow:TextFlow = htmlImporter.importToFlow(_htmlText);
-    	trace(r);
-    	textFlow.hostFormat = hostFormat;
-
+    	factory.text = _text;
     	factory.compositionBounds = r;
+    	factory.spanFormat = hostCharacterFormat;
+    	factory.paragraphFormat = hostParagraphFormat;
+    	factory.textFlowFormat = hostContainerFormat;
     	factory.textLineCreator = _textLineCreator;
-    	factory.createTextLines(textLineFactoryCallback, textFlow);
+    	factory.createTextLines(textLineFactoryCallback);

     	if (_bottomScrollV == 0)
     	{
     		_bottomScrollV = 1;
 			_maxScrollV = 1;
     	}
-    	else
-    	{
+    	else
     		_maxScrollV = 1 + (_numLines - _bottomScrollV);
-    	}

-		// NOTE: It is understood that the Flash TextField clipping of text
-		// clips to a margin rect INSET from the TextField's boundary
-		// and that we currently (intentionally) do not match this behavior
-		// as a speed/memory optimization.
+		// NOTE: It is understood that  the Flash TextField clipping of text clips to a margin rect INSET from the TextField's boundary
+		// and that we currently (intentionally) do not match this behavior as a speed/memory optimization.

 		// Compute bounds of text content
-		var textBounds:Rectangle = new Rectangle(0, 0, 0, 0);
-		if (numChildren)
+		var textBounds:Rectangle = new Rectangle(0,0,0,0);
+		if ( numChildren )
 		{
-			var textLine:TextLine = TextLine(getChildAt(0));
+			var textLine : TextLine = TextLine(getChildAt(0));
 			textBounds.x = textLine.x;
 			textBounds.y = 0; // textLine.y - textLine.textHeight; Not quite right?
 			textBounds.width = textLine.textWidth;
@@ -2272,20 +2141,20 @@
 			for (var i:int = 1; i < numChildren; ++i)
 			{
 				textLine = TextLine(getChildAt(i));
-				var r2:Rectangle = new Rectangle(textLine.x, textLine.y - textLine.textHeight, textLine.textWidth, textLine.textHeight);
-				textBounds = textBounds.union(r2);
+				var r2:Rectangle = new Rectangle( textLine.x, textLine.y - textLine.textHeight, textLine.textWidth, textLine.textHeight );
+				textBounds = textBounds.union( r2 );
 			}
-			if (!textBounds.isEmpty())
-				textBounds = textBounds.union(new Rectangle(textBounds.x, 0, textBounds.y, textBounds.bottom));
+			if ( !textBounds.isEmpty() )
+				textBounds = textBounds.union( new Rectangle(textBounds.x, 0, textBounds.y, textBounds.bottom) );
 		}

     	_textWidth = textBounds.width;
     	_textHeight = textBounds.height + textBounds.y;

-    	if (_autoSize == TextFieldAutoSize.NONE)
+    	if ( _autoSize == TextFieldAutoSize.NONE )
     	{
-	    	_maxScrollH = _textWidth + hostFormat.paddingLeft + hostFormat.paddingRight - width;
-	    	if (_maxScrollH < 0)
+	    	_maxScrollH = _textWidth + hostContainerFormat.paddingLeft + hostContainerFormat.paddingRight - width;
+	    	if ( _maxScrollH < 0 )
 	    		_maxScrollH = 0;
 	    }
 	    else
@@ -2295,23 +2164,23 @@
     		var origWidth:Number = _width;
     		var origHeight:Number = _height;
     		_height = Math.ceil(_textHeight) + 4; // + 4 for standard margin size (possibly revisit this in the future)
-    		if (!wordWrap)
+    		if ( !wordWrap )
     		{
 	    		_width = Math.ceil(_textWidth) + 3; // + 3 for standard margin size (possibly revisit this in the future)

 	    		// adjust x for CENTER and RIGHT cases
-	    		if (_autoSize == TextFieldAutoSize.RIGHT)
+	    		if ( _autoSize == TextFieldAutoSize.RIGHT )
 	    			x += origWidth - _width;
-	    		else if (_autoSize == TextFieldAutoSize.CENTER)
+	    		else if ( _autoSize == TextFieldAutoSize.CENTER )
 	    			x += (origWidth - _width) / 2;
 	    	}
-    		if (_height != origHeight || _width != origWidth || x != origX)
-				setFlag(FLAG_GRAPHICS_INVALID);
+    		if ( _height != origHeight || _width != origWidth || x != origX )
+				setFlag( FLAG_GRAPHICS_INVALID );
     	}

-    	//trace("textBounds = ("+textBounds.x + "," + textBounds.y + "," + textBounds.right + "," + textBounds.bottom + ")");
-    	//trace("     r = ("+r.x + "," + r.y + "," + r.right + "," + r.bottom + ")");
+    	//trace( "textBounds = ("+textBounds.x + "," + textBounds.y + "," + textBounds.right + "," + textBounds.bottom + ")");
+    	//trace( "     r = ("+r.x + "," + r.y + "," + r.right + "," + r.bottom + ")");
     	if (textBounds.left < r.left ||
     	    textBounds.top < r.top ||
     	    textBounds.right > r.right ||
@@ -2323,14 +2192,14 @@
     			r.width += 1;
     			r.height += 1;
     		}
-    		//trace("clipping to w = " + r.width + ", h = " + r.height);
+    		//trace( "clipping to w = " + r.width + ", h = " + r.height );
             scrollRect = r;
     		setFlag(FLAG_SCROLL_RECT_IS_SET );
     	}
     	else
     	{
-    		//trace("not clipping");
-			if (testFlag(FLAG_SCROLL_RECT_IS_SET))
+    		//trace( "not clipping" );
+			if ( testFlag(FLAG_SCROLL_RECT_IS_SET) )
 			{
 	    		scrollRect = null;
 	    		clearFlag(FLAG_SCROLL_RECT_IS_SET);
@@ -2362,7 +2231,7 @@
     	{
     		var textLine:TextLine = TextLine(displayObject);
 	    	addChild(displayObject);
-    		if (textLine.y <= _height || _autoSize != TextFieldAutoSize.NONE)
+    		if ( textLine.y <= _height || _autoSize != TextFieldAutoSize.NONE )
 		    	++_bottomScrollV;
     		else
     			displayObject.visible = false; // hide it
@@ -2381,8 +2250,7 @@
      */
     private function addedToStageHandler(event:Event):void
     {
-    	// Having renderHandler() attached only while on the stage
-    	// gives a performance improvement.
+    	// having renderHandler attached only while on the stage gives a performance improvement.
      	removeEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
 	   	addEventListener(Event.RENDER, renderHandler);
     	addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler);
@@ -2409,4 +2277,3 @@
 }

 }
-


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

--- frameworks/projects/airframework/src/mx/skins/halo/WindowRestoreButtonSkin.as
+++ frameworks/projects/airframework/src/mx/skins/halo/WindowRestoreButtonSkin.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 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.skins.halo
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 3031
Author:   chaase@adobe.com
Date:     2008-08-28T21:17:21.801208Z

Log Message:
-----------
Fixed SDK-16615, SDK-16576, SDK-16631, SDK-16635, TH-1507, SDK-16622. This is another round of Animation/effect changes. Some are API improvements (such as adding proper event dispatching to Animate), most are fixes for various SDK and Thermo bugs that have been filed. Here's an explanation of the changes per file:

Animate.as: (sdk-16622)
All of the changes here are to add AnimationEvent dispatching to this class, similar to what we had in TweenEffect for TweenEvent. Note that we have a new event now, ANIMATION_REPEAT, and that ANIMATION_END only gets sent out once for each animation (instead of after each repetition, which is what the Flex3 effects did)

Animation.as: (sdk-16635)
We were noop'ing 0-duration animations. We now handle this correctly by sending out a START event, then send out UPDATE/END events with the final value

AnimateInstance.as:
These changes relate to two problems/fixes:
- Dispatching events correctly (sdk-16622)
- Handling styles correctly before effects are completely set up (sdk-16615)

MoveInstance.as: (sdk-16631)
We didn't handle the situation where the user supplied only one of left/right or one of bottom/top.

TintInstance.as: (sdk-16615)
We weren't correctly detecting that colors were not being set by the user, which messed up assumptions for transition from/to values

ColorInterpolator.as (sdk-16576)
Removed redundant line of code

Tint.as: (sdk-16615)
Fixes to support property coloring during transitions

Effect.as:
Removed trace() statements that crept in there in an earlier checkin

Reviewed by Glenn
tests: checkintests

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/AnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/TintInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Animate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Tint.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Animation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/MoveInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/interpolation/ColorInterpolator.as</path>

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

--- frameworks/projects/spark/src/spark/effects/supportClasses/AnimateInstance.as
+++ frameworks/projects/spark/src/spark/effects/supportClasses/AnimateInstance.as
@@ -225,7 +225,7 @@
         }
         play();
     }
-
+
     /**
      * Starts this effect. Performs any final setup for each property
      * from/to values and starts an Animation that will update that property.
@@ -314,7 +314,9 @@
             // Only one property; don't bother with the arrays
             animation = new Animation(fromValue, toValue, duration);
         }
+        animation.addEventListener(AnimationEvent.ANIMATION_START, startHandler);
         animation.addEventListener(AnimationEvent.ANIMATION_UPDATE, updateHandler);
+        animation.addEventListener(AnimationEvent.ANIMATION_REPEAT, repeatHandler);
         animation.addEventListener(AnimationEvent.ANIMATION_END, endHandler);

         if (_seekTime > 0)
@@ -362,22 +364,75 @@
     }

     /**
+     * Handles start events from the animation.
+     * If you override this method, ensure that you call the super method.
+     */
+    protected function startHandler(event:AnimationEvent):void
+    {
+        dispatchEvent(event);
+    }
+
+    /**
      * Handles update events from the animation.
+     * If you override this method, ensure that you call the super method.
      */
     protected function updateHandler(event:AnimationEvent):void
     {
         setVals(event.value);
+        dispatchEvent(event);
+    }
+
+    /**
+     * Handles repeat events from the animation.
+     * If you override this method, ensure that you call the super method.
+     */
+    protected function repeatHandler(event:AnimationEvent):void
+    {
+        dispatchEvent(event);
     }

     /**
      * Handles the end event from the animation. The value here is an Array of
      * values, one for each 'property' in our propertyValuesList.
+     * If you override this method, ensure that you call the super method.
      */
     protected function endHandler(event:AnimationEvent):void
     {
+        dispatchEvent(event);
         finishEffect();
     }
-
+
+    /**
+     * Utility function to handle situation where values may be queried or
+     * set on the target prior to completely setting up the effect's
+     * propertyValuesList data values (from which the styleMap is created)
+     */
+    private function setupStyleMapEntry(property:String):void
+    {
+        // TODO (chaase): Find a better way to set this up just once
+        if (isStyleMap[property] == undefined)
+        {
+            if (property in target)
+            {
+                isStyleMap[property] = false;
+            }
+            else
+            {
+                try {
+                    target.getStyle(property);
+                    isStyleMap[property] = true;
+                }
+                catch (err:Error)
+                {
+                    throw new Error("Property " + property + " is neither " +
+                        "a property or a style on object " + target + ": " + err);
+                }
+                // TODO: check to make sure that the throw above won't
+                // let the code flow get to here
+            }
+        }
+    }
+
     /**
      *  Utility function that sets the named property on the target to
      *  the given value. Handles setting the property as either a true
@@ -388,7 +443,9 @@
     {
         if (roundValues && (value is Number))
             value = Math.round(Number(value));
-
+
+        // TODO (chaase): Find a better way to set this up just once
+        setupStyleMapEntry(property);
         if (!isStyleMap[property])
             target[property] = value;
         else
@@ -403,6 +460,8 @@
      */
     protected function getCurrentValue(property:String):Number
     {
+        // TODO (chaase): Find a better way to set this up just once
+        setupStyleMapEntry(property);
         if (!isStyleMap[property])
             return target[property];
         else


Transferred from the Adobe Open Source Subversion Repository

Revision: 10402
Author:   gruehle@adobe.com
Date:     2009-09-18T20:08:24.668748Z

Log Message:
-----------
Move the focus exclusion code from FocusSkin to SparkSkin. Refactor common code in FocusSkin and ErrorSkin into a new HighlightBitmapCaptureSkin base class. Fix focus/error skin rendering issues with contentBackgroundAlpha set to low values.

QE notes: -
Doc notes: Added new class HighlightBitmapCaptureSkin.
Bugs: SDK-23209, SDK-23204, SDK-23200
Reviewer: Ely
Tests run: checkintests, mustella gumbo Button, List, CheckBox, TextInput
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/SparkSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Skin.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/HighlightBitmapCaptureSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/ErrorSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/FocusSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/ScrollerSkin.mxml</path>

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

--- frameworks/projects/spark/src/spark/skins/spark/HighlightBitmapCaptureSkin.as
+++ frameworks/projects/spark/src/spark/skins/spark/HighlightBitmapCaptureSkin.as
@@ -0,0 +1,226 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2008 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package spark.skins.spark
+{
+
+    import flash.display.Bitmap;
+    import flash.display.BitmapData;
+    import flash.display.IBitmapDrawable;
+    import flash.events.Event;
+    import flash.geom.ColorTransform;
+    import flash.geom.Matrix;
+    import flash.geom.Matrix3D;
+    import flash.geom.Rectangle;
+
+    import mx.core.UIComponent;
+    import mx.core.mx_internal;
+    import mx.events.FlexEvent;
+
+    import spark.components.supportClasses.SkinnableComponent;
+    import spark.skins.SparkSkin;
+
+    use namespace mx_internal;
+
+    /**
+     *  Base class for skins that do a bitmap capture of a target components
+     *  and apply a filter to the bitmap.
+     *  This is the base class for FocusSkin and ErrorSkin.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public class HighlightBitmapCaptureSkin extends UIComponent
+    {
+        include "../../core/Version.as";
+
+        //--------------------------------------------------------------------------
+        //
+        //  Class constants
+        //
+        //--------------------------------------------------------------------------
+
+        //--------------------------------------------------------------------------
+        //
+        //  Class variables
+        //
+        //--------------------------------------------------------------------------
+
+        private static var capturingBitmap:Boolean = false;
+        private static var colorTransform:ColorTransform = new ColorTransform(
+            1.01, 1.01, 1.01, 2);
+        private static var rect:Rectangle = new Rectangle();
+
+        //--------------------------------------------------------------------------
+        //
+        //  Constructor
+        //
+        //--------------------------------------------------------------------------
+
+        /**
+         * Constructor.
+         */
+        public function HighlightBitmapCaptureSkin()
+        {
+            super();
+        }
+
+        //--------------------------------------------------------------------------
+        //
+        //  Variables
+        //
+        //--------------------------------------------------------------------------
+
+        /**
+         *  Bitmap capture of the target component.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        protected var bitmap:Bitmap;
+
+        /**
+         *  @private
+         */
+        private var _target:SkinnableComponent;
+
+        /**
+         *  Object to target.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        public function get target():SkinnableComponent
+        {
+            return _target;
+        }
+
+        public function set target(value:SkinnableComponent):void
+        {
+            _target = value;
+
+            // Add an "updateComplete" listener to the skin so we can redraw
+            // whenever the skin is drawn.
+            if (_target.skin)
+                _target.skin.addEventListener(FlexEvent.UPDATE_COMPLETE,
+                    skin_updateCompleteHandler, false, 0, true);
+        }
+
+        /**
+         *  Number of padding pixels to put around the bitmap.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        protected function get borderWeight():Number
+        {
+            return 1;
+        }
+
+        //--------------------------------------------------------------------------
+        //
+        //  Overridden methods
+        //
+        //--------------------------------------------------------------------------
+
+        override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+        {
+            // if we weren't handed a targetObject then exit early
+            if (!target)
+                return;
+
+            var bitmapData:BitmapData = new BitmapData(
+                target.width + (borderWeight * 2),
+                target.height + (borderWeight * 2), true, 0);
+            var m:Matrix = new Matrix();
+
+            capturingBitmap = true;
+
+            // Ensure no 3D transforms apply, as this skews our snapshot bitmap.
+            var transform3D:Matrix3D = null;
+            if (target.$transform.matrix3D)
+            {
+                transform3D = target.$transform.matrix3D;
+                target.$transform.matrix3D = null;
+            }
+
+            // If the target object already has a focus skin, make sure it is hidden.
+            if (target.focusObj)
+                target.focusObj.visible = false;
+
+
+            var skin:SparkSkin = target.skin as SparkSkin;
+            if (skin)
+                skin.beginHighlightBitmapCapture();
+
+            m.tx = borderWeight;
+            m.ty = borderWeight;
+            bitmapData.draw(target as IBitmapDrawable, m);
+
+            if (skin)
+                skin.endHighlightBitmapCapture();
+
+
+            // Show the focus skin, if needed.
+            if (target.focusObj)
+                target.focusObj.visible = true;
+
+            // Transform the color to remove the transparency. The GlowFilter has the "knockout" property
+            // set to true, which removes this image from the final display, leaving only the outer glow.
+            rect.x = rect.y = borderWeight;
+            rect.width = target.width;
+            rect.height = target.height;
+            bitmapData.colorTransform(rect, colorTransform);
+
+            if (!bitmap)
+            {
+                bitmap = new Bitmap();
+                addChild(bitmap);
+            }
+
+            bitmap.x = bitmap.y = -borderWeight;
+            bitmap.bitmapData = bitmapData;
+
+            processBitmap();
+
+            // Restore original 3D matrix if applicable.
+            if (transform3D)
+                target.$transform.matrix3D = transform3D;
+
+            capturingBitmap = false;
+        }
+
+        /**
+         *  Apply any post-processing to the captured bitmap.
+         */
+        protected function processBitmap():void
+        {
+        }
+
+        /**
+         *  @private
+         */
+        private function skin_updateCompleteHandler(event:Event):void
+        {
+            // We need to redraw whenever the target object skin redraws.
+            if (!capturingBitmap)
+                invalidateDisplayList();
+        }
+    }
+}