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

--- frameworks/projects/spark/src/spark/components/TextArea.as
+++ frameworks/projects/spark/src/spark/components/TextArea.as
@@ -361,6 +361,23 @@
     //  Overridden properties
     //
     //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  suggestedFocusSkinExclusions
+    //----------------------------------
+
+    /**
+     * @private
+     */
+    private static const focusExclusions:Array = ["scroller", "textDisplay"];
+
+    /**
+     *  @private
+     */
+    override public function get suggestedFocusSkinExclusions():Array
+    {
+        return focusExclusions;
+    }

     //----------------------------------
     //  text


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

--- frameworks/projects/framework/src/mx/core/IProgrammaticSkin.as
+++ frameworks/projects/framework/src/mx/core/IProgrammaticSkin.as
@@ -15,16 +15,31 @@
 /**
  *  The IProgrammaticSkin interface defines the interface that skin classes must implement
  *  if they use the name property skin interface.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public interface IProgrammaticSkin
 {
     /**
      *  @copy mx.skins.ProgrammaticSkin#validateNow()
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     function validateNow():void;

     /**
      *  @copy mx.skins.ProgrammaticSkin#validateDisplayList()
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     function validateDisplayList():void;
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 4520
Author:   gosmith@adobe.com
Date:     2009-01-14T01:07:53.388463Z

Log Message:
-----------
Accessibility changes to List, DataGrid, Menu, and Tree, as requested by Freedom Scientific, to behave more like their corresponding standard Windows controls.

List, DataGrid, and Menu no longer report an accessibility value, either for the control itself or for its child items.

Tree no longer reports a value value for itself. For tree items the value is the indentation level as a String: "0", "1", "2", etc. Previously the top-level items had value "1" instead of "0".

QE Notes: None
Doc Notes: None
Bugs: SDK-17755
Reviewer: Deepa

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/DataGridAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/TreeAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/MenuAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/ListBaseAccImpl.as</path>

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

--- frameworks/projects/mx/src/mx/accessibility/DataGridAccImpl.as
+++ frameworks/projects/mx/src/mx/accessibility/DataGridAccImpl.as
@@ -163,96 +163,6 @@
 	override public function get_accRole(childID:uint):uint
 	{
 		return childID == 0 ? role : ROLE_SYSTEM_LISTITEM;
-	}
-
-	/**
-	 *  @private
-	 *  IAccessible method for returning the value of the ListItem/DataGrid
-	 *  which is spoken out by the screen reader
-	 *  The DataGrid should return the name of the currently selected item
-	 *  with m of n string as value when focus moves to DataGrid.
-	 *
-	 *  @param childID uint
-	 *
-	 *  @return Name String
-	 */
-	override public function get_accValue(childID:uint):String
-	{
-		var accValue:String;
-
-		var dataGrid:DataGrid = DataGrid(master);
-
-		if (childID == 0)
-		{
-			var row:int;
-			var item:Object;
-			var columns:Array;
-			var n:int;
-			var i:int;
-
-			if (!dataGrid.editable)
-			{
-				row = dataGrid.selectedIndex;
-				if (row > -1)
-				{
-					item = getItemAt(row);
-
-					if (item is String)
-					{
-						accValue = "Row " + (row + 1) + " of " +
-								   dataGrid.dataProvider.length + " " + item;
-					}
-					else
-					{
-						accValue = "Row " + (row + 1)  + " of " + dataGrid.dataProvider.length;
-						columns = dataGrid.columns;
-						n = columns.length;
-						for (i = 0; i < n; i++)
-						{
-							accValue += " " + columns[i].headerText + " " + columns[i].itemToLabel(item);
-						}
-					}
-				}
-			}
-			else
-			{
-				var coord:Object = dataGrid.editedItemPosition;
-				if (coord)
-				{
-					row = coord.rowIndex;
-					var col:int = coord.columnIndex;
-					item = getItemAt(row);
-
-					if (item is String)
-					{
-						accValue = "Row " + (row + 1) + " of " +
-								   dataGrid.dataProvider.length + " " + item;
-					}
-					else
-					{
-						columns = dataGrid.columns;
-						var itemName:String = columns[i].itemToLabel(item);
-						var headerText:String = columns[col].headerText;
-						accValue = "Row " + (row + 1) + " of " + dataGrid.dataProvider.length;
-
-						//if (dataGrid.selectable == true &&
-						//    dataGrid.isItemSelected(row.data))
-						{
-							n = columns.length;
-							for (i = 0; i < n; i++)
-							{
-								accValue += " " + columns[i].headerText + " " + columns[i].itemToLabel(item);
-							}
-						}
-
-						accValue += ", Editing " + headerText + " " +
-								  itemName;
-					}
-				}
-			}
-		}
-
-		return accValue;
 	}

 	/**


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

--- frameworks/projects/spark/src/spark/components/ToggleButton.as
+++ frameworks/projects/spark/src/spark/components/ToggleButton.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.components
 {


Now always saving singletons to dictionary lookup.

--- WeaveAPI/src/weave/api/WeaveAPI.as
+++ WeaveAPI/src/weave/api/WeaveAPI.as
@@ -312,9 +312,10 @@
 		 *
 		 * @param singletonInterface An interface to a singleton class.
 		 * @return The singleton instance that implements the specified interface.
-		 */
+		 */
 		public static function getSingletonInstance(singletonInterface:Class):*
 		{
+			// TEMPORARY SOLUTION until everything is a plug-in.
 			if (!_initialized)
 			{
 				_initialized = true;
@@ -333,7 +334,7 @@
 				{
 					// This may fail if there is no registered class,
 					// or the class doesn't have a getInstance() method.
-					return Singleton.getInstance(interfaceName);
+					result = Singleton.getInstance(interfaceName);
 				}
 				catch (e:Error)
 				{


Fixed duplicate variable name warning

Fixed duplicate variable name warning

--- src/asfac/src/com/thedevstop/asfac/AsFactory.as
+++ src/asfac/src/com/thedevstop/asfac/AsFactory.as
@@ -279,8 +279,8 @@
 			{
 				if (hasInjectMetadata(variable))
 				{
-					var propertyType:Class = Class(getDefinitionByName(variable.@type.toString()));
-					typeDescription.injectableProperties.push( { name:variable.@name.toString(), type:propertyType } );
+					var variableType:Class = Class(getDefinitionByName(variable.@type.toString()));
+					typeDescription.injectableProperties.push( { name:variable.@name.toString(), type:variableType } );
 				}
 			}


:memo:

:memo:

--- index.as
+++ index.as
@@ -1,5 +1,4 @@

-// TODO: Determine if AF is stored as AF or FA in memory
 // TODO: Finish opcodes
 // TODO: Timing
 // TODO: Tileset rendering


Fixed a bug in Slider thumb sizing when skin is attached to a slider that already has a thumb button created already.

--- src/org/openPyro/controls/Slider.as
+++ src/org/openPyro/controls/Slider.as
@@ -99,7 +99,7 @@
 				{
 					_thumbButton.percentUnusedHeight = 100;
 				}
-				_thumbButton.width = 100;
+				_thumbButton.width = _thumbButtonWidth;
 			}

 			addChild(_thumbButton);
@@ -130,7 +130,12 @@
 			if(this._thumbButton)
 			{
 				_thumbButton.skin = skin;
-				_thumbButton.width = _thumbButtonWidth;
+			//if(_thumbButton is MeasurableControl && MeasurableControl(_thumbButton).usesMeasurementStrategy()){
+			//		_thumbButton.width = _thumbButtonWidth;
+			//	}
+			//	if(isNaN(_thumbButton.getExplicitOrMeasuredHeight())){
+			//		_thumbButton.height = _thumbButtonHeight;
+			//	}
 			}

 		}


Transferred from the Adobe Open Source Subversion Repository

Revision: 13742
Author:   rbhat@adobe.com
Date:     2010-01-25T05:44:35.924793Z

Log Message:
-----------
sbannur: Reverting the changes which were done, in previous revision by re-adding the patent comments, this will be done in the branch.

QE notes: None
Doc notes: None
Bugs:
Reviewer: R K Bhat
Tests run: None
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/datavisualization/src/mx/charts/chartClasses/IDataCanvas.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/datavisualization/src/mx/charts/chartClasses/CartesianDataCanvas.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/datavisualization/src/mx/charts/chartClasses/CartesianCanvasValue.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/datavisualization/src/mx/charts/chartClasses/PolarDataCanvas.as</path>

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

--- frameworks/projects/charts/src/mx/charts/chartClasses/IDataCanvas.as
+++ frameworks/projects/charts/src/mx/charts/chartClasses/IDataCanvas.as
@@ -7,6 +7,10 @@
 //  NOTICE: Adobe permits you to use, modify, and distribute this file
 //  in accordance with the terms of the license agreement accompanying it.
 //
+//  Adobe Patent or Adobe Patent Pending Invention Included Within this File
+//  Adobe patent application tracking B503, entitled Charting Data Graphics -
+//  graphics drawing API that allows to draw in data space, inventors Ely Greenfield.
+//  AdobePatentID="B503"
 //
 ////////////////////////////////////////////////////////////////////////////////////////


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

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

 package spark.filters
 {


add key_esc to kill quickmenu

add key_esc to kill quickmenu

--- Bin/Data/Scripts/Editor/EditorUI.as
+++ Bin/Data/Scripts/Editor/EditorUI.as
@@ -1004,6 +1004,11 @@
             UnhideUI();
         else if (console.visible)
             console.visible = false;
+        else if (quickMenu.visible)
+        {
+            quickMenu.visible = false;
+            quickMenu.enabled = false;
+        }
         else
         {
             UIElement@ front = ui.frontElement;


Transferred from the Adobe Open Source Subversion Repository

Revision: 20844
Author:   jimurphy@adobe.com
Date:     2011-03-14T15:10:07.899037Z

Log Message:
-----------
block hero_private revs 20698,20699,20702 from being merged into trunk
revert 20839,20841,20842,20843

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/spark/src/spark/formatters/NumberFormatter.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSCondition.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/ISortField.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/spark/src/spark/formatters/CurrencyFormatter.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/BitmapFill.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/spark/src/spark/formatters/DateTimeFormatter.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/charts/src/mx/charts/chartClasses/CartesianChart.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/GradientStroke.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/ArrayList.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/GradientBase.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/charts/src/mx/charts/chartClasses/PolarChart.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/ColorDodgeShader.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/charts/src/mx/charts/chartClasses/PolarDataCanvas.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/OnDemandEventDispatcher.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/charts/src/mx/charts/series/PlotSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TabBar.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/SolidColorStroke.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/Transform.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionViewCursor.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSStyleDeclaration.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/FlexEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/charts/src/mx/charts/series/CandlestickSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/StringUtil.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/spark/src/spark/globalization/StringTools.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/CompoundTransform.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/AdvancedStyleClient.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/binding/utils/ChangeWatcher.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/LinearGradientStroke.as</path>

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

--- frameworks/projects/framework/src/mx/styles/CSSCondition.as
+++ frameworks/projects/framework/src/mx/styles/CSSCondition.as
@@ -122,7 +122,7 @@

     /**
      *  The value of this condition without any CSS syntax. To get a String
-     *  representation that includes CSS syntax, call the toString() method.
+     *  representation that includes CSS syntax, call the toString() method.
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -186,8 +186,6 @@
     }

     /**
-     * Returns a String representation of this condition.
-     *
      *  @return A String representation of this condition, including CSS syntax.
      *
      *  @langversion 3.0


Transferred from the Adobe Open Source Subversion Repository

Revision: 3450
Author:   rfrishbe@adobe.com
Date:     2008-10-02T04:54:40.265411Z

Log Message:
-----------
Couple of changes to Group and DataGroup:

1.  Got rid of content_changing, content_changed, dataProvider_changing, and dataProvider_changed events.  The events both group and datagroup emit are the item add and item remove events.  Fixed up Selector, DataComponent, and ItemsComponent to not key off of these events anymore.

2.  Clean up Group's canShareDisplayObject from the blendMode change

3.  Fix up DataGroup to deal with a case where a GraphicElement's itemRenderer's group was holding on to the display object.  When the graphic element was pushed into another itemRenderer, we tried to remove the graphic element's display object from its parent, but calling removeChild() on a Group RTE's.  We need to revisit the fix here, and possibly add methods for removing display objects to Group, or don't RTE in Group on removeChild/addChild, or add some code so itemRenderer's can clean themselves up afterwards...at any rate, this fix will be revisited.

QE: Yes
Doc: Yes - event removed
Bugs: SDK-17135
Reviewer: Deepa

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/DataComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/Selector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/events/FlexEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/ItemsComponent.as</path>

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

--- frameworks/projects/spark/src/spark/components/DataGroup.as
+++ frameworks/projects/spark/src/spark/components/DataGroup.as
@@ -36,14 +36,16 @@
 import mx.styles.IStyleClient;

 /**
- *  Dispatched prior to the dataProvider being changed.
+ *  Dispatched when an item is added to the content holder.
+ *  event.relatedObject is the visual item that was added.
  */
-[Event(name="dataProviderChanging", type="flex.events.FlexEvent")]
+[Event(name="itemAdd", type="flex.events.ItemExistenceChangedEvent")]

 /**
- *  Dispatched after the dataProvider has changed.
+ *  Dispatched when an item is removed from the content holder.
+ *  event.relatedObject is the visual item that was removed.
  */
-[Event(name="dataProviderChanged", type="flex.events.FlexEvent")]
+[Event(name="itemRemove", type="flex.events.ItemExistenceChangedEvent")]

 [DefaultProperty("dataProvider")]
 /**
@@ -183,13 +185,27 @@
     }

     protected function initializeDataProvider():void
-    {
-        dispatchEvent(new FlexEvent(FlexEvent.DATA_PROVIDER_CHANGING));
-
+    {
         // Get rid of existing display object children.
         // !!!!! This should probably be done through change notification
         for (var idx:int = numChildren; idx > 0; idx--)
             super.removeChildAt(0);
+
+        // TODO: get rid of this code
+        // An item renderer who's rendering a graphic may not be used anymore and is
+        // removed above.  However, the graphic item's display object is still
+        // attached to that item renderer.  We need to clear out these display objects.
+        // For now, this is a cheap way to do it.
+        // This might orphan the old display object in its previous container.
+        if (dataProvider != null)
+        {
+            for (var j:int = 0; j < dataProvider.length; j++)
+            {
+                var item:GraphicElement = dataProvider.getItemAt(j) as GraphicElement;
+                if (item)
+                    item.displayObject = item.sharedDisplayObject = null;
+            }
+        }

         if (_dataProvider != null)
         {
@@ -223,8 +239,6 @@
                 }
             }
         } */
-
-        dispatchEvent(new FlexEvent(FlexEvent.DATA_PROVIDER_CHANGED));
     }

     protected function createVisualForItem(item:Object):DisplayObject
@@ -260,6 +274,7 @@
         if (!itemSkin && item is GraphicElement)
         {
             var graphicItem:GraphicElement = GraphicElement(item);
+            graphicItem.elementHost = this;

             if (!graphicItem.displayObject)
                 graphicItem.displayObject = graphicItem.createDisplayObject();
@@ -303,18 +318,13 @@
     {
         super.commitProperties();

-        if (dataProviderChanged)
+        if (dataProviderChanged || itemRendererChanged)
         {
             dataProviderChanged = false;
-            initializeDataProvider();
-
-            // maskChanged = true; TODO (rfrishbe): need this maskChanged?
-        }
-
-        if (itemRendererChanged)
-        {
             itemRendererChanged = false;
             initializeDataProvider();
+
+            // maskChanged = true; TODO (rfrishbe): need this maskChanged?
         }

         // Check whether we manage the elements, or are they managed by an ItemRenderer
@@ -405,7 +415,6 @@
         if (item is GraphicElement)
         {
             var graphicItem:GraphicElement = GraphicElement(item);
-            graphicItem.elementHost = this;

             // If a styleable GraphicElement is being added,
             // build its protochain for use by getStyle().


Transferred from the Adobe Open Source Subversion Repository

Revision: 13087
Author:   hmuller@adobe.com
Date:     2009-12-18T00:47:35.237277Z

Log Message:
-----------
Guard against null DataGroup.dataProvider in getItemIndices().

QE notes:
Doc notes:
Bugs: sdk-24787
Reviewer: Evtim
Tests run:
Is noteworthy for integration: no

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataGroup.as

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

--- frameworks/projects/spark/src/spark/components/DataGroup.as
+++ frameworks/projects/spark/src/spark/components/DataGroup.as
@@ -695,6 +695,9 @@
         if (layout && layout.useVirtualLayout)
             return (virtualRendererIndices) ? virtualRendererIndices.concat() : new Vector.<int>(0);

+        if (!dataProvider)
+            return new Vector.<int>(0);
+
         const scrollR:Rectangle = scrollRect;
         const dataProviderLength:int = dataProvider.length;

@@ -831,7 +834,6 @@
         if (layout && layout.useVirtualLayout)
         {
             // The item renderers will be created lazily, at updateDisplayList() time
-            //removeAllItemRenderers();
             invalidateSize();
             invalidateDisplayList();
             return;


Transferred from the Adobe Open Source Subversion Repository

Revision: 12552
Author:   hmuller@adobe.com
Date:     2009-12-04T21:45:12.642346Z

Log Message:
-----------
DataGroup now tracks the indices of the active virtual item renderers with a list, rather than the min/max values.

DataGroup/addItemRendererToDisplayList() now respects the overlay.

QE notes:
Doc notes:
Bugs: sdk-24052
Reviewer:
Tests run: DataGroup, List
Is noteworthy for integration: no

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataGroup.as

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

--- frameworks/projects/spark/src/spark/components/DataGroup.as
+++ frameworks/projects/spark/src/spark/components/DataGroup.as
@@ -177,11 +177,11 @@
     //  Overridden properties
     //
     //--------------------------------------------------------------------------
-
+
     //----------------------------------
     //  baselinePosition
     //----------------------------------
-
+
     /**
      *  @inheritDoc
      *
@@ -194,13 +194,13 @@
     {
         if (!validateBaselinePosition())
             return NaN;
-
+
         if (numElements == 0)
             return super.baselinePosition;
-
+
         return getElementAt(0).baselinePosition + getElementAt(0).y;
     }
-
+
     //--------------------------------------------------------------------------
     //
     //  Properties
@@ -210,12 +210,12 @@
     //----------------------------------
     //  typicalItem
     //----------------------------------
-
+
     private var _typicalItem:Object = null;
     private var explicitTypicalItem:Object = null;
     private var typicalItemChanged:Boolean = false;
     private var typicalLayoutElement:ILayoutElement = null;
-
+
     /**
      *  Layouts use the preferred size of the typicalItem
      *  when fixed row or column sizes are required, but a specific
@@ -245,7 +245,7 @@
     {
         return _typicalItem;
     }
-
+
     /**
      *  @private
      */
@@ -264,7 +264,7 @@
         if (layout)
             layout.typicalLayoutElement = element;
     }
-
+
     private function initializeTypicalItem():void
     {
         if (_typicalItem === null)
@@ -272,7 +272,7 @@
             setTypicalLayoutElement(null);
             return;
         }
-
+
         var renderer:IVisualElement = createRendererForItem(_typicalItem, false);
         var obj:DisplayObject = DisplayObject(renderer);
         if (!obj)
@@ -280,7 +280,7 @@
             setTypicalLayoutElement(null);
             return;
         }
-
+
         super.addChild(obj);
         setUpItemRenderer(renderer, 0, _typicalItem);
         if (obj is IInvalidating)
@@ -325,7 +325,7 @@
     {
         if (layout.typicalLayoutElement)
             return;
-
+
         const list:IList = dataProvider;
         if (list && (list.length > 0))
         {
@@ -333,11 +333,11 @@
             initializeTypicalItem();
         }
     }
-
+
     //----------------------------------
     //  layout
     //----------------------------------
-
+
     private var useVirtualLayoutChanged:Boolean = false;

     /**
@@ -349,7 +349,7 @@
         var oldLayout:LayoutBase = layout;
         if (value == oldLayout)
             return;
-
+
         if (oldLayout)
         {
             oldLayout.typicalLayoutElement = null;
@@ -388,11 +388,11 @@
     {
         changeUseVirtualLayout();
     }
-
+
     //----------------------------------
     //  itemRenderer
     //----------------------------------
-
+
     /**
      *  @private
      *  Storage for the itemRenderer property.
@@ -400,9 +400,9 @@
     private var _itemRenderer:IFactory;

     private var itemRendererChanged:Boolean;
-
+
     [Inspectable(category="Data")]
-
+
     /**
      *  The item renderer to use for data items.
      *  The class must implement the IDataRenderer interface.
@@ -420,14 +420,14 @@
     {
         return _itemRenderer;
     }
-
+
     /**
      *  @private
      */
     public function set itemRenderer(value:IFactory):void
     {
         _itemRenderer = value;
-
+
         cleanUpDataProvider();
         invalidateProperties();

@@ -438,15 +438,15 @@
     //----------------------------------
     //  itemRendererFunction
     //----------------------------------
-
+
     /**
      *  @private
      *  Storage for the itemRendererFunction property.
      */
     private var _itemRendererFunction:Function;
-
+
     [Inspectable(category="Data")]
-
+
     /**
      *  Function that returns an item renderer IFactory for a
      *  specific item.  You should define an item renderer function
@@ -466,21 +466,21 @@
     {
         return _itemRendererFunction;
     }
-
+
     /**
      *  @private
      */
     public function set itemRendererFunction(value:Function):void
     {
         _itemRendererFunction = value;
-
+
         cleanUpDataProvider();
         invalidateProperties();

         itemRendererChanged = true;
         typicalItemChanged = true;
     }
-
+
     //----------------------------------
     //  rendererUpdateDelegate
     //----------------------------------
@@ -569,6 +569,11 @@
         dataProviderChanged = true;
         invalidateProperties();
         dispatchEvent(new Event("dataProviderChanged"));
+    }
+
+    private static function sortDecreasing(x:int, y:int):Number
+    {
+        return y - x;
     }

     /**
@@ -623,9 +628,7 @@
             }
             else
             {
-                var endIndex:int = virtualLayoutEndIndex;     // itemRemoved decrements virtualLayoutEndIndex
-                var startIndex:int = virtualLayoutStartIndex; // itemRemoved decrements virtualLayoutStartIndex
-                for (index = endIndex; (index >= 0) && (index >= startIndex); index--)
+                for each (index in virtualRendererIndices.concat().sort(sortDecreasing))
                 {
                     // TODO (rfrishbe): same as above

@@ -634,12 +637,12 @@
                         item = IDataRenderer(renderer).data;
                     else
                         item = renderer;
-                    itemRemoved(item, index);
+                    itemRemoved(item, index);  // removes index from virtualRendererIndices
                 }
+
                 indexToRenderer = [];
-
-                virtualLayoutStartIndex = virtualLayoutEndIndex = -1;
-                oldVirtualLayoutStartIndex = oldVirtualLayoutEndIndex = -1;
+                virtualRendererIndices.length = 0;
+                oldVirtualRendererIndices.length = 0;

                 for (var i:int = freeRenderers.length - 1; i >= 0; i--)
                 {
@@ -661,17 +664,15 @@
      */
     private function initializeDataProvider():void
     {
-        var index:int;
-        var vLayout:Boolean = layout && layout.useVirtualLayout;
-
         if (_dataProvider)
         {
             _dataProvider.addEventListener(CollectionEvent.COLLECTION_CHANGE, dataProvider_collectionChangeHandler, false, 0, true);

             // Create all item renderers eagerly
-            if (!vLayout)
-            {
-                for (index = 0; index < _dataProvider.length; index++)
+            if (!(layout && layout.useVirtualLayout))
+            {
+                const dataProviderLength:int = _dataProvider.length;
+                for (var index:int = 0; index < _dataProvider.length; index++)
                     itemAdded(_dataProvider.getItemAt(index), index);
             }
             else
@@ -751,7 +752,7 @@
         // 3. if item is an IVisualElement and a DisplayObject, use it directly
         if (!myItemRenderer && item is IVisualElement && item is DisplayObject)
             myItemRenderer = IVisualElement(item);
-
+
         // Couldn't find item renderer.  Throw an RTE.
         if (!myItemRenderer && failRTE)
         {
@@ -762,10 +763,10 @@
                 err = resourceManager.getString("components", "unableToCreateRenderer", [item]);
             throw new Error(err);
         }
-
+
         return myItemRenderer;
     }
-
+
     /**
      *  @private
      */
@@ -775,16 +776,16 @@
         {
             itemRendererChanged = false;
             useVirtualLayoutChanged = false;
-
+
             if (layout)
                 layout.clearVirtualLayoutCache();
-
+
             // If an explicit value for typicalItem was never set, then clear
             // the layout's typicalLayoutElement, which will force it to be
             // recomputed by the next measured/updateDisplayList() call.
             if (!explicitTypicalItem)
                 setTypicalLayoutElement(null);
-
+
             initializeDataProvider();

             // Don't reset the scroll positions until the new ItemRenderers are created
@@ -794,7 +795,7 @@
                 dataProviderChanged = false;
                 verticalScrollPosition = horizontalScrollPosition = 0;
             }
-
+
             maskChanged = true;
         }

@@ -802,7 +803,7 @@
         // initializeDataProvider removes all of the display list children.
         // GroupBase's commitProperties reattaches the mask
         super.commitProperties();
-
+
         if (_layeringFlags & LAYERING_DIRTY)
         {
             if (layout && layout.useVirtualLayout)
@@ -817,7 +818,7 @@
             initializeTypicalItem();
         }
     }
-
+
     /**
      *  @private
      *  True if we are updating a renderer currently.
@@ -848,8 +849,8 @@
     private function setUpItemRenderer(renderer:IVisualElement, itemIndex:int, data:Object):void
     {
         if (!renderer)
-           return;
-
+            return;
+
         // keep track of whether we are actively updating an renderers
         // so we can ignore any collectionChange.UPDATE events
         renderersBeingUpdated = true;
@@ -875,7 +876,7 @@
         // Set the index
         if (renderer is IItemRenderer)
             IItemRenderer(renderer).itemIndex = itemIndex;
-
+
         // set the label to the toString() of the data
         if (renderer is IItemRenderer)
             IItemRenderer(renderer).label = itemToLabel(data);
@@ -887,51 +888,69 @@

     /**
      *  @private
+     *  If the renderer at the specified index has a non-zero depth then: append it to
+     *  layers.topLayerItems if depth > 0, or to layers.bottomLayerItems if depth < 0.
+     *  Otherwise, if depth is zero (the default) then change the renderer's childIndex
+     *  to insertIndex and increment insertIndex.  The possibly incremented insertIndex is returned.
+     *
+     *  See manageDisplayObjectLayers().
+     */
+    private function sortItemAt(index:int, layers:Object, insertIndex:int):int
+    {
+        const renderer:IVisualElement = getElementAt(index);
+        const layer:Number = renderer.depth;
+
+        if (layer != 0)
+        {
+            if (layer > 0)
+            {
+                if (layers.topLayerItems == null)
+                    layers.topLayerItems = new Vector.<IVisualElement>();
+                layers.topLayerItems.push(renderer);
+            }
+            else
+            {
+                if (layers.bottomLayerItems == null)
+                    layers.bottomLayerItems = new Vector.<IVisualElement>();
+                layers.bottomLayerItems.push(renderer);
+            }
+
+            return insertIndex;
+        }
+
+        super.setChildIndex(renderer as DisplayObject, insertIndex++);
+        return insertIndex;
+    }
+
+    /**
+     *  @private
      */
     private function manageDisplayObjectLayers():void
-    {
+    {
+        _layeringFlags &= ~LAYERING_DIRTY;
+
+        var insertIndex:uint = 0;
+        const layers:Object = {topLayerItems:null,  bottomLayerItems:null};
+
+        if (layout && layout.useVirtualLayout)
+        {
+            for each (var index:int in virtualRendererIndices)
+            insertIndex = sortItemAt(index, layers, insertIndex);
+        }
+        else
+        {
+            for (index = 0; index < numElements; index++)
+                insertIndex = sortItemAt(index, layers, insertIndex);
+        }
+
         // itemRenderers should be both DisplayObjects and IVisualElements
-        var topLayerItems:Vector.<IVisualElement>;
-        var bottomLayerItems:Vector.<IVisualElement>;
+        const topLayerItems:Vector.<IVisualElement> = layers.topLayerItems;
+        const bottomLayerItems:Vector.<IVisualElement> = layers.bottomLayerItems;
+
+        var myItemRenderer:IVisualElement;
         var keepLayeringEnabled:Boolean = false;
-
-        var insertIndex:uint = 0;
-
-        _layeringFlags &= ~LAYERING_DIRTY;
-
         var len:int = numElements;
-        var startIndex:int = 0;
-        var endIndex:int = numElements - 1;
-
-        if (layout && layout.useVirtualLayout && (virtualLayoutStartIndex != -1))
-        {
-            startIndex = virtualLayoutStartIndex;
-            endIndex = virtualLayoutEndIndex;
-        }
-
-        for (var i:int = startIndex; i <= endIndex; i++)
-        {
-            var myItemRenderer:IVisualElement = getElementAt(i);
-            var layer:Number = myItemRenderer.depth;
-
-            if (layer != 0)
-            {
-                if (layer > 0)
-                {
-                    if (topLayerItems == null) topLayerItems = new Vector.<IVisualElement>();
-                    topLayerItems.push(myItemRenderer);
-                    continue;
-                }
-                else
-                {
-                    if (bottomLayerItems == null) bottomLayerItems = new Vector.<IVisualElement>();
-                    bottomLayerItems.push(myItemRenderer);
-                    continue;
-                }
-            }
-
-            super.setChildIndex(myItemRenderer as DisplayObject, insertIndex++);
-        }
+        var i:int;

         if (topLayerItems != null)
         {
@@ -949,10 +968,10 @@
         {
             keepLayeringEnabled = true;
             insertIndex=0;
-
+
             GroupBase.sortOnLayer(bottomLayerItems);
             len = bottomLayerItems.length;
-
+
             for (i=0;i<len;i++)
             {
                 myItemRenderer = bottomLayerItems[i];
@@ -982,20 +1001,24 @@
     {
         return dataProvider ? dataProvider.length : 0;
     }
-
+
+    /**
+     *  @private
+     *  Maps from renderer index (same as dataProvider index) to the item renderer itself.
+     */
     private var indexToRenderer:Array = [];
-
-    /**
-     *  @private
-     *  The first and last layout element indices requested via
-     *  getLayoutElementAt().   Used by finishVirtualLayout()
-     *  to distinguish IRs that can be recycled or discarded.
-     */
-    private var virtualLayoutStartIndex:int = -1;
-    private var virtualLayoutEndIndex:int = -1;
-    private var oldVirtualLayoutStartIndex:int = -1;
-    private var oldVirtualLayoutEndIndex:int = -1;
-
+
+    /**
+     *  @private
+     *  The set of layout element indices requested with getVirtualElementAt()
+     *  during updateDisplayList(), and the set of "old" indices that were requested
+     *  in the previous pass.  These vectors are used by finishVirtualLayout()
+     *  to distinguish IRs that can be recycled or discarded.   The virtualRendererIndices
+     *  vector is used in various places to iterate over all of the virtual renderers.
+     */
+    private var virtualRendererIndices:Vector.<int> = null;
+    private var oldVirtualRendererIndices:Vector.<int> = null;
+
     /**
      *  @private
      *  During a virtual layout, virtualLayoutUnderway is true.  This flag is used
@@ -1003,7 +1026,7 @@
      *  See invalidateSize() and updateDisplayList().
      */
     private var virtualLayoutUnderway:Boolean = false;
-
+
     /**
      *  @private
      *  freeRenderers - IRs that were created by getLayoutElementAt() but
@@ -1011,40 +1034,71 @@
      *  The list is updated by finishVirtualLayout().
      */
     private var freeRenderers:Array = new Array();
-
-    /**
-     *  @private
+
+    /**
+     *  @private
+     *  Called before super.updateDisplayList() if layout.useVirtualLayout=true.
+     *  Copies virtualRendererIndices to oldRendererIndices, clears virtualRendererIndices
+     *  (which will be repopulated by subsequence getVirtualElementAt() calls), and
+     *  calls ensureTypicalElement().
+     */
+    private function startVirtualLayout():void
+    {
+        virtualLayoutUnderway = true;
+
+        // lazily create the virtualRendererIndices vectors
+
+        if (!virtualRendererIndices)
+            virtualRendererIndices = new Vector.<int>();
+        if (!oldVirtualRendererIndices)
+            oldVirtualRendererIndices = new Vector.<int>();
+
+        // Copy the contents virtualRendererIndices to oldVirtualRendererIndices
+        // and then clear virtualRendererIndices
+
+        oldVirtualRendererIndices.length = 0;
+        for each (var index:int in virtualRendererIndices)
+            oldVirtualRendererIndices.push(index);
+        virtualRendererIndices.length = 0;
+
+        // Ensure that layout.typicalLayoutElement is set
+        ensureTypicalLayoutElement();
+    }
+
+    /**
+     *  @private
+     *  Called after super.updateDisplayList() finishes.
+     *
      *  Discard the ItemRenderers that aren't needed anymore, i.e. the ones
-     *  outside the range virtualLayoutStartIndex to virtualLayoutEndIndex.
+     *  not explicitly requested with getVirtualElementAt() during the most
+     *  recent super.updateDisplayList().
+     *
      *  Discarded IRs may be added to the freeRenderers list per the rules
      *  defined in getVirtualElementAt().  If any visible renderer has a non-zero
-     *  depth we resort DisplayObject - manageDisplayObjectLayers() - as well.
+     *  depth we resort all of them with manageDisplayObjectLayers().
      */
     private function finishVirtualLayout():void
     {
-        if (oldVirtualLayoutStartIndex < 0 || oldVirtualLayoutEndIndex < 0)
+        virtualLayoutUnderway = false;
+
+        if (oldVirtualRendererIndices.length == 0)
             return;

-        // Remove the old ItemRenderers that aren't new ItemRenderers.  In other
-        // words remove the ItemRenderers from oldVirtualLayoutStartIndex to
-        // oldVirtualLayoutEndIndex, but skip the ones in the range
-        // virtualLayoutStartIndex to virtualLayoutEndIndex.
-
-        for (var index:int = oldVirtualLayoutStartIndex; index <= oldVirtualLayoutEndIndex; index++)
-        {
-            // Skip the inView renderers.  If vitrualLayoutStartIndex is -1, there aren't any.
-            if (virtualLayoutStartIndex != -1 && index >= virtualLayoutStartIndex && index <= virtualLayoutEndIndex)
-            {
-                index = virtualLayoutEndIndex;
+        // Remove the old ItemRenderers that aren't new ItemRenderers and
+        // add them to the freeRenderers list.
+
+        for each (var vrIndex:int in oldVirtualRendererIndices)
+        {
+            // Skip renderers that are still in view.
+            if (virtualRendererIndices.indexOf(vrIndex) != -1)
                 continue;
-            }

             // Remove previously "in view" IR from the item=>IR table
-            var elt:IVisualElement = indexToRenderer[index] as IVisualElement;
-            delete indexToRenderer[index];
-
+            var elt:IVisualElement = indexToRenderer[vrIndex] as IVisualElement;
+            delete indexToRenderer[vrIndex];
+
             // Free or remove the IR.
-            var item:Object = dataProvider.getItemAt(index);
+            var item:Object = dataProvider.getItemAt(vrIndex);
             if ((item != elt) && (elt is IDataRenderer))
             {
                 // IDataRenderer(elt).data = null;  see https://bugs.adobe.com/jira/browse/SDK-20962
@@ -1060,23 +1114,20 @@
             }
             else if (elt)
             {
-                dispatchEvent(new RendererExistenceEvent(RendererExistenceEvent.RENDERER_REMOVE, false, false, elt, index, item));
+                dispatchEvent(new RendererExistenceEvent(RendererExistenceEvent.RENDERER_REMOVE, false, false, elt, vrIndex, item));
                 super.removeChild(DisplayObject(elt));
             }
         }
-
+
         // If there are any visible renderers whose depth property is non-zero
         // then use manageDisplayObjectLayers to resort the children list.  Note:
         // we're assuming that the layout has set the bounds of any elements that
         // were allocated but aren't actually visible to 0x0.

-        if (virtualLayoutStartIndex < 0 || virtualLayoutEndIndex < 0)
-            return;
-
         var depthSortRequired:Boolean = false;
-        for (index = virtualLayoutStartIndex; index < virtualLayoutEndIndex; index++)
-        {
-            elt = indexToRenderer[index] as IVisualElement;
+        for each (vrIndex in virtualRendererIndices)
+        {
+            elt = indexToRenderer[vrIndex] as IVisualElement;
             if (!elt || !elt.visible || !elt.includeInLayout)
                 continue;
             if ((elt.width == 0) || (elt.height == 0))
@@ -1087,6 +1138,7 @@
                 break;
             }
         }
+
         if (depthSortRequired)
             manageDisplayObjectLayers();
     }
@@ -1098,12 +1150,12 @@
      */
     mx_internal function clearFreeRenderers():void
     {
-        var n:int = freeRenderers.length;
-        for (var i:int = 0; i < n; i++)
+        const freeRenderersLength:int = freeRenderers.length;
+        for (var i:int = 0; i < freeRenderersLength; i++)
             freeRenderers[i] = null;
         freeRenderers.length = 0;
     }
-
+
     /**
      *  @private
      *  During virtual layout getLayoutElementAt() eagerly validates lazily
@@ -1115,7 +1167,7 @@
         if (!virtualLayoutUnderway)
             super.invalidateSize();
     }
-
+
     /**
      *  @private
      *  Make sure there's a valid typicalLayoutElement for virtual layout.
@@ -1124,10 +1176,10 @@
     {
         if (layout && layout.useVirtualLayout)
             ensureTypicalLayoutElement();
-
+
         super.measure();
     }
-
+
     /**
      *  @private
      *  Manages the state required by virtual layout.
@@ -1135,23 +1187,14 @@
     override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
     {
         drawBackground();
-
+
         if (layout && layout.useVirtualLayout)
-        {
-            virtualLayoutUnderway = true;
-            oldVirtualLayoutStartIndex = virtualLayoutStartIndex;
-            oldVirtualLayoutEndIndex = virtualLayoutEndIndex;
-            virtualLayoutStartIndex = -1;
-            ensureTypicalLayoutElement();
-        }
+            startVirtualLayout();   // sets virtualLayoutUnderway=true

         super.updateDisplayList(unscaledWidth, unscaledHeight);

         if (virtualLayoutUnderway)
-        {
-            finishVirtualLayout();
-            virtualLayoutUnderway = false;
-        }
+            finishVirtualLayout();  // sets virtualLayoutUnderway=false
     }

     /**
@@ -1209,22 +1252,14 @@
     {
         if ((index < 0) || (dataProvider == null) || (index >= dataProvider.length))
             return null;
-
+
         var elt:IVisualElement = indexToRenderer[index];

         if (virtualLayoutUnderway)
         {
-            if (virtualLayoutStartIndex == -1)  // initialized in updateDisplayList()
-            {
-                virtualLayoutStartIndex = index;
-                virtualLayoutEndIndex = index;
-            }
-            else
-            {
-                virtualLayoutStartIndex = Math.min(index, virtualLayoutStartIndex);
-                virtualLayoutEndIndex = Math.max(index, virtualLayoutEndIndex);
-            }
-
+            if (virtualRendererIndices.indexOf(index) == -1)
+                virtualRendererIndices.push(index);
+
             var createdIR:Boolean = false;
             var recycledIR:Boolean = false;

@@ -1248,8 +1283,8 @@

                 indexToRenderer[index] = elt;
             }
-
-            addItemRendererToDisplayList(DisplayObject(elt), index - virtualLayoutStartIndex);
+
+            addItemRendererToDisplayList(DisplayObject(elt));

             if (createdIR || recycledIR)
             {
@@ -1269,10 +1304,10 @@
             if (createdIR)
                 dispatchEvent(new RendererExistenceEvent(RendererExistenceEvent.RENDERER_ADD, false, false, elt, index, item));
         }
-
+
         return elt;
-     }
-
+    }
+
     /**
      *  @private
      *
@@ -1297,7 +1332,7 @@
     {
         if ((dataProvider == null) || (element == null))
             return -1;
-
+
         return indexToRenderer.indexOf(element);
     }

@@ -1310,6 +1345,18 @@
         _layeringFlags |= (LAYERING_ENABLED | LAYERING_DIRTY);
         invalidateProperties();
     }
+
+    /**
+     *  @private
+     *  Set the itemIndex of the IItemRenderer at index to index. See resetRenderersIndices.
+     */
+    private function resetRendererItemIndex(index:int):void
+    {
+        var renderer:IItemRenderer = indexToRenderer[index] as IItemRenderer;
+        if (renderer)
+            renderer.itemIndex = index;
+    }
+

     /**
      *  @private
@@ -1320,26 +1367,24 @@
      */
     private function resetRenderersIndices():void
     {
-        if (indexToRenderer.length > 0)
-        {
-            var vLayout:Boolean = layout && layout.useVirtualLayout;
-            var renderer:IItemRenderer;
-
-            var endIndex:int = vLayout ? virtualLayoutEndIndex : indexToRenderer.length - 1;
-            var startIndex:int = vLayout ? virtualLayoutStartIndex : 0;
-            // FIXME (rfrishbe): figure out how to iterate over item renderers
-            for (var i:int = startIndex; i <= endIndex; i++)
-            {
-                renderer = indexToRenderer[i] as IItemRenderer;
-
-                if (renderer)
-                    renderer.itemIndex = i;
-                // TODO (rfrishbe): could make this more optimal by only re-computing a subset of the visible
-                // item renderers, but it's probably not worth it
-            }
-        }
-    }
-
+        if (indexToRenderer.length == 0)
+            return;
+
+        if (layout && layout.useVirtualLayout)
+        {
+            for each (var index:int in virtualRendererIndices)
+                resetRendererItemIndex(index);
+        }
+        else
+        {
+            const indexToRendererLength:int = indexToRenderer.length;
+            for (index = 0; index < indexToRendererLength; index++)
+                resetRendererItemIndex(index);
+            // TODO (rfrishbe): could make this more optimal by only re-computing a subset of the visible
+            // item renderers, but it's probably not worth it
+        }
+    }
+
     /**
      *  Adds the itemRenderer for the specified dataProvider item to this DataGroup.
      *
@@ -1361,17 +1406,21 @@

         if (layout && layout.useVirtualLayout)
         {
-            // The next time updateDisplayList() runs, virtualLayoutStart,EndIndex
-            // will become oldVirtualLayoutStart,End index.  The changes
-            // to virtualLayoutStart,EndIndex only affect finishVirtualLayout().
-            if (index <= virtualLayoutEndIndex)
-            {
-                if (index <= virtualLayoutStartIndex)
-                    virtualLayoutStartIndex += 1;
-                virtualLayoutEndIndex += 1;
-                indexToRenderer.splice(index, 0, null);
-            }
-
+            // Increment all of the indices in virtualRendererIndices that are >= index.
+
+            if (layout && layout.useVirtualLayout && virtualRendererIndices)
+            {
+                const virtualRendererIndicesLength:int = virtualRendererIndices.length;
+                for (var i:int = 0; i < virtualRendererIndicesLength; i++)
+                {
+                    const vrIndex:int = virtualRendererIndices[i];
+                    if (vrIndex >= index)
+                        virtualRendererIndices[i] = vrIndex + 1;
+                }
+
+                indexToRenderer.splice(index, 0, null); // shift items >= index to the right
+            }
+
             invalidateSize();
             invalidateDisplayList();
             return;
@@ -1382,8 +1431,8 @@
         addItemRendererToDisplayList(myItemRenderer as DisplayObject, index);
         setUpItemRenderer(myItemRenderer, index, item);
         dispatchEvent(new RendererExistenceEvent(
-                      RendererExistenceEvent.RENDERER_ADD, false, false,
-                      myItemRenderer, index, item));
+            RendererExistenceEvent.RENDERER_ADD, false, false,
+            myItemRenderer, index, item));

         invalidateSize();
         invalidateDisplayList();
@@ -1409,31 +1458,40 @@
         if (layout)
             layout.elementRemoved(index);

-        var myItemRenderer:IVisualElement = indexToRenderer[index];
-        if (layout && layout.useVirtualLayout)
-        {
-            // The next time updateDisplayList() runs, virtualLayoutStart,EndIndex
-            // will become oldVirtualLayoutStart,End index.  The changes
-            // to virtualLayoutStart,EndIndex only affect finishVirtualLayout().
-            if (index <= virtualLayoutEndIndex)
-            {
-                if (index <= virtualLayoutStartIndex)
-                    virtualLayoutStartIndex -= 1;
-                virtualLayoutEndIndex -= 1;
-                indexToRenderer.splice(index, 1);
-            }
-        }
-        else
+        // Decrement all of the indices in virtualRendererIndices that are > index
+        // Remove the one (at vrItemIndex) that equals index.
+
+        if (layout && layout.useVirtualLayout && virtualRendererIndices)
+        {
+            var vrItemIndex:int = -1;  // location of index in virtualRendererIndices
+            const virtualRendererIndicesLength:int = virtualRendererIndices.length;
+            for (var i:int = 0; i < virtualRendererIndicesLength; i++)
+            {
+                const vrIndex:int = virtualRendererIndices[i];
+                if (vrIndex == index)
+                    vrItemIndex = i;
+                else if (vrIndex > index)
+                    virtualRendererIndices[i] = vrIndex - 1;
+            }
+            if (vrItemIndex != -1)
+                virtualRendererIndices.splice(vrItemIndex, 1);
+        }
+
+        // Remove the old renderer at index from indexToRenderer[], from the
+        // DataGroup, and clear its data property (if any).
+
+        const oldRenderer:IVisualElement = indexToRenderer[index];
+
+        if (indexToRenderer.length > index)
             indexToRenderer.splice(index, 1);
-
+
         dispatchEvent(new RendererExistenceEvent(
-                      RendererExistenceEvent.RENDERER_REMOVE, false, false,
-                      myItemRenderer, index, item));
-
-        if (myItemRenderer is IDataRenderer && myItemRenderer !== item)
-            IDataRenderer(myItemRenderer).data = null;
-
-        var child:DisplayObject = myItemRenderer as DisplayObject;
+            RendererExistenceEvent.RENDERER_REMOVE, false, false, oldRenderer, index, item));
+
+        if (oldRenderer is IDataRenderer && oldRenderer !== item)
+            IDataRenderer(oldRenderer).data = null;
+
+        var child:DisplayObject = oldRenderer as DisplayObject;
         if (child)
             super.removeChild(child);

@@ -1443,43 +1501,26 @@

     /**
      *  @private
-     *  Removes an item from another DataGroup or display list
-     *  before adding it to this display list.
-     *
-     *  @param child DisplayObject to add to the display list.
-     *
-     *  @param item Item associated with the display object to be added.  If
-     *  the item itself is a display object, it will be the same as the child parameter.
-     *
-     *  @param index Index position where the display object will be added.
-     *
-     *  @return DisplayObject that was added.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
      */
-    private function addItemRendererToDisplayList(child:DisplayObject, index:int):void
+    private function addItemRendererToDisplayList(child:DisplayObject, index:int = -1):void
     {
-        // If this child is already an element of the display list, ensure
-        // that it's at the specified index
-        var childParent:Object = child.parent;
+        const childParent:Object = child.parent;
+        const overlayCount:int = _overlay ? _overlay.numDisplayObjects : 0;
+
         if (childParent == this)
         {
-            super.setChildIndex(child, index);
+            super.setChildIndex(child, index != -1 ? index : super.numChildren - 1 - overlayCount);
             return;
         }
-        else if (childParent is DataGroup)
-        {
+
+        if (childParent is DataGroup)
             DataGroup(childParent)._removeChild(child);
-        }
-
+
         if ((_layeringFlags & LAYERING_ENABLED) ||
             (child is IVisualElement && (child as IVisualElement).depth != 0))
             invalidateLayering();
-
-        super.addChildAt(child, index);
+
+        super.addChildAt(child, index != -1 ? index : super.numChildren - overlayCount);
     }

     /**
@@ -1506,14 +1547,14 @@
                 adjustAfterAdd(event.items, event.location);
                 break;
             }
-
+
             case CollectionEventKind.REPLACE:
             {
                 // items are replaced
                 adjustAfterReplace(event.items, event.location);
                 break;
             }
-
+
             case CollectionEventKind.REMOVE:
             {
                 // items are added
@@ -1522,14 +1563,14 @@
                 adjustAfterRemove(event.items, event.location);
                 break;
             }
-
+
             case CollectionEventKind.MOVE:
             {
                 // one item is moved
                 adjustAfterMove(event.items[0], event.location, event.oldLocation);
                 break;
             }
-
+
             case CollectionEventKind.REFRESH:
             {
                 // from a filter or sort...let's just reset everything
@@ -1538,7 +1579,7 @@
                 invalidateProperties();
                 break;
             }
-
+
             case CollectionEventKind.RESET:
             {
                 // reset everything
@@ -1547,7 +1588,7 @@
                 invalidateProperties();
                 break;
             }
-
+
             case CollectionEventKind.UPDATE:
             {
                 // if a renderer is currently being updated, let's


Transferred from the Adobe Open Source Subversion Repository

Revision: 20215
Author:   jasonsj@adobe.com
Date:     2011-02-08T23:00:00.038388Z

Log Message:
-----------
Updated ASDoc to mention TLF features are not supported in mobile.

QE notes: None
Doc notes:
Bugs:
SDK-29290 ASdoc for mobile version of TextArea and TextInput is incorrect
Reviewer: gruehle
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/TextInput.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/TextArea.as</path>

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

--- frameworks/projects/spark/src/spark/components/TextInput.as
+++ frameworks/projects/spark/src/spark/components/TextInput.as
@@ -70,6 +70,11 @@
  *  high-quality international typography.
  *  The MX version of TextInput displays text using the older
  *  TextField class.

+ *
+ *
The mobile theme uses TextField-based text instead of RichEditableText.
+ *  Some TLF-only features are not supported in the mobile theme including
+ *  TextFlow, right-to-left or bidirectional text, and advanced text
+ *  styles.

  *
  *
You can set the text to be displayed, or get the text that the user
  *  has entered, using the text property.
@@ -103,7 +108,7 @@
  *  break, because this control does not support entering multiple
  *  lines of text. By default, this control has explicit line breaks.

  *
- *
This control is a skinnable control whose skin contains a
+ *
This control is a skinnable control whose default skin contains a
  *  RichEditableText instance that handles displaying and editing the text.
  *  (The skin also handles drawing the border and background.)
  *  This RichEditableText can be accessed as the textDisplay


Transferred from the Adobe Open Source Subversion Repository

Revision: 7952
Author:   cframpto@adobe.com
Date:     2009-06-18T09:57:23.131767Z

Log Message:
-----------
PARB changes for RichEditableText, TextArea and TextInput

RichEditableText, TextArea
--------------------------
content:Object setter only for use by MXML compiler
textFlow:TextFlow getter/setter added
scrollToPosition -> scrollToRange()
getSelectionFormat() -> getFormatOfRange(requestedFormats:Vector.<String> = null, anchorPosition=-1,                  activePosition=-1):TextLayoutFormat
    If either position is -1, the current selection will be used.
setSelectionFormat() -> setFormatOfRange(format:TextLayoutFormat, anchorPosition=-1, activePosition=-1):void
    If either position is -1, the current selection will be used.
export() removed

RichEditableText, TextBase
--------------------------
autoSize removed
widthInChars defaults to NaN
heightInLines defaults to NaN
    If both are NaN, and not in scroller, it will autoSize.
    If both are NaN, and in scroller, widthInChars effectively 15, heightInLines effectively 10.
    If widthInChars is NaN and heightInLines is not, widthInChars effectively 1.
    If heightInLines is NaN and widthInChars is not, heightInLines effectively 1.
selectionVisibility:String -> selectionHighlighting:String
TextSelectionVisibiliy.as -> TextSelectionHightlighting.as
setSelection -> selectRange(anchor, active) and the args are no longer optional
selectAll() added

TextBase
--------
TextBase.as -> SkinnableTextBase.as
it will not support any non-inheriting styles
textView skin part -> textDisplay
widthInChars property removed and moved to TextInput and TextArea

Styles
-------
Renamed style selectionColor -> focusedTextSelectionColor
Renamed style unfocusedSelectionColor -> unfocusedTextSelectionColor
Renamed inactiveSelectionColor -> inactiveTextSelectionColor

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/TextInputSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/SelectionFormatTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/TextAreaSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/defaults.css</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/TextBase.as" copyfrom-rev="7834" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/SkinnableTextBase.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextSelectionVisibility.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/NumericStepper.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/spark-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/NumericStepperTextInputSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextArea.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextSelectionVisibility.as" copyfrom-rev="7834" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextSelectionHighlighting.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/RichEditableTextContainerManager.as</path>

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

--- frameworks/projects/spark/src/spark/components/TextInput.as
+++ frameworks/projects/spark/src/spark/components/TextInput.as
@@ -11,15 +11,19 @@

 package spark.components
 {
-
 import flash.events.Event;
 import flash.events.FocusEvent;

-import spark.components.supportClasses.TextBase;
+import flashx.textLayout.formats.LineBreak;
+
+import mx.core.mx_internal;
+import mx.events.FlexEvent;
+
+import spark.components.supportClasses.SkinnableTextBase;
 import spark.components.supportClasses.SkinnableComponent;
 import spark.events.TextOperationEvent;

-import flashx.textLayout.formats.LineBreak;
+use namespace mx_internal;

 //--------------------------------------
 //  Events
@@ -87,7 +91,7 @@
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-public class TextInput extends TextBase
+public class TextInput extends SkinnableTextBase
 {
     include "../core/Version.as";

@@ -135,8 +139,36 @@

         // Trigger bindings to textChanged.
         dispatchEvent(new Event("textChanged"));
+
+        // The default event to trigger a validator.
+        dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
     }

+    //----------------------------------
+    //  widthInChars
+    //----------------------------------
+
+    /**
+     *  Documentation is not currently available.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get widthInChars():Number
+    {
+        return getWidthInChars();
+    }
+
+    /**
+     *  @private
+     */
+    public function set widthInChars(value:Number):void
+    {
+        setWidthInChars(value);
+    }
+
     //--------------------------------------------------------------------------
     //
     //  Overridden methods
@@ -150,16 +182,12 @@
     {
         super.partAdded(partName, instance);

-        if (instance == textView)
+        if (instance == textDisplay)
         {
-            // In default.css, the TextInput selector has a declaration
-            // for lineBreak which sets it to "explicit".  It needs to be on
-            // TextInput rather than RichEditableText so that if changed later it
-            // will be inherited.
-            textView.multiline = false;
+            textDisplay.multiline = false;

             // TextInput should always be 1 line.
-            textView.heightInLines = 1;
+            textDisplay.heightInLines = 1;
         }
     }
 }


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

--- frameworks/projects/framework/src/mx/core/IFlexModuleFactory.as
+++ frameworks/projects/framework/src/mx/core/IFlexModuleFactory.as
@@ -22,6 +22,11 @@
  *
  *
A well-behaved module dispatches a ready event when
  *  it is safe to call the create() method.

+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public interface IFlexModuleFactory
 {
@@ -45,6 +50,11 @@
      *  of arguments, which are then stored in an Array called parameters.
      *
      *  @return An instance of the module, or null.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     function create(... parameters):Object;

@@ -67,6 +77,11 @@
      *
rsls: A list of run-time shared libraries.

      *
mixins: A list of classes initialized at startup.

      *

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     function info():Object;
 }


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/framework/src/mx/effects/CompositeEffect.as
+++ frameworks/projects/framework/src/mx/effects/CompositeEffect.as
@@ -0,0 +1,440 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2003-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.effects
+{
+
+import mx.core.mx_internal;
+import mx.effects.effectClasses.CompositeEffectInstance;
+import mx.effects.effectClasses.PropertyChanges;
+
+use namespace mx_internal;
+
+[DefaultProperty("children")]
+
+/**
+ *  The CompositeEffect class is the parent class for the Parallel
+ *  and Sequence classes, which define the <mx:Parallel>
+ *  and <mx:Sequence> MXML tags.
+ *  Flex supports two methods to combine, or composite, effects:
+ *  parallel and sequence.
+ *  When you combine multiple effects in parallel,
+ *  the effects play at the same time.
+ *  When you combine multiple effects in sequence,
+ *  one effect must complete before the next effect starts.
+ *
+ *
You can create a composite effect in MXML,
+ *  as the following example shows:

+ *
+ *

+ *  <mx:Parallel id="WipeRightUp">
+ *    <mx:children>
+ *      <mx:WipeRight duration="1000"/>
+ *      <mx:WipeUp duration="1000"/>
+ *    </mx:children>
+ *  </mx:Parallel>
+ *
+ *  <mx:VBox id="myBox" hideEffect="WipeRightUp">
+ *    <mx:TextArea id="aTextArea" text="hello"/>
+ *  </mx:VBox>
+ *

+ *
+ *
The <mx:children> tag is optional.

+ *
+ *
Starting a composite effect in ActionScript is usually
+ *  a five-step process:

+ *
+ *

+ *
Create instances of the effect objects to be composited together;
+ *    for example:
+ *
myFadeEffect = new mx.effects.Fade(target);

+ *
Set properties, such as duration,
+ *    on the individual effect objects.

+ *
Create an instance of the Parallel or Sequence effect object;
+ *    for example:
+ *
mySequenceEffect = new mx.effects.Sequence();

+ *
Call the addChild() method for each
+ *    of the effect objects; for example:
+ *
mySequenceEffect.addChild(myFadeEffect);

+ *
Invoke the composite effect's play() method;
+ *    for example:
+ *
mySequenceEffect.play();

+ *

+ *
+ *  @mxml
+ *
+ *
The CompositeEffect class adds the following tag attributes,
+ *  and all the subclasses of the CompositeEffect class
+ *  inherit these tag attributes:

+ *
+ *

+ *  <mx:tagname>
+ *    <mx:children>
+ *      <!-- Specify child effect tags -->
+ *    </mx:children>
+ *  </mx:tagname>
+ *

+ */
+public class CompositeEffect extends Effect
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @param target This argument is ignored for composite effects.
+     *  It is included only for consistency with other types of effects.
+     */
+    public function CompositeEffect(target:Object = null)
+    {
+        super(target);
+
+        instanceClass = CompositeEffectInstance;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private var childTargets:Array;
+
+    /**
+     *  @private
+     */
+    private var _affectedProperties:Array /* of String */;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  children
+    //----------------------------------
+
+    [Inspectable(category="General", arrayType="mx.effects.Effect")]
+
+    /**
+     *  An Array containing the child effects of this CompositeEffect.
+     */
+    public var children:Array = [];
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override public function getAffectedProperties():Array /* of String */
+    {
+        if (!_affectedProperties)
+        {
+            var arr:Array = [];
+
+            var n:int = children.length;
+            for (var i:int = 0; i < n; i++)
+            {
+                arr = arr.concat(children[i].getAffectedProperties());
+            }
+
+            _affectedProperties = arr;
+        }
+
+        return _affectedProperties;
+    }
+
+    /**
+     *  @private
+     */
+    override public function createInstance(target:Object = null):IEffectInstance
+    {
+        if (!childTargets)
+            childTargets = [ target ];
+
+        var newInstance:IEffectInstance = super.createInstance(target);
+
+        childTargets = null;
+
+        return newInstance;
+    }
+
+    /**
+     *  @private
+     */
+    override public function createInstances(targets:Array = null):Array
+    {
+        if (!targets)
+            targets = this.targets;
+
+        childTargets = targets;
+
+        var newInstance:IEffectInstance = createInstance();
+
+        childTargets = null;
+
+        return newInstance ? [ newInstance ] : [];
+    }
+
+    /**
+     *  @private
+     */
+    override protected function filterInstance(propChanges:Array,
+                                               targ:Object):Boolean
+    {
+        if (mx_internal::filterObject)
+        {
+            // If we don't have any targets, then that means
+            // we are nested inside of another CompositeEffect.
+            // Use the childTargets property instead.
+            var targs:Array = targets;
+            if (targs.length == 0)
+                targs = childTargets;
+
+            // Perform the check for all targets
+            var n:int = targs.length;
+            for (var i:int = 0; i < n; i++)
+            {
+                if (mx_internal::filterObject.filterInstance(propChanges, effectTargetHost, targs[i]))
+                    return true;
+            }
+
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     *  @private
+     */
+    override protected function initInstance(instance:IEffectInstance):void
+    {
+        super.initInstance(instance);
+
+        var compInst:CompositeEffectInstance =
+            CompositeEffectInstance(instance);
+
+        var targets:Object = childTargets;
+        if (!(targets is Array))
+            targets = [ targets ];
+
+        if (children)
+        {
+            var n:int = children.length;
+            for (var i:int = 0; i < n; i++)
+            {
+                var childEffect:Effect = children[i];
+
+                // Pass the propertyChangesArray to each child
+                if (mx_internal::propertyChangesArray != null)
+                {
+                    childEffect.mx_internal::propertyChangesArray =
+                        mx_internal::propertyChangesArray;
+                }
+
+                // Pass the filterObject down to the child
+                // if it doesn't have a filterObject.
+                if (childEffect.mx_internal::filterObject == null &&
+                    mx_internal::filterObject)
+                {
+                    childEffect.mx_internal::filterObject =
+                        mx_internal::filterObject;
+                }
+
+				// TODO This doesn't seem good enough...
+				// possibly redundant, but otherwise we'll be using the
+				// old semantics. Might be a better way (e.g., reuse
+				// the same semantics provider)
+                if (effectTargetHost) // && !childEffect.targetSemantics)
+                	childEffect.effectTargetHost = effectTargetHost;
+
+                if (childEffect.targets.length == 0)
+                {
+                    compInst.addChildSet(
+                        children[i].createInstances(targets));
+                }
+                else
+                {
+                    compInst.addChildSet(
+                        children[i].createInstances(childEffect.targets));
+                }
+            }
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override public function captureStartValues():void
+    {
+        // Get all targets of children
+        var childTargets:Array = getChildrenTargets();
+
+        // Generate the PropertyChanges array
+        mx_internal::propertyChangesArray = [];
+
+        var n:int = childTargets.length;
+        for (var i:int = 0; i < n; i++)
+        {
+            mx_internal::propertyChangesArray.push(
+                new PropertyChanges(childTargets[i]));
+        }
+
+        // call captureValues
+        mx_internal::propertyChangesArray =
+            captureValues(mx_internal::propertyChangesArray, true);
+
+        endValuesCaptured = false;
+    }
+
+    /**
+     *  @private
+     */
+    override mx_internal function captureValues(propChanges:Array,
+                                           setStartValues:Boolean):Array
+    {
+        // Iterate through the list of children
+        // and run captureValues() on each of them.
+        var n:int = children.length;
+        for (var i:int = 0; i < n; i++)
+        {
+            var child:Effect = children[i];
+            propChanges = child.captureValues(propChanges, setStartValues);
+        }
+
+        return propChanges;
+    }
+
+    /**
+     *  @private
+     */
+    override mx_internal function applyStartValues(propChanges:Array,
+                                              targets:Array):void
+    {
+        var n:int = children.length;
+        for (var i:int = 0; i < n; i++)
+        {
+            var child:Effect = children[i];
+
+            var childTargets:Array = child.targets.length > 0 ?
+                                     child.targets :
+                                     targets;
+
+            if (child.mx_internal::filterObject == null &&
+                mx_internal::filterObject)
+            {
+                child.mx_internal::filterObject = mx_internal::filterObject;
+            }
+
+            child.applyStartValues(propChanges, childTargets);
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Adds a new child effect to this composite effect.
+     *  A Sequence effect plays each child effect one at a time,
+     *  in the order that they were added.
+     *  A Parallel effect plays all child effects simultaneously;
+     *  the order in which they are added does not matter.
+     *
+     *  @param childEffect Child effect to be added
+     *  to the composite effect.
+     */
+    public function addChild(childEffect:IEffect):void
+    {
+        children.push(childEffect);
+
+        // Null out the list of affected properties,
+        // so that it gets recalculated to include the new child.
+        _affectedProperties = null;
+    }
+
+    /**
+     *  @private
+     *  Figure out the targets of the children
+     */
+    private function getChildrenTargets():Array
+    {
+        var resultsArray:Array = [];
+        var results:Object = {};
+        var childTargets:Array;
+        var child:Effect;
+
+        var n:int;
+        var i:int;
+        var m:int;
+        var j:int;
+
+        n = children.length;
+        for (i = 0; i < n; i++)
+        {
+            child = children[i];
+            if (child is CompositeEffect)
+            {
+                childTargets = CompositeEffect(child).getChildrenTargets();
+                m = childTargets.length;
+                for (j = 0; j < m; j++)
+                {
+                    if (childTargets[j] != null) // Don't include null targets
+                        results[childTargets[j].toString()] = childTargets[j];
+                }
+            }
+            else if (child.targets != null)
+            {
+                m = child.targets.length;
+                for (j = 0; j < m; j++)
+                {
+                    if (child.targets[j] != null) // Don't include null targets
+                        results[child.targets[j].toString()] = child.targets[j];
+                }
+            }
+        }
+
+        // Now add in our targets.
+        n = targets.length;
+        for (i = 0; i < n; i++)
+        {
+            if (targets[i] != null) // Don't include null targets
+                results[targets[i].toString()] = targets[i];
+        }
+
+        // Return the results as an array.
+        for (var p:String in results)
+        {
+            resultsArray.push(results[p]);
+        }
+
+        return resultsArray;
+    }
+}
+
+}


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

--- frameworks/projects/framework/src/mx/effects/easing/Circular.as
+++ frameworks/projects/framework/src/mx/effects/easing/Circular.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2004-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.effects.easing
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 8487
Author:   smgilson@adobe.com
Date:     2009-07-09T18:57:21.985536Z

Log Message:
-----------
final checkin to update the namespace in ASDoc MXML syntax descriptions for Spark components

QE Notes: None
Doc Notes: None
Bugs: -
Checkintests: passed

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/EaseInOutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Fade.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/animation/MotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/ColorMatrixFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/Power.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/BlurFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/DisplacementMapFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/ShaderFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/DropShadowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/CallAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/GradientBevelFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateColor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Scale3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Animate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateTransitionShader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Rotate3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AddAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Scale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/Graphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Move3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Rotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/BasicLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Resize.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateTransform3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Wipe.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/Sine.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Move.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/GlowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateTransform.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/TileLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/ConvolutionFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/Linear.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/animation/Keyframe.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/GradientGlowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/SetAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/RemoveAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/BevelFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/GradientFilter.as</path>

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

--- frameworks/projects/spark/src/spark/effects/AnimateTransform.as
+++ frameworks/projects/spark/src/spark/effects/AnimateTransform.as
@@ -84,7 +84,7 @@
  *
  *  @mxml
  *
- *
The <mx:AnimateTransform> tag
+ *
The <s:AnimateTransform> tag
  *  inherits all of the tag attributes of its superclass,
  *  and adds the following tag attributes:

  *


Transferred from the Adobe Open Source Subversion Repository

Revision: 5228
Author:   egeorgie@adobe.com
Date:     2009-03-10T23:56:10.390326Z

Log Message:
-----------
Implement rounding to pixel boundaries for Horizontal/Vertical layouts.

QE Notes: None
Doc Notes:
Bugs: SDK-18227, SDK-19198
Reviewer: Hans
tests: mustella (gumbo/layout, gumbo/core/group)

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

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

--- frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
+++ frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
@@ -45,12 +45,12 @@

     private static function calculatePercentHeight(layoutElement:ILayoutElement, height:Number):Number
     {
-    	var percentHeight:Number = LayoutElementHelper.pinBetween(layoutElement.percentHeight * 0.01 * height,
+    	var percentHeight:Number = LayoutElementHelper.pinBetween(Math.round(layoutElement.percentHeight * 0.01 * height),
     	                                                          layoutElement.getMinBoundsHeight(),
     	                                                          layoutElement.getMaxBoundsHeight() );
     	return percentHeight < height ? percentHeight : height;
     }
-
+
     private static function sizeLayoutElement(layoutElement:ILayoutElement, height:Number,
                                               verticalAlign:String, restrictedHeight:Number,
                                               width:Number, variableColumnWidth:Boolean,
@@ -989,7 +989,7 @@
        switch(verticalAlign)
        {
            case VerticalAlign.MIDDLE:
-               return (containerHeight - eltHeight) * 0.5;
+               return Math.round((containerHeight - eltHeight) * 0.5);
            case VerticalAlign.BOTTOM:
                return containerHeight - eltHeight;
        }
@@ -1157,7 +1157,7 @@
         var visibleColumns:uint = 0;
         var minVisibleX:Number = layoutTarget.horizontalScrollPosition;
         var maxVisibleX:Number = minVisibleX + targetWidth
-
+
         // Finally, position the LayoutElements and find the first/last
         // visible indices, the content size, and the number of
         // visible elements.
@@ -1166,17 +1166,20 @@
         var maxY:Number = 0;
         var firstColInView:int = -1;
         var lastColInView:int = -1;
-
+
         for (var index:int = 0; index < count; index++)
         {
             layoutElement = layoutTarget.getElementAt(index);
             if (!layoutElement || !layoutElement.includeInLayout)
                 continue;
-
+
             // Set the layout element's position
             var y:Number = (containerHeight - layoutElement.getLayoutBoundsHeight()) * vAlign;
+            // In case we have VerticalAlign.MIDDLE we have to round
+            if (vAlign == 0.5)
+                y = Math.round(y);
             layoutElement.setLayoutBoundsPosition(x, y);
-
+
             // Update maxX,Y, first,lastVisibleIndex, and x
             var dx:Number = layoutElement.getLayoutBoundsWidth();
             var dy:Number = layoutElement.getLayoutBoundsHeight();
@@ -1261,7 +1264,7 @@
             else
             {
                 sizeLayoutElement(layoutElement, height, verticalAlign,
-                               restrictedHeight, NaN, variableColumnWidth, cw);
+                                  restrictedHeight, NaN, variableColumnWidth, cw);

                 spaceToDistribute -= layoutElement.getLayoutBoundsWidth();
             }
@@ -1277,12 +1280,16 @@
                                                                 spaceToDistribute,
                                                                 totalPercentWidth,
                                                                 childInfoArray);
-
+            var roundOff:Number = 0;
             for each (childInfo in childInfoArray)
             {
+                // Make sure the calculated percentages are rounded to pixel boundaries
+                var childSize:int = Math.round(childInfo.size + roundOff);
+                roundOff += childInfo.size - childSize;
+
                 sizeLayoutElement(childInfo.layoutElement, height, verticalAlign,
-                               restrictedHeight, childInfo.size,
-                               variableColumnWidth, cw);
+                                  restrictedHeight, childSize,
+                                  variableColumnWidth, cw);
             }
         }
         return spaceToDistribute;


ProgressIndicator no longer extends CallbackCollection.

--- WeaveCore/src/weave/core/ProgressIndicator.as
+++ WeaveCore/src/weave/core/ProgressIndicator.as
@@ -22,15 +22,14 @@
 	import flash.utils.Dictionary;

 	import weave.api.core.IProgressIndicator;
+	import weave.api.getCallbackCollection;

 	/**
 	 * This is an implementation of IProgressIndicator.
 	 * @author adufilie
 	 */
-	public class ProgressIndicator extends CallbackCollection implements IProgressIndicator
+	public class ProgressIndicator implements IProgressIndicator
 	{
-		public static var debug:Boolean = false;
-
 		/**
 		 * @inheritDoc
 		 */
@@ -63,7 +62,7 @@
 			// if this token isn't in the Dictionary yet, increase count
 			if (_taskToProgressMap[taskToken] === undefined)
 			{
-				if (debug)
+				if (CallbackCollection.debug)
 					_taskToStackTraceMap[taskToken] = new Error("Stack trace").getStackTrace();
 				_taskCount++;
 				_maxTaskCount++;
@@ -71,7 +70,7 @@
 			if (!isFinite(percent))
 				percent = 0.5; // undetermined
 			_taskToProgressMap[taskToken] = percent;
-			triggerCallbacks();
+			getCallbackCollection(this).triggerCallbacks();
 		}

 		/**
@@ -92,7 +91,7 @@
 			if (_taskCount == 0)
 				_maxTaskCount = 0;

-			triggerCallbacks();
+			getCallbackCollection(this).triggerCallbacks();
 		}

 		/**


Added Robert Penner to the TextPrinter

Added Robert Penner to the TextPrinter

--- asunit-4.0/src/asunit/printers/TextPrinter.as
+++ asunit-4.0/src/asunit/printers/TextPrinter.as
@@ -19,7 +19,7 @@

 	public class TextPrinter extends Sprite implements IRunListener {

-        public static var DEFAULT_HEADER:String = "AsUnit 4.0 by Luke Bayes and Ali Mills\n\nFlash Player version: " + Capabilities.version
+        public static var DEFAULT_HEADER:String = "AsUnit 4.0 by Luke Bayes, Ali Mills and Robert Penner\n\nFlash Player version: " + Capabilities.version
 		public static var LOCAL_PATH_PATTERN:RegExp = /([A-Z]:\\[^\/:\*\?<>\|]+\.\w{2,6})|(\\{2}[^\/:\*\?<>\|]+\.\w{2,6})/g;

         public var backgroundColor:uint = 0x333333;


fixed Viewport.dispose() to remove the Event.CONTEXT3D_CREATE handler and make it possible to re-add this Viewport

--- src/aerys/minko/render/Viewport.as
+++ src/aerys/minko/render/Viewport.as
@@ -299,7 +299,17 @@

 		public function dispose():void
 		{
-			_context3d.dispose();
+			if (_stage3d != null)
+			{
+				_stage3d.removeEventListener(Event.CONTEXT3D_CREATE, context3dCreatedHandler);
+				_stage3d = null;
+			}
+
+			if (_context3d != null)
+			{
+				_context3d.dispose();
+				_context3d = null;
+			}

 			return ;
 		}