Scripted use of monster audio in final scene

--- Game/Resources/final_event/MonsterScript.as
+++ Game/Resources/final_event/MonsterScript.as
@@ -6,11 +6,21 @@
     float waitTimer;
     float eatingTimer;
     int phase;
+
+	Component::SoundSource @snd_shriek;
+    Component::SoundSource @snd_death;
+    Component::SoundSource @snd_landing;
+    Component::SoundSource @snd_falling;

     MonsterScript(Entity @entity){
         @hub = Managers();
         @self = @entity;
         @cart = GetEntityByGUID(1511260476);
+
+        @snd_shriek = GetEntityByGUID(1512046440).GetSoundSource();
+        @snd_landing = GetEntityByGUID(1512045002).GetSoundSource();
+        @snd_death = GetEntityByGUID(1512044219).GetSoundSource();
+        @snd_falling = GetEntityByGUID(1512044955).GetSoundSource();

         phase = 0;
         fallspeed = 0.0f;
@@ -31,6 +41,7 @@
                 self.position.y -= fallspeed * deltaTime;
                 if (self.position.y <= 0.0f) {
                     self.position.y = 0.0f;
+                    snd_landing.Play();
                     phase = 2;
                 }
                 break;
@@ -70,6 +81,7 @@
             }
             case 1: { // Die
                 phase = 6; // Collapse
+                snd_death.Play();
                 print("Monster: I'm dying now.\n");
                 break;
             }
@@ -79,10 +91,12 @@
     void BecomeExposed() {
         print("I am becoming exposed now!\n");
         phase = 1;
+        snd_falling.Play();
     }

     void StopCharging() {
         print("Stopping my charge\n");
         phase = 4;
+        snd_shriek.Play();
     }
 }


G711: removed unused import

G711: removed unused import

--- src/com/axis/codec/g711.as
+++ src/com/axis/codec/g711.as
@@ -1,6 +1,4 @@
 package com.axis.codec {
-
-  import flash.external.ExternalInterface;

   public class g711 {


editor reads in location variables in a more robust way, accounting for inconsistencies and fixing them as they pop up.

--- flexEditor/src/org/arisgames/editor/models/GameModel.as
+++ flexEditor/src/org/arisgames/editor/models/GameModel.as
@@ -119,10 +119,10 @@
 				pm.contentType = AppUtils.getContentTypeValueByName(obj.result.data.list.getItemAt(j).type);
 				pm.contentId = obj.result.data.list.getItemAt(j).type_id;
 				pm.quantity = obj.result.data.list.getItemAt(j).item_qty;
-				pm.hidden = obj.result.data.list.getItemAt(j).hidden;
-				pm.forcedView = obj.result.data.list.getItemAt(j).force_view;
+				pm.hidden = obj.result.data.list.getItemAt(j).hidden ? (obj.result.data.list.getItemAt(j).hidden == '1' ? true : false) : false;
+				pm.forcedView = obj.result.data.list.getItemAt(j).force_view ? (obj.result.data.list.getItemAt(j).force_view == '1' ? true : false) : false;
 				pm.errorRange = obj.result.data.list.getItemAt(j).error;
-				pm.quickTravel = obj.result.data.list.getItemAt(j).allow_quick_travel;
+				pm.quickTravel = obj.result.data.list.getItemAt(j).allow_quick_travel ? (obj.result.data.list.getItemAt(j).allow_quick_travel == '1' ? true : false) : false;
 				pm.imageMatchMediaId = obj.result.data.list.getItemAt(j).match_media_id;

 				for each (var p:PlaceMark in tmpPlacemarks){


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

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

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

--- frameworks/projects/mx/src/mx/containers/FormHeading.as
+++ frameworks/projects/mx/src/mx/containers/FormHeading.as
@@ -60,6 +60,8 @@
 [Style(name="paddingTop", type="Number", format="Length", inherit="no")]

 [IconFile("FormHeading.png")]
+
+[Alternative(replacement="spark.components.FormHeading", since="4.5")]

 /**
  *  The FormHeading container is used to display a heading


Transferred from the Adobe Open Source Subversion Repository

Revision: 4380
Author:   rfrishbe@adobe.com
Date:     2008-12-23T10:00:21.848800Z

Log Message:
-----------
Mostly rename changes in Group and FxContainer.

1.  GraphicElement.elementHost:GroupBase -> GraphicElement.parent:DisplayObjectContainer (parent already exists in the current code-base...I’m just removing elementHost now)

2.  Group content APIs now use “element” instead of “item.”  The new methods were added a while ago, but the old ones co-existed.  These particular changes remove the old methods and strongly type the new ones to deal with IVisualElements rather than Objects.  Here are the overall changes:

numItems:int -> numElements:int
getItemAt(int):Object -> getElementAt(int):IVisualElement
addItem(Object):Object -> addElement(IVisualElement):IVisualElement
addItemAt(Object, int):Object -> addElementAt(IVisualElement, int):IVisualElement
removeItem(Object):Object -> removeElement(IVisualElement):IVisualElement
removeItemAt(int):Object -> removeElementAt(int):IVisualElement
getItemIndex(Object):int -> getElementIndex(IVisualElement):int
setItemIndex(Object, int):void -> setElementIndex(IVisualElement, int):void
swapItems(Object, Object):void -> swapElements(IVisualElement, IVisualElement):void
swapItemsAt(int, int):void -> swapElementsAt(int, int):void

3.  Group and FxContainer's mxmlContent property is now strongly typed as an Array of IVisualElements instead of an Object

4.  Removing ITransformable...there's no need for it.

5.  Had to update Mustella for these changes (the Perforce changes are checked in, and here's the mustella.swc change for checkintests)

QE Notes: Joan and Steve worked with me on changing all the SDK QA tests.
Doc Notes: None
Bugs: SDK-18063
Reviewer: Jason
tests: checkintests, Mustella FxContainer, Group, and DataGroup (Joan ran all tests on an earlier version of these changes, so hopefully nothing broke in the meantime).  Some of the Group/DataGroup ones were failing for me, but I'm pretty sure they're all excluded (tests don't seem to exclude for me when I VPN in...)

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/TransformOffsets.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxScroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/layouts/WheelLayout.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/ITransformable.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/ItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/RemoveAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/flex4/flex4test_testScript.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/core/IViewport.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/testWheel.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/wireframe/FxDefaultComplexItemRenderer.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElementContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/states/AddItems.as</path>
<path kind="file" action="M">/flex/sdk/trunk/mustella/mustella.swc</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxDefaultComplexItemRenderer.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/AddAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxContainer.as</path>

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

--- frameworks/projects/spark/src/spark/components/Group.as
+++ frameworks/projects/spark/src/spark/components/Group.as
@@ -86,16 +86,12 @@
     private var mxmlContentChanged:Boolean = false;
     private var needsDisplayObjectAssignment:Boolean = false;

-    private var _mxmlContent:Object;
-    private var _mxmlContentType:int;
+    private var _mxmlContent:Array;
     private var layeringMode:uint = ITEM_ORDERED_LAYERING;
     private var numGraphicElements:uint = 0;

     private static const ITEM_ORDERED_LAYERING:uint = 0;
     private static const SPARSE_LAYERING:uint = 1;
-
-    private static const MXML_CONTENT_TYPE_UNKNOWN:int = 0;
-    private static const MXML_CONTENT_TYPE_ARRAY:int = 1;

     //----------------------------------
     //  alpha
@@ -123,7 +119,7 @@
             {
                 _blendMode = BlendMode.LAYER;
                 blendModeChanged = true;
-                needsDisplayObjectAssignment = true;
+                invalidateDisplayObjectOrdering();
                 invalidateProperties();
             }
         }
@@ -133,7 +129,7 @@
             {
                 _blendMode = BlendMode.NORMAL;
                 blendModeChanged = true;
-                needsDisplayObjectAssignment = true;
+                invalidateDisplayObjectOrdering();
                 invalidateProperties();
             }
         }
@@ -197,7 +193,7 @@
         if ((oldValue == BlendMode.NORMAL || value == BlendMode.NORMAL) &&
             !(oldValue == BlendMode.NORMAL && value == BlendMode.NORMAL))
         {
-            needsDisplayObjectAssignment = true;
+            invalidateDisplayObjectOrdering();
         }

         invalidateProperties();
@@ -207,6 +203,7 @@
     //  mxmlContent
     //----------------------------------

+    [ArrayElementType("mx.core.IVisualElement")]
     /**
      *  Content for this Group.  Do not modify this array directly.
      *
@@ -221,7 +218,7 @@
      *
      *  @default null
      */
-    public function get mxmlContent():Object
+    public function get mxmlContent():Array
     {
         return _mxmlContent;
     }
@@ -229,15 +226,9 @@
     /**
      *  @private
      */
-    public function set mxmlContent(value:Object):void
+    public function set mxmlContent(value:Array):void
     {
         _mxmlContent = value;
-
-        if (_mxmlContent is Array)
-            _mxmlContentType = MXML_CONTENT_TYPE_ARRAY;
-        else
-            _mxmlContentType = MXML_CONTENT_TYPE_UNKNOWN;
-
         mxmlContentChanged = true;
         maskChanged = true;
         invalidateProperties();
@@ -442,7 +433,7 @@
         var n:int = numElements;
         for (var i:int = 0; i < n; i++)
         {
-            var child:Object = getItemAt(i);
+            var child:IVisualElement = getElementAt(i);

             if ( recursive && child is IStyleClient)
             {
@@ -475,30 +466,21 @@
      */
     public function get numElements():int
     {
-        if (_mxmlContent === null)
+        if (_mxmlContent == null)
             return 0;
-
-        if (_mxmlContentType == MXML_CONTENT_TYPE_ARRAY)
-            return _mxmlContent.length;
-
-        return 1;
+
+        return _mxmlContent.length;
     }

     /**
      *  @inheritDoc
      */
-    public function getElementAt(index:int):Object
+    public function getElementAt(index:int):IVisualElement
     {
         // check for RangeError:
         checkForRangeError(index);

-        if (_mxmlContent === null)
-            return null;
-
-        if (_mxmlContentType == MXML_CONTENT_TYPE_ARRAY)
-            return _mxmlContent[index];
-
-        return _mxmlContent;
+        return _mxmlContent[index];
     }

     /**
@@ -508,14 +490,7 @@
     private function checkForRangeError(index:int, addingElement:Boolean = false):void
     {
         // figure out the maximum allowable index
-        var maxIndex:int = -1;
-
-        if (_mxmlContent === null)
-            maxIndex = -1;
-        else if (_mxmlContentType == MXML_CONTENT_TYPE_UNKNOWN)
-            maxIndex = 0;
-        else if (_mxmlContentType == MXML_CONTENT_TYPE_ARRAY)
-            maxIndex = mxmlContent.length - 1;
+        var maxIndex:int = (_mxmlContent == null ? -1 : _mxmlContent.length - 1);

         // if adding an element, we allow an extra index at the end
         if (addingElement)
@@ -528,7 +503,7 @@
     /**
      *  @inheritDoc
      */
-    public function addElement(element:Object):Object
+    public function addElement(element:IVisualElement):IVisualElement
     {
         return addElementAt(element, numElements);
     }
@@ -536,7 +511,7 @@
     /**
      *  @inheritDoc
      */
-    public function addElementAt(element:Object, index:int):Object
+    public function addElementAt(element:IVisualElement, index:int):IVisualElement
     {
         if (element == this)
             throw new ArgumentError("Cannot add yourself as a child of yourself");
@@ -545,34 +520,23 @@
         checkForRangeError(index, true);

         // If we don't have any content yet, initialize it to an empty array
-        if (_mxmlContent === null)
+        if (_mxmlContent == null)
         {
             mxmlContent = [];
             mxmlContentChanged = false;
         }

-        // If we have unknown content (ie a single item), convert to an Array
-        if (_mxmlContentType == MXML_CONTENT_TYPE_UNKNOWN)
-        {
-            _mxmlContentType = MXML_CONTENT_TYPE_ARRAY;
-            _mxmlContent = [_mxmlContent];
-        }
-
-        if (_mxmlContentType == MXML_CONTENT_TYPE_ARRAY)
-            _mxmlContent.splice(index, 0, element);
+        _mxmlContent.splice(index, 0, element);

         elementAdded(element, index);

-        needsDisplayObjectAssignment = true;
-        invalidateProperties();
-
         return element;
     }

     /**
      *  @inheritDoc
      */
-    public function removeElement(element:Object):Object
+    public function removeElement(element:IVisualElement):IVisualElement
     {
         return removeElementAt(getElementIndex(element));
     }
@@ -580,41 +544,21 @@
     /**
      *  @inheritDoc
      */
-    public function removeElementAt(index:int):Object
+    public function removeElementAt(index:int):IVisualElement
     {
         // check RangeError
         checkForRangeError(index);

-        var element:Object;
-
-        if (_mxmlContent === null)
-            return null;
-
-        // Need to call itemRemoved before removing the item so anyone listening
+        var element:IVisualElement;
+
+        // Need to call elementRemoved before removing the item so anyone listening
         // for the event can access the item.

         elementRemoved(index);

-        switch (_mxmlContentType)
-        {
-            case MXML_CONTENT_TYPE_ARRAY:
-            {
-                var removed:Array = _mxmlContent.splice(index, 1);
-                if (removed && removed.length > 0)
-                    element = removed[0];
-                break;
-            }
-
-            case MXML_CONTENT_TYPE_UNKNOWN:
-            {
-                element = _mxmlContent;
-                _mxmlContent = null;
-                break;
-            }
-        }
-
-        needsDisplayObjectAssignment = true;
-        invalidateProperties();
+        var removed:Array = _mxmlContent.splice(index, 1);
+        if (removed && removed.length > 0)
+            element = removed[0];

         return element;
     }
@@ -622,25 +566,9 @@
     /**
      *  @inheritDoc
      */
-    public function getElementIndex(element:Object):int
-    {
-        var index:int = -1;
-
-        switch (_mxmlContentType)
-        {
-            case MXML_CONTENT_TYPE_UNKNOWN:
-            {
-                if (_mxmlContent == element)
-                    index = 0;
-                break;
-            }
-
-            case MXML_CONTENT_TYPE_ARRAY:
-            {
-                index = _mxmlContent.indexOf(element);
-                break;
-            }
-        }
+    public function getElementIndex(element:IVisualElement):int
+    {
+        var index:int = _mxmlContent ? _mxmlContent.indexOf(element) : -1;

         if (index == -1)
             throw ArgumentError(element + " is not found in this Group");
@@ -651,7 +579,7 @@
     /**
      *  @inheritDoc
      */
-    public function setElementIndex(element:Object, index:int):void
+    public function setElementIndex(element:IVisualElement, index:int):void
     {
         // check for RangeError...this is done in addItemAt
         // but we want to do it before removing the item
@@ -664,7 +592,7 @@
     /**
      *  @inheritDoc
      */
-    public function swapElements(element1:Object, element2:Object):void
+    public function swapElements(element1:IVisualElement, element2:IVisualElement):void
     {
         swapElementsAt(getElementIndex(element1), getElementIndex(element2));
     }
@@ -674,7 +602,7 @@
      */
     public function swapElementsAt(index1:int, index2:int):void
     {
-        // Make sure that index1 is the smaller index so that addItemAt
+        // Make sure that index1 is the smaller index so that addElementAt
         // doesn't RTE
         if (index1 > index2)
         {
@@ -685,101 +613,14 @@
         else if (index1 == index2)
             return;

-        var element1:Object = getElementAt(index1);
-        var element2:Object = getElementAt(index2);
+        var element1:IVisualElement = getElementAt(index1);
+        var element2:IVisualElement = getElementAt(index2);

         removeElement(element1);
         removeElement(element2);

         addElementAt(element2, index1);
         addElementAt(element1, index2);
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    //  DEPRECATED Methods ...
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  This method is deprecated and will be removed from Group.
-     */
-    public function get numItems():int
-    {
-        return numElements;
-    }
-
-    /**
-     *  This method is deprecated and will be removed from Group.
-     */
-    public function getItemAt(index:int):Object
-    {
-        return getElementAt(index);
-    }
-
-
-    /**
-     *  This method is deprecated and will be removed from Group.
-     */
-    public function getItemIndex(item:Object):int
-    {
-        return getElementIndex(item);
-    }
-
-    /**
-     *  This method is deprecated and will be removed from Group.
-     */
-    public function addItem(item:Object):Object
-    {
-        return addElement(item);
-    }
-
-    /**
-     *  This method is deprecated and will be removed from Group.
-     */
-    public function addItemAt(item:Object, index:int):Object
-    {
-        return addElementAt(item, index);
-    }
-
-    /**
-     *  This method is deprecated and will be removed from Group.
-     */
-    public function removeItem(item:Object):Object
-    {
-        return removeElement(item);
-    }
-
-    /**
-     *  This method is deprecated and will be removed from Group.
-     */
-    public function removeItemAt(index:int):Object
-    {
-        return removeElementAt(index);
-    }
-
-    /**
-     *  This method is deprecated and will be removed from Group.
-     */
-    public function setItemIndex(item:Object, index:int):void
-    {
-        setElementIndex(item, index);
-    }
-
-    /**
-     *  This method is deprecated and will be removed from Group.
-     */
-    public function swapItems(item1:Object, item2:Object):void
-    {
-        swapElements(item1, item2);
-    }
-
-    /**
-     *  This method is deprecated and will be removed from Group.
-     */
-    public function swapItemsAt(index1:int, index2:int):void
-    {
-        swapElementsAt(index1, index2);
     }

     //--------------------------------------------------------------------------
@@ -806,7 +647,7 @@
      */
     override public function getLayoutElementAt(index:int):ILayoutElement
     {
-        var element:Object = getElementAt(index);
+        var element:IVisualElement = getElementAt(index);

         return LayoutElementFactory.getLayoutElementFor(element);
     }
@@ -825,10 +666,7 @@
     {
         if (layeringMode == ITEM_ORDERED_LAYERING)
             layeringMode = SPARSE_LAYERING;
-        if (needsDisplayObjectAssignment == true)
-            return;
-        needsDisplayObjectAssignment = true;
-        invalidateProperties();
+        invalidateDisplayObjectOrdering();
     }

     /**
@@ -839,25 +677,36 @@
      *
      *  @param index The index where the item was added.
      */
-    mx_internal function elementAdded(element:Object, index:int):void
+    mx_internal function elementAdded(element:IVisualElement, index:int):void
     {
         var child:DisplayObject;

-        if (element is IVisualElement && IVisualElement(element).layer != 0)
+        if (element.layer != 0)
             invalidateLayering();

         if (element is IGraphicElement)
         {
             numGraphicElements++;
             addingGraphicElementChild(element as IGraphicElement);
+            invalidateDisplayObjectOrdering();
         }
         else
         {
             // item must be a DisplayObject

-            // This always adds the child to the end of the display list. Any
-            // ordering discrepancies will be fixed up in assignDisplayObjects().
-            child = addItemToDisplayList(DisplayObject(element), element);
+            // if the display object ordering is invalidated (because we have graphic elements
+            // that aren't actually in the display list), then lets just add our item to the end.
+            // If the ordering isn't invalidated, then let's just try to add it to the proper index.
+            if (invalidateDisplayObjectOrdering())
+            {
+                // This always adds the child to the end of the display list. Any
+                // ordering discrepancies will be fixed up in assignDisplayObjects().
+                child = addItemToDisplayList(DisplayObject(element), element);
+            }
+            else
+            {
+                child = addItemToDisplayList(DisplayObject(element), element, index);
+            }
         }

         dispatchEvent(new ItemExistenceChangedEvent(
@@ -875,7 +724,7 @@
      */
     mx_internal function elementRemoved(index:int):void
     {
-        var element:Object = getElementAt(index);
+        var element:IVisualElement = getElementAt(index);
         var childDO:DisplayObject = element as DisplayObject;

         dispatchEvent(new ItemExistenceChangedEvent(
@@ -891,6 +740,7 @@
         if (childDO && childDO.parent == this)
             super.removeChild(childDO);

+        invalidateDisplayObjectOrdering();
         invalidateSize();
         invalidateDisplayList();
     }
@@ -938,6 +788,27 @@
         return blendMode == "normal" && (layeringMode == ITEM_ORDERED_LAYERING);
     }

+    /**
+     *  @private
+     *
+     *  Invalidates the display object ordering and will run assignDisplayObjects()
+     *  if necessary.
+     *
+     *  @return true if the display object ordering needed to be invalidated;
+     *          false otherwise.
+     */
+    private function invalidateDisplayObjectOrdering():Boolean
+    {
+        if (layeringMode == SPARSE_LAYERING || numGraphicElements > 0)
+        {
+            needsDisplayObjectAssignment = true;
+            invalidateProperties();
+            return true;
+        }
+
+        return false;
+    }
+

     /**
      *  @private
@@ -957,13 +828,11 @@
         var len:int = numElements;
         for (var i:int = 0; i < len; i++)
         {
-            var item:Object = getElementAt(i);
+            var item:IVisualElement = getElementAt(i);

             if (layeringMode != ITEM_ORDERED_LAYERING)
             {
-                var layer:Number = 0;
-                if (item is IVisualElement)
-                    layer = (item as IVisualElement).layer;
+                var layer:Number = item.layer;
                 if (layer != 0)
                 {
                     if (layer > 0)
@@ -1034,45 +903,45 @@
     /**
      *  @private
      */
-    private function assignDisplayObjectTo(item:Object,mergeData:GroupDisplayObjectMergeData):void
+    private function assignDisplayObjectTo(element:IVisualElement,mergeData:GroupDisplayObjectMergeData):void
     {
-        if (item is DisplayObject)
-        {
-            super.setChildIndex(item as DisplayObject, mergeData.insertIndex);
+        if (element is DisplayObject)
+        {
+            super.setChildIndex(element as DisplayObject, mergeData.insertIndex);

             mergeData.insertIndex++;
             // Null this out so that we are forced to create one for the next item
             mergeData.currentAssignableDO = null;
         }
-        else if (item is IGraphicElement)
-        {
-            var element:IGraphicElement = item as IGraphicElement;
-
-            if (mergeData.currentAssignableDO == null || element.needsDisplayObject)
-            {
-                var newChild:DisplayObject = element.displayObject;
+        else if (element is IGraphicElement)
+        {
+            var graphicElement:IGraphicElement = element as IGraphicElement;
+
+            if (mergeData.currentAssignableDO == null || graphicElement.needsDisplayObject)
+            {
+                var newChild:DisplayObject = graphicElement.displayObject;

                 if (newChild == null)
-                    newChild = element.createDisplayObject();
+                    newChild = graphicElement.createDisplayObject();

-                addItemToDisplayList(newChild, item, mergeData.insertIndex);
+                addItemToDisplayList(newChild, element, mergeData.insertIndex);
                 // If the element is transformed, the next item needs its own DO
-                mergeData.currentAssignableDO = element.nextSiblingNeedsDisplayObject ? null : newChild;
+                mergeData.currentAssignableDO = graphicElement.nextSiblingNeedsDisplayObject ? null : newChild;
                 mergeData.insertIndex++;
             }
             else
             {
                 // Item should be assigned the currentAssignableDO
                 // If it already has a DO, we need to remove it
-                if (element.displayObject)
+                if (graphicElement.displayObject)
                 {
-                    if (element.displayObject.parent == this)
-                        super.removeChild(element.displayObject);
-                    element.destroyDisplayObject();
+                    if (graphicElement.displayObject.parent == this)
+                        super.removeChild(graphicElement.displayObject);
+                    graphicElement.destroyDisplayObject();
                 }

-                element.sharedDisplayObject = mergeData.currentAssignableDO;
-                if (element.nextSiblingNeedsDisplayObject)
+                graphicElement.sharedDisplayObject = mergeData.currentAssignableDO;
+                if (graphicElement.nextSiblingNeedsDisplayObject)
                     mergeData.currentAssignableDO = null;
             }
         }
@@ -1091,19 +960,13 @@
      *
      *  @return DisplayObject that was added.
      */
-    protected function addItemToDisplayList(child:DisplayObject, item:Object, index:int = -1):DisplayObject
+    protected function addItemToDisplayList(child:DisplayObject, element:IVisualElement, index:int = -1):DisplayObject
     {
-        var host:DisplayObject;
-
-        // TODO (rfrishbe): need to check for DisplayObject?
-        if (item is IVisualElement)
-            host = IVisualElement(item).parent;
-        else if (item is DisplayObject)
-            host = DisplayObject(item).parent;
+        var host:DisplayObject = element.parent;

         // Remove the item from the group if that group isn't this group
         if (host && host is IVisualElementContainer && host != this)
-            IVisualElementContainer(host).removeElement(item);
+            IVisualElementContainer(host).removeElement(element);

         // Calling removeItem should have already removed the child. This
@@ -1138,8 +1001,7 @@
         super.graphicElementLayerChanged(e);

         // One of our children have told us they might need a displayObject
-        needsDisplayObjectAssignment = true;
-        invalidateProperties();
+        invalidateDisplayObjectOrdering();
     }

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


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/rpc/src/mx/utils/RpcClassAliasInitializer.as
+++ frameworks/projects/rpc/src/mx/utils/RpcClassAliasInitializer.as
@@ -1,21 +1,21 @@
-/**************************************************************************
- * ADOBE CONFIDENTIAL
- *
- * ___________________
- *
- *  Copyright 2010 Adobe Systems Incorporated
- *  All Rights Reserved.
- *
- * NOTICE:  All information contained herein is, and remains
- * the property of Adobe Systems Incorporated and its suppliers,
- * if any.  The intellectual and technical concepts contained
- * herein are proprietary to Adobe Systems Incorporated and its
- * suppliers and may be covered by U.S. and Foreign Patents,
- * patents in process, and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * from Adobe Systems Incorporated.
- **************************************************************************/
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////

 package mx.utils
 {


fixtouchevent mouse up

fixtouchevent mouse up

--- src/flash/display/Stage.as
+++ src/flash/display/Stage.as
@@ -158,7 +158,6 @@

 		private function canvas_touchevent(e:Object):void
 		{
-			e.preventDefault();
 			var jsType:String = e.type;
 			var flashType:String;
 			var flashType2:String;
@@ -178,13 +177,14 @@
 				case "touchstart":
 					flashType = TouchEvent.TOUCH_BEGIN;
 					flashType2 = MouseEvent.MOUSE_DOWN;
-					break;
-
+					e.preventDefault();
+					break;
 			}
 			if (flashType) {
-				var rect:ClientRect = canvas.getBoundingClientRect();
-				_mouseX = e.touches[0].pageX - rect.left;
-				_mouseY = e.touches[0].pageY - rect.top;
+				if (e.targetTouches.length) {
+					_mouseX = e.targetTouches[0].pageX - canvas.offsetLeft;
+					_mouseY = e.targetTouches[0].pageY - canvas.offsetTop;
+				}
 				if (hasEventListener(flashType)) {
 					dispatchEvent(new TouchEvent(flashType,true,false,0,true,_mouseX,_mouseY));
 				}
@@ -234,9 +234,8 @@

 			}
 			if(flashType){
-				var rect:ClientRect = canvas.getBoundingClientRect();
-				_mouseX = e.clientX - rect.left;
-				_mouseY = e.clientY - rect.top;
+				_mouseX = e.pageX - canvas.offsetLeft;
+				_mouseY = e.pageY - canvas.offsetTop;
 				if (hasEventListener(flashType)) {
 					dispatchEvent(new MouseEvent(flashType,true,false,_mouseX,_mouseY,null,e.ctrlKey,e.altKey,e.shiftKey,e.button>0,e.wheelDelta));
 				}


Removed unnecessary import.

Removed unnecessary import.

git-svn-id: 41360ad359616a519dfba9f2f48af1afe653c9f7@101 be230a1c-449f-4488-b524-6273046f66f0

--- src/as/client/ClientApp.as
+++ src/as/client/ClientApp.as
@@ -5,7 +5,6 @@

 import flash.display.Bitmap;
 import flash.display.BitmapData;
-import flash.display.DisplayObject;
 import flash.display.Shape;
 import flash.display.SimpleButton;
 import flash.display.Sprite;


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

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

 package mx.core
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 6394
Author:   clucier@adobe.com
Date:     2009-04-29T20:33:19.402572Z

Log Message:
-----------
Fixing issue found by dev. Property overrides were caching their target, so if the target ever changed, and the override was applied again, it was not updating the appropriate (new) target.

Reviewer: Glenn
QE Notes: None
Bugs: None

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/states/SetEventHandler.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/states/SetStyle.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/states/SetProperty.as</path>

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

--- frameworks/projects/framework/src/mx/states/SetProperty.as
+++ frameworks/projects/framework/src/mx/states/SetProperty.as
@@ -189,6 +189,17 @@
      *  @productversion Flex 3
      */
     public var target:Object;
+
+    /**
+     *  The cached target for which we applied our override.
+     *  We keep track of the applied target while applied since
+     *  our target may be swapped out in the owning document and
+     *  we want to make sure we roll back the correct (original)
+     *  element.
+     *
+     *  @private
+     */
+    private var appliedTarget:Object;

     //----------------------------------
     //  value
@@ -264,8 +275,8 @@
         var obj:* = getOverrideContext(target, parent);
         if (obj != null)
         {
-        	target = obj;
-	        var propName:String = (PSEUDONYMS[name] && (PSEUDONYMS[name] in target)) ?
+        	appliedTarget = obj;
+	        var propName:String = (PSEUDONYMS[name] && (PSEUDONYMS[name] in appliedTarget)) ?
 	                          PSEUDONYMS[name] :
 	                          name;

@@ -328,7 +339,7 @@
      */
     public function remove(parent:UIComponent):void
     {
-        var obj:* = getOverrideContext(target, parent);
+        var obj:* = getOverrideContext(appliedTarget, parent);
         if (obj != null && applied)
         {
             var propName:String = (PSEUDONYMS[name] && (PSEUDONYMS[name] in target)) ?
@@ -363,6 +374,7 @@
 	        // Clear our flags and override context.
 	        applied = false;
 	        parentContext = null;
+	        appliedTarget = null;
         }
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 20565
Author:   dloverin@adobe.com
Date:     2011-03-03T02:34:32.933942Z

Log Message:
-----------
DataGrid key event fixes.

 * Ignore keystrokes that do not target the data grid or its focusOwner.
 * Ignore select all events that do not target the data grid or its focusOwner.

QE notes: Test "select all" on both Windows and Mac.
Doc notes: None.
Bugs: SDK-29795, SDK-29805
Reviewer: Carol
Tests run: cyclone
Is noteworthy for integration: No.

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

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

--- frameworks/projects/spark/src/spark/components/DataGrid.as
+++ frameworks/projects/spark/src/spark/components/DataGrid.as
@@ -2337,6 +2337,10 @@
             return;
         }

+        // If the key wasn't targeted to us, then ignore it.
+        if (!isOurFocus(DisplayObject(event.target)))
+            return;
+
         // Ctrl-A only comes thru on Mac.  On Windows it is a SELECT_ALL
         // event.
         if (event.keyCode == Keyboard.A && event.ctrlKey)
@@ -2435,8 +2439,12 @@
      */
     protected function selectAllHandler(event:Event):void
     {
-        if (!grid || event.isDefaultPrevented())
+        // If the select all was not targeted to the DataGrid, then ignore it.
+        if (!grid || event.isDefaultPrevented() ||
+            !isOurFocus(DisplayObject(event.target)))
+        {
             return;
+        }

         selectAllFromKeyboard();
     }


FLEX-26808 Terminating statements, correcting asdocs, and removing an unused variable and unused method.

--- frameworks/projects/spark/src/spark/components/DataGrid.as
+++ frameworks/projects/spark/src/spark/components/DataGrid.as
@@ -1992,7 +1992,7 @@
      *
      *  @default null.
      *
-     *  @see #dataField
+     *  @see spark.components.gridClasses.GridColumn#dataField
      *  @see spark.components.gridClasses.IGridItemEditor
      *
      *  @langversion 3.0
@@ -2587,7 +2587,7 @@
     }

     /**
-     *  @copy spark.components.Grid#invalidateTypicalItem()
+     *  @copy spark.components.Grid#invalidateTypicalItemRenderer()
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -3710,7 +3710,7 @@
             var f:Function = function(g:Grid):void
             {
                 g.selectedCell = valueCopy;
-            }
+            };
             deferredGridOperations.push(f);
         }
     }
@@ -3748,7 +3748,7 @@
             var f:Function = function(g:Grid):void
             {
                 g.selectedCells = valueCopy;
-            }
+            };
             deferredGridOperations.push(f);
         }
     }
@@ -3830,7 +3830,7 @@
             var f:Function = function(g:Grid):void
             {
                 g.selectedIndices = valueCopy;
-            }
+            };
             deferredGridOperations.push(f);
         }
     }
@@ -3874,7 +3874,7 @@
             var f:Function = function(g:Grid):void
             {
                 g.selectedItem = value;
-            }
+            };
             deferredGridOperations.push(f);
         }
     }
@@ -3921,7 +3921,7 @@
             var f:Function = function(g:Grid):void
             {
                 g.selectedItems = valueCopy;
-            }
+            };
             deferredGridOperations.push(f);
         }
     }
@@ -5423,14 +5423,11 @@
         // Cancel so another component doesn't handle this event.
         event.preventDefault();

-        var selectionChanged:Boolean = false;
-
         if (event.shiftKey)
         {
             // The shift key-nav key combination extends the selection and
             // updates the caret.
-            selectionChanged =
-                extendSelection(newPosition.rowIndex, newPosition.columnIndex);
+            extendSelection(newPosition.rowIndex, newPosition.columnIndex);
         }
         else if (event.ctrlKey)
         {
@@ -6095,7 +6092,7 @@
      *  a drag-and-drop operation.
      *  Override this method to add other data to the drag source.
      *
-     *  @param ds The DragSource object to which to add the data.
+     *  @param dragSource The DragSource object to which to add the data.
      *
      *  @langversion 3.0
      *  @playerversion Flash 11
@@ -6474,25 +6471,7 @@
         // Destroy the dropIndicator instance
         destroyDropIndicator();
     }
-
-    /**
-     *  @private
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    private function touchInteractionStartHandler(event:TouchInteractionEvent):void
-    {
-        // cancel actual selection
-        mouseDownRowIndex = -1;
-        mouseDownColumnIndex = -1;
-        mouseDownObject = null;
-        mouseDownPoint = null;
-        pendingSelectionOnMouseUp = false;
-    }
-
+
     /**
      *  @private
      *  Handles DragEvent.DRAG_DROP events. This method  hides


Transferred from the Adobe Open Source Subversion Repository

Revision: 20642
Author:   smgilson@adobe.com
Date:     2011-03-07T17:53:01.854031Z

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

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/HGroup.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/primitives/BitmapImage.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGroup.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/components/examples/TraceSelectionRanges.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/ButtonBarButton.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Group.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Image.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/FormHeading.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/VideoPlayer.as</path>

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

--- frameworks/projects/spark/src/spark/components/RichText.as
+++ frameworks/projects/spark/src/spark/components/RichText.as
@@ -908,6 +908,11 @@
      *  @see spark.utils.TextFlowUtil#importFromString()
      *  @see spark.utils.TextFlowUtil#importFromXML()
      *  @see spark.components.RichEditableText#text
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     public function get textFlow():TextFlow
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 10168
Author:   gosmith@adobe.com
Date:     2009-09-11T21:23:32.233555Z

Log Message:
-----------
The 'content' property for rich text in Spark components is now get/set rather than set-only, so that it plays well with states. The getter will always return a TextFlow because this is the canonical representation of rich text content in TLF, and if you have edited or programatically mutated the content the current TextFlow is what the states mechanism should save off.

QE notes: Please test state-dependent 'content' in the Spark RichText, RichEditableText, and TextArea.
Doc notes: I've added more documentation regarding the 'content' property.
Bugs: SDK-23120
Reviewer: Carol
Tests run: ant checkintests
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichText.as</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/components/RichEditableText.as</path>

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

--- frameworks/projects/spark/src/spark/components/RichText.as
+++ frameworks/projects/spark/src/spark/components/RichText.as
@@ -13,7 +13,6 @@
 {

 import flash.display.DisplayObject;
-import flash.display.DisplayObjectContainer;
 import flash.text.TextFormat;
 import flash.text.engine.FontLookup;

@@ -22,16 +21,13 @@
 import flashx.textLayout.conversion.ITextExporter;
 import flashx.textLayout.conversion.ITextImporter;
 import flashx.textLayout.conversion.TextConverter;
-import flashx.textLayout.elements.Configuration;
 import flashx.textLayout.elements.TextFlow;
 import flashx.textLayout.events.DamageEvent;
 import flashx.textLayout.factory.StringTextLineFactory;
 import flashx.textLayout.factory.TextFlowTextLineFactory;
 import flashx.textLayout.factory.TextLineFactoryBase;
 import flashx.textLayout.factory.TruncationOptions;
-import flashx.textLayout.formats.FormatValue;
 import flashx.textLayout.formats.ITextLayoutFormat;
-import flashx.textLayout.formats.TextLayoutFormat;

 import mx.core.IEmbeddedFontRegistry;
 import mx.core.IFlexModuleFactory;
@@ -41,8 +37,8 @@
 import mx.core.mx_internal;
 import mx.managers.ISystemManager;

+import spark.components.supportClasses.TextBase;
 import spark.core.CSSTextLayoutFormat;
-import spark.components.supportClasses.TextBase;

 use namespace mx_internal;

@@ -203,8 +199,7 @@
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-public class RichText extends TextBase
-	implements IFontContextComponent
+public class RichText extends TextBase implements IFontContextComponent
 {
     include "../core/Version.as";

@@ -543,12 +538,51 @@
      *  within
, , etc.
      */
     [RichTextContent]
-
-    /**
-     *  This write-only property is for internal use by the MXML compiler.
-     *  Please use the textFlow property to set
-     *  rich text content.
-     */
+
+	/**
+	 *  This property is intended for use in MXML at compile time;
+	 *  to get or set rich text content at runtime,
+	 *  please use the textFlow property instead.
+	 *
+	 *
The content property is the default property
+	 *  for RichText, so that you can write MXML such as
+	 *

+	 *  <s:RichText>Hello <s:span fontWeight="bold"/>World</s:span></s:RichText>
+	 *

+	 *  and have the String and SpanElement that you specify
+	 *  as the content be used to create a TextFlow.

+	 *
+	 *
This property is typed as Object because you can set it to
+	 *  to a String, a FlowElement, or an Array of Strings and FlowElements.
+	 *  In the example above, you are specifying the content
+	 *  to be a 2-element Array whose first element is the String
+	 *  "Hello" and whose second element is a SpanElement with the text
+	 *  "World" in boldface.

+	 *
+	 *
No matter how you specify the content, it gets converted
+	 *  into a TextFlow, and when you get this property, you will get
+	 *  the resulting TextFlow.

+	 *
+	 *
Adobe recommends using textFlow property
+	 *  to get and set rich text content at runtime,
+	 *  because it is strongly typed as a TextFlow
+	 *  rather than as an Object.
+	 *  A TextFlow is the canonical representation
+	 *  for rich text content in the Text Layout Framework.

+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10
+	 *  @playerversion AIR 1.5
+	 *  @productversion Flex 4
+	 */
+    public function get content():Object
+    {
+    	return textFlow;
+    }
+
+    /**
+     *  @private
+     */
     public function set content(value:Object):void
     {
     	// Treat setting the 'content' to null


Transferred from the Adobe Open Source Subversion Repository

Revision: 5545
Author:   jimurphy@adobe.com
Date:     2009-03-25T19:00:52.330680Z

Log Message:
-----------
1st pass of rename according to the spec http://opensource.adobe.com/wiki/display/flexsdk/Dropping+the+Fx+Prefix

Flex now requires CSS Style declarations to declare @namespace rules and disambiguate between halo and spark components using CSS 3 namespace prefixes on type selectors. At compile time, this namespace information will be used to map type names to qualified ActionScript class names. At runtime, type selectors are matched on qualified ActionScript class name (for example mx.controls.Button rather than just Button). Flex 3 applications must be compiled with -compatibility-version=3.0.0 to get unqualified CSS type selector behavior.

QE: Yes, this build may help in updating test cases to use the new namespaces and class names.
Dev: Not yet
Doc: Not yet

Modified Paths:
--------------
748 paths were modified

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

--- frameworks/projects/spark/src/spark/components/RichText.as
+++ frameworks/projects/spark/src/spark/components/RichText.as
@@ -9,7 +9,7 @@
 //
 ////////////////////////////////////////////////////////////////////////////////

-package mx.graphics
+package spark.primitives
 {

 import flash.display.DisplayObjectContainer;
@@ -33,8 +33,8 @@
 import flashx.textLayout.tlf_internal;

 import mx.core.mx_internal;
-import mx.graphics.baseClasses.TextGraphicElement;
-import mx.utils.TextUtil;
+import spark.primitives.supportClasses.TextGraphicElement;
+import spark.utils.TextUtil;

 //--------------------------------------
 //  Styles
@@ -50,7 +50,7 @@

 [DefaultProperty("content")]

-[IconFile("TextGraphic.png")]
+[IconFile("RichText.png")]

 /**
  *  Defines text in FXG.
@@ -58,33 +58,33 @@
  *
This class can display richly-formatted text, with multiple character and paragraph formats.
  *  However, it is non-interactive: it doesn't support scrolling, selection, or editing.

  *
- *
A TextGraphic element defines a text box, specified in the parent Group element's coordinate space,
- *  to contain the provided text. The text box is specified using the x/y and width/height attributes on the TextGraphic element.

+ *
A RichText element defines a text box, specified in the parent Group element's coordinate space,
+ *  to contain the provided text. The text box is specified using the x/y and width/height attributes on the RichText element.

  *
  *
Text is rendered as a graphic element similar to paths and shapes, but with a restricted subset of rendering options.
- *  TextGraphic elements are always rendered using a solid fill color, modified by any opacity, blend mode, and color transformation
- *  defined by parent elements, and clipped to any clipping content defined on its parent elements. TextGraphic content is only filled,
+ *  RichText elements are always rendered using a solid fill color, modified by any opacity, blend mode, and color transformation
+ *  defined by parent elements, and clipped to any clipping content defined on its parent elements. RichText content is only filled,
  *  not stroked.

  *
- *
TextGraphic does not support drawing a background or border; it only renders text and inline graphics. If you want a simpler text class,
- *  use the TextBox class. If you want a text control with more capabilities, use the TextView class.

- *
- *
The TextGraphic element automatically clips the text rendering to the bounds of the text box.

+ *
RichText does not support drawing a background or border; it only renders text and inline graphics. If you want a simpler text class,
+ *  use the SimpleText class. If you want a text control with more capabilities, use the RichEditableText class.

+ *
+ *
The RichText element automatically clips the text rendering to the bounds of the text box.

  *
  *
If you do not specify the value of the width or height properties, or if the specified value
  *  of these properties is 0, the width and height are calculated based on the text content.

  *
- *  @see mx.components.TextView
- *  @see mx.graphics.TextBox
- *
- *  @includeExample examples/TextGraphicExample.mxml
+ *  @see mx.components.RichEditableText
+ *  @see mx.graphics.SimpleText
+ *
+ *  @includeExample examples/RichTextExample.mxml
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-public class TextGraphic extends TextGraphicElement
+public class RichText extends TextGraphicElement
 {
     include "../core/Version.as";

@@ -122,7 +122,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public function TextGraphic()
+    public function RichText()
     {
         super();
         _content = textFlow = createEmptyTextFlow();
@@ -141,7 +141,7 @@

     /**
      *  @private
-     *  This object is determined by the CSS styles of the TextGraphic
+     *  This object is determined by the CSS styles of the RichText
      *  and is updated by createTextFlow() when the hostFormatsInvalid flag
      *  is true.
      */
@@ -151,7 +151,7 @@
      *  @private
      *  This flag indicates whether hostCharacterFormat, hostParagraphFormat,
      *  and hostContainerFormat need to be recalculated from the CSS styles
-     *  of the TextGraphic. It is set true by stylesInitialized() and also
+     *  of the RichText. It is set true by stylesInitialized() and also
      *  when styleChanged() is called with a null argument, indicating that
      *  multiple styles have changed.
      */
@@ -246,7 +246,7 @@
     protected var _content:Object;

     /**
-     *  The text contained in the TextGraphic element.
+     *  The text contained in the RichText element.
      *
      *
The contents of this property can be a sequence of characters, <p>, <br/> or <span> elements.
      *  The <p> and <span> elements can be implied, depending on how you use the style properties.

@@ -258,7 +258,7 @@
      *

      *

      *      <p>
-     *      Starts a new paragraph. A <p> can be a child of a TextGraphic. Children are character sequences,
+     *      Starts a new paragraph. A <p> can be a child of a RichText. Children are character sequences,
      *          <br/> elements, or <span> elements. Every <p> has at least one <span> that can be implied.
      *          Character sequences that are direct children of <p> are in an implied <span>.
      *

@@ -513,7 +513,7 @@

     /**
      *  @private
-     *  Keep this method in sync with the same method in TextView.
+     *  Keep this method in sync with the same method in RichEditableText.
      */
     private function createTextFlow():TextFlow
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 22564
Author:   tkraikit@adobe.com
Date:     2011-09-14T19:50:07.656843Z

Log Message:
-----------
Update ASDoc "@productversion Flex 4.5.2" => "@productversion Flex 4.6"

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/SpinnerListSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/collections/OnDemandDataProvider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/DateSpinnerSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/framework/src/mx/graphics/BitmapScaleMode.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/ContentBackgroundAppearance.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/framework/src/mx/core/FlexVersion.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/ArrowDirection.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/globalization/supportClasses/FormatPattern.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/DefaultTransparentNavigationButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/supportClasses/DropDownController.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/core/ISoftKeyboardHintClient.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/CalloutArrow.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/CalloutButton.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutActionBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/YearProvider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/calendarClasses/DateSelectorDisplayMode.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/ToggleSwitch.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/DefaultBeveledBackButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/SpinnerListScrollerSkin.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/ScrollSnappingMode.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/StageTextSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/DefaultTransparentActionButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/StageTextAreaSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SpinnerListContainer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/ToggleSwitchSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/DateAndTimeProvider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutViewNavigatorSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/SpinnerListContainerSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/CalloutPosition.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/preloaders/SplashScreenImageSource.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/SkinnablePopUpContainer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SplitViewNavigator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/Callout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/StageTextInputSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/collections/NumericDataProvider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableStageText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/preloaders/SplashScreenImage.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/DateSpinnerItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SpinnerList.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/globalization/supportClasses/CalendarDate.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/DefaultBeveledActionButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SpinnerListItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/globalization/supportClasses/DateTimeFormatterEx.as</path>

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

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -1222,7 +1222,7 @@
      *
      *  @langversion 3.0
      *  @playerversion AIR 3
-     *  @productversion Flex 4.5.2
+     *  @productversion Flex 4.6
      */
     public function get pageScrollingEnabled():Boolean
     {
@@ -1289,7 +1289,7 @@
      *
      *  @langversion 3.0
      *  @playerversion AIR 3
-     *  @productversion Flex 4.5.2
+     *  @productversion Flex 4.6
      */
     public function get scrollSnappingMode():String
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 4091
Author:   rfrishbe@adobe.com
Date:     2008-11-12T21:58:46.437695Z

Log Message:
-----------
FxComponent now throws RTEs when accessing the DisplayObjectContainer mutation APIs (addChild, removeChild, etc...).  Instead, one should modify the skin object directly, or if you're adding something to an FxContainer, use addItem, removeItem, etc...  I had to fix flex4tests in checkintests because it was using addChild() on a panel.

Fixed some ASDocs for FxScroller.as

Found a small bug in GraphicElement around setting blendModeChanged back to false in commitProperties (it was accidentally set to true).

Ran checkintests and mustella tests for: List, FxContainer, FxDataContainer, Button, ToggleButton, CheckBox, RadioButton.

QE Notes: We should add tests for FxComponent where one tries to call addChild, removeChild, etc... and gets an RTE.
Doc Notes: None
Bugs: SDK-17655
Reviewer: Jason, Deepa

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxScroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxContainerBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/flex4/flex4test.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/flex4/flex4test_testScript.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>

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

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -299,7 +299,7 @@
     //--------------------------------------------------------------------------

     /**
-     *  @inheritDoc
+     *  Returns 1 if there is a viewport, 0 otherwise.
      */
     public function get numItems():int
     {
@@ -307,8 +307,15 @@
     }

     /**
-     *  @inheritDoc
-     */
+     *  Returns the viewport if there is a viewport and the
+     *  index passed in is 0.  Otherwise, it throws a RangeError.
+     *
+     *  @param index The index of the item to retrieve.
+     *
+     *  @return The item at the specified index.
+     *
+     *  @throws RangeError If the index position does not exist in the child list.
+     */
     public function getItemAt(index:int):Object
     {
         if (viewport && index == 0)
@@ -318,8 +325,15 @@
     }

     /**
-     *  @inheritDoc
-     */
+     *  Returns the 0 if the item passed in is the viewport.
+     *  Otherwise, it throws an ArgumentError.
+     *
+     *  @param item The item to identify.
+     *
+     *  @return The index position of the item to identify.
+     *
+     *  @throws ArgumentError If the item is not a child of this object.
+     */
     public function getItemIndex(item:Object):int
     {
         if (item != null && item == viewport)


Transferred from the Adobe Open Source Subversion Repository

Revision: 19787
Author:   jszeto@adobe.com
Date:     2011-01-17T23:30:59.383799Z

Log Message:
-----------
Mobile support for SoftKeyboard

Initial checkin.

Added support to Application to resize the application when the softKeyboard is shown and hidden.
Added support to Scroller to scroll the focused element into view.

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TextAreaSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ListSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Application.as</path>

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

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -13,20 +13,26 @@
 package spark.components
 {
 import flash.events.Event;
+import flash.events.FocusEvent;
 import flash.events.KeyboardEvent;
 import flash.events.MouseEvent;
+import flash.events.SoftKeyboardEvent;
 import flash.events.TimerEvent;
 import flash.geom.Point;
+import flash.geom.Rectangle;
 import flash.system.Capabilities;
 import flash.text.TextField;
 import flash.ui.Keyboard;
 import flash.utils.Timer;

+import mx.core.EventPriority;
+import mx.core.FlexGlobals;
 import mx.core.IInvalidating;
 import mx.core.IVisualElement;
 import mx.core.IVisualElementContainer;
 import mx.core.InteractionMode;
 import mx.core.LayoutDirection;
+import mx.core.UIComponent;
 import mx.core.mx_internal;
 import mx.events.EffectEvent;
 import mx.events.FlexEvent;
@@ -34,7 +40,10 @@
 import mx.events.PropertyChangeEvent;
 import mx.events.TouchInteractionEvent;
 import mx.managers.IFocusManagerComponent;
-
+import mx.styles.ISimpleStyleClient;
+import mx.styles.IStyleClient;
+
+import spark.components.supportClasses.GroupBase;
 import spark.components.supportClasses.ScrollerLayout;
 import spark.components.supportClasses.SkinnableComponent;
 import spark.core.IViewport;
@@ -46,6 +55,7 @@
 import spark.effects.easing.IEaser;
 import spark.effects.easing.Power;
 import spark.effects.easing.Sine;
+import spark.layouts.supportClasses.LayoutBase;
 import spark.utils.MouseEventUtil;

 use namespace mx_internal;
@@ -547,6 +557,9 @@
         super();
         hasFocusableChildren = true;
         focusEnabled = false;
+
+        addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
+        addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler);
     }

     //--------------------------------------------------------------------------
@@ -682,11 +695,34 @@
      */
     private var inTouchInteraction:Boolean = false;

+    /**
+     *  @private
+     *  Keeps track of whether the Scroller is listening for softKeyboardEvents
+     */
+    private var softKeyboardEventHandlersAdded:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var lastFocusedElement:IVisualElement;
+
     //--------------------------------------------------------------------------
     //
     //  Properties
     //
     //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  ensureFocusedElementIsVisible
+    //----------------------------------
+
+    /**
+     *  A value of true means when a descendant element gains focus, the Scroller will scroll
+     *  that element into view.
+     *
+     *  @default true
+     */
+    public var ensureFocusedElementIsVisible:Boolean = true;

     //----------------------------------
     //  horizontalScrollBar
@@ -996,6 +1032,75 @@
                     checkForInvalidScrollPositions();
                 }
                 break;
+        }
+    }
+
+    /**
+     *  @private
+     *  Listens for any focusIn events from descendants
+     */
+    override protected function focusInHandler(event:FocusEvent):void
+    {
+        super.focusInHandler(event);
+
+        // When we gain focus, make sure the focused element is visible
+        if (viewport && ensureFocusedElementIsVisible)
+        {
+            var elt:IVisualElement = focusManager.getFocus() as IVisualElement;
+            lastFocusedElement = elt;
+
+            if (elt)
+                scrollElementIntoView(elt);
+        }
+
+    }
+
+    /**
+     *  @private
+     *  Scrolls the viewport so the element is visible in the viewable area
+     */
+    private function scrollElementIntoView(element:IVisualElement):void
+    {
+        var layout:LayoutBase = null;
+
+        if (viewport is GroupBase)
+            layout = GroupBase(viewport).layout;
+        else if (viewport is SkinnableContainer)
+            layout = SkinnableContainer(viewport).layout;
+
+        if (layout)
+        {
+            // Scroll the element into view
+            var delta:Point = layout.getScrollPositionDeltaToAnyElement(element);
+
+            if (delta)
+            {
+                var eltBounds:Rectangle = layout.getChildElementBounds(element);
+                var focusThickness:Number = 0;
+
+                viewport.horizontalScrollPosition += delta.x;
+                viewport.verticalScrollPosition += delta.y;
+
+                if (element is IStyleClient)
+                    focusThickness = IStyleClient(element).getStyle("focusThickness");
+
+                // Make sure that the focus ring is visible. Top and left sides have priority
+                if (focusThickness)
+                {
+                    if (viewport.verticalScrollPosition > eltBounds.top - focusThickness)
+                        viewport.verticalScrollPosition = eltBounds.top - focusThickness;
+                    else if (viewport.verticalScrollPosition + height < eltBounds.bottom + focusThickness)
+                        viewport.verticalScrollPosition = eltBounds.bottom + focusThickness - height;
+
+                    if (viewport.horizontalScrollPosition > eltBounds.left - focusThickness)
+                        viewport.horizontalScrollPosition = eltBounds.left - focusThickness;
+                    else if (viewport.horizontalScrollPosition + width < eltBounds.right + focusThickness)
+                        viewport.horizontalScrollPosition = eltBounds.right + focusThickness - width;
+                }
+
+                if (viewport is UIComponent)
+                    UIComponent(viewport).validateNow();
+            }
         }
     }

@@ -2221,7 +2326,7 @@

 				if (newHSP < minTextSelectionHScrollPos)
 					newHSP = minTextSelectionHScrollPos;
-			}
+    		}
 		}

 		if (scrollerLayout.canScrollVertically)
@@ -2254,6 +2359,95 @@
 		if (newVSP != viewport.verticalScrollPosition)
 			viewport.verticalScrollPosition = newVSP;
 	}
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers: SoftKeyboard Interaction
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function addedToStageHandler(event:Event):void
+    {
+        var topLevelApp:Application = FlexGlobals.topLevelApplication as Application;
+
+        // Only listen for softKeyboardEvents if the
+        // softKeyboardBehavior attribute in the application descriptor equals "none"
+        // Check that the top level app has resizeForSoftKeyboard == true
+        if (topLevelApp && topLevelApp.resizeForSoftKeyboard && Application.softKeyboardBehavior == "none")
+        {
+            systemManager.stage.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE,
+                softKeyboardActivateHandler, false,
+                EventPriority.DEFAULT, true);
+            systemManager.stage.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE,
+                softKeyboardDeactivateHandler, false,
+                EventPriority.DEFAULT, true);
+
+            softKeyboardEventHandlersAdded = true;
+        }
+    }
+
+    /**
+     *  @private
+     */
+    private function removedFromStageHandler(event:Event):void
+    {
+        if (softKeyboardEventHandlersAdded)
+        {
+            systemManager.stage.removeEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE,
+                softKeyboardActivateHandler, false);
+            systemManager.stage.removeEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE,
+                softKeyboardDeactivateHandler, false);
+
+            softKeyboardEventHandlersAdded = false;
+        }
+    }
+
+    /**
+     *  @private
+     *  Called when the soft keyboard is activated. Tells the top level
+     *  application to resize itself
+     */
+    private function softKeyboardActivateHandler(event:SoftKeyboardEvent):void
+    {
+        // Size of app has changed, so run this logic again
+        if (lastFocusedElement)
+            scrollElementIntoView(lastFocusedElement);
+    }
+
+    /**
+     *  @private
+     *  Called when the soft keyboard is deactivated. Tells the top level
+     *  application to resize itself and fix the scroll position if necessary
+     */
+    private function softKeyboardDeactivateHandler(event:SoftKeyboardEvent):void
+    {
+        // Adjust the scroll position after the application's size is restored.
+        adjustScrollPositionAfterSoftKeyboardDeactivate();
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal function adjustScrollPositionAfterSoftKeyboardDeactivate():void
+    {
+        // If contentHeight is shorter than height, we no longer can scroll and we should reset to 0
+        // If contentHeight is taller than height, make sure the position doesn't
+        // exceed the max scroll position
+
+        if (viewport.contentHeight <= height)
+            viewport.verticalScrollPosition = 0;
+        else
+            viewport.verticalScrollPosition = Math.min(viewport.verticalScrollPosition, viewport.contentHeight - height);
+
+        if (viewport.contentWidth <= width)
+            viewport.horizontalScrollPosition = 0;
+        else
+            viewport.horizontalScrollPosition = Math.min(viewport.horizontalScrollPosition, viewport.contentWidth - width);
+    }
+

 }


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/framework/src/mx/events/StateChangeEvent.as
+++ frameworks/projects/framework/src/mx/events/StateChangeEvent.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2005-2006 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.
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////


Transferred from the Adobe Open Source Subversion Repository

Revision: 2571
Author:   dsubrama@adobe.com
Date:     2008-07-22T23:20:37.510552Z

Log Message:
-----------
FXG Fixes

MXMLG-189: Needed to add filters to the FXG, Gumbo and 2009 manifests

MXMLG-202: LinearGradient tx, ty were not accurate. Needed to be relative to the Rectangle being drawn into.

Reviewer: Jason

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/fxg-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/LinearGradient.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/gumbo-manifest.xml</path>

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

--- frameworks/projects/framework/src/mx/graphics/LinearGradient.as
+++ frameworks/projects/framework/src/mx/graphics/LinearGradient.as
@@ -134,17 +134,17 @@
 	public function begin(target:Graphics, rc:Rectangle):void
 	{
 		var w:Number = !isNaN(scaleX) ? scaleX : rc.width;
-		var tx:Number = !isNaN(x) ? x : 0;
-		var ty:Number = !isNaN(y) ? y : 0;
-
+		var tx:Number = !isNaN(x) ? x + rc.left : rc.left;
+		var ty:Number = !isNaN(y) ? y + rc.top : rc.top;
+
 		matrix.createGradientBox(w, rc.height,
 								!isNaN(mx_internal::_angle) ?
 									mx_internal::_angle : mx_internal::rotationInRadians,
 								 tx, ty);
-
+
 		target.beginGradientFill(GradientType.LINEAR, mx_internal::colors,
 								 mx_internal::alphas, mx_internal::ratios,
-								 matrix, spreadMethod, interpolationMethod);
+								 matrix, spreadMethod, interpolationMethod);
 	}

 	/**


Transferred from the Adobe Open Source Subversion Repository

Revision: 4646
Author:   pfarland@adobe.com
Date:     2009-01-23T18:45:23.310008Z

Log Message:
-----------
As part of the Advanced CSS work, adding support for pseudo-selectors that match component states. There are two scenarios for matching states.

1. For skinnable Spark subclasses of FxComponents, such as FxButton. The pseudo-selector will be matched against the current skin state.

2. For other UIComponents, the pseudo-selector is matched against the currentState. Note that since states are declared at the document level, pseudo-selectors are written to match the component representing the document only (rather than an arbitrary child component of that document). Note that as with styles in general, it is not advised to make changes to inheriting styles at the Application root as this impacts all child components in the display list.

Note that further optimization will be investigated to limit the number of components that are redrawn where a change in state is accompanied by a matching pseudo-selector.

QE: Yes
Doc: Yes, see the Advanced CSS specification for Gumbo.
Checkintests: Pass
Reviewer: Glenn

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSSelector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/IAdvancedStyleClient.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSCondition.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSStyleDeclaration.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/IStyleManager3.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>

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

--- frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as
+++ frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as
@@ -275,11 +275,10 @@

     /**
      *  @private
-     *  A map of CSS subjects that have pseudo selectors. If a subject does
-     *  have a pseudo selector, a state change requires styles to be
-     *  recalculated.
+     *  A map of CSS pseudo states. If a pseudo selector exists for a
+     *  particular state name, it is likely that styles need to be recalculated.
      */
-    private var _pseudoSubjects:Object;
+    private var _pseudoStates:Object;

     /**
      *  @private
@@ -485,11 +484,11 @@
     /**
      * @private
      * Determines whether at least one pseudo-selector has been specified for
-     * the given subject.
+     * the given state.
      */
-    public function hasPseudoSelector(subject:String):Boolean
-    {
-        return _pseudoSubjects != null && _pseudoSubjects[subject] != null;
+    public function hasPseudoSelector(state:String):Boolean
+    {
+        return _pseudoStates != null && _pseudoStates[state] != null;
     }

     /**
@@ -529,12 +528,13 @@

         // Also remember subjects that have pseudo-selectors to optimize
         // styles during component state changes.
-        if (styleDeclaration.isPseudoSelector())
+        var pseudoSelector:String = styleDeclaration.getPseudoSelector();
+        if (pseudoSelector != null)
         {
-            if (_pseudoSubjects == null)
-                _pseudoSubjects = {};
-
-            _pseudoSubjects[subject] = true;
+            if (_pseudoStates == null)
+                _pseudoStates = {};
+
+            _pseudoStates[pseudoSelector] = true;
         }

         // Record whether this is an advanced selector


Transferred from the Adobe Open Source Subversion Repository

Revision: 12912
Author:   pfarland@adobe.com
Date:     2009-12-14T20:08:35.669487Z

Log Message:
-----------
With TLF 571 checked in we can now revert the MXML 2009 changes for how the id language attribute is processed.

An unqualified id property will no longer be seen as a setter for a normal public, writable, non-static "id" property - which matches Flex 3 behavior.

As in earlier versions of Flex, the mechanism to retain MXML id attribute information at runtime is to implement mx.core.IMXMLObject. The compiler will generate a call to the intialized() method and pass in the id information.

Note: One exception to this rule seems to be UIComponent which instead get id attribute information via mx.core.IDeferredInstantiationUIComponent (although there seems to be a TODO in the codebase to remove this mechanism and thus should not be relied on by third parties).

QE notes: Please add tests for the TLF id property on flow elements (div, span, p, etc).
Doc notes: Please check that we have not documented
Bugs: N/A
Reviewer: Paul
Tests run: Checkintests, local test cases.
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/core/SpriteVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/TypeTable.java</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IID.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/ComponentBuilder.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/StandardDefs.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/Type.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/FrameworkClasses.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/init/ValueInitializer.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>

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

--- frameworks/projects/spark/src/spark/core/SpriteVisualElement.as
+++ frameworks/projects/spark/src/spark/core/SpriteVisualElement.as
@@ -29,8 +29,8 @@
 import mx.core.FlexSprite;
 import mx.core.IFlexModule;
 import mx.core.IFlexModuleFactory;
-import mx.core.IID;
 import mx.core.IInvalidating;
+import mx.core.IMXMLObject;
 import mx.core.IUIComponent;
 import mx.core.IVisualElement;
 import mx.core.mx_internal;
@@ -58,7 +58,7 @@
  *  @productversion Flex 4
  */
 public class SpriteVisualElement extends FlexSprite
-    implements IVisualElement, IID, IFlexModule
+    implements IVisualElement, IMXMLObject, IFlexModule
 {
     /**
      *  Constructor.
@@ -1810,6 +1810,25 @@
     //  Methods
     //
     //--------------------------------------------------------------------------
+
+	/**
+	 *  Called automatically by the MXML compiler when the SpriteVisualElement
+	 *  is created using an MXML tag.
+	 *  If you create the SpriteVisualElement through ActionScript you
+	 *  must set the id property manually.
+	 *
+	 *  @param document The MXML document containing this SpriteVisualElement (not used).
+	 *  @param id The MXML id for this SpriteVisualElement.
+	 *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+	 */
+	public function initialized(document:Object, id:String):void
+	{
+		this.id = id;
+	}

     /**
      * @private


Transferred from the Adobe Open Source Subversion Repository

Revision: 19816
Author:   rfrishbe@adobe.com
Date:     2011-01-20T00:06:35.709500Z

Log Message:
-----------
Cleaning up how virtualization works.  Getting rid of an extra validateNow() and a setLayoutBoundsSize(0,0) call.  Now when grabbing a virtual item renderer, we just "bring it up to speed" in that we are in the middle of an updateDisplayList() pass, so we force it to validateProperties() and validateSize().  It'll just validateDisplayList() naturally as part of the natural LayoutManager pass that it's already in the middle of.

The main performance boost comes from removing the setLayoutBoundsSize(0,0) call, which was already made in the justify layout case, so we shouldn't see a huge difference in Mobile performance; however, we should see a performance boost for scrolling virtual lists in general because of this.

QE notes: -
Doc notes:
Bugs: SDK-29057
Reviewer: Evtim, Hans
Tests run: checkintests, full mustella cyclone (tho I did make one minor change afterwards in DataGroup)
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/TileLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
+++ frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
@@ -1993,6 +1993,7 @@
         // current contentHeight; cache computed widths/heights in llv.
         for (; (x < maxVisibleX) && (index < eltCount); index++)
         {
+            // TODO (hmuller): should pass in eltWidth, eltHeight
             var elt:ILayoutElement = layoutTarget.getVirtualElementAt(index);
             var w:Number = fixedColumnWidth; // NaN for variable width columns
             var h:Number = calculateElementHeight(elt, targetHeight, containerHeight); // can be NaN
@@ -2016,7 +2017,7 @@
             {
                 for (index = startIndex; index <= endIndex; index++)
                 {
-                    elt = layoutTarget.getVirtualElementAt(index);
+                    elt = layoutTarget.getElementAt(index);
                     h = calculateElementHeight(elt, targetHeight, containerHeight); // can be NaN
                     elt.setLayoutBoundsSize(elt.getLayoutBoundsWidth(), h);
                     h = elt.getLayoutBoundsHeight();
@@ -2046,7 +2047,7 @@
             {
                 for (index = startIndex; index <= endIndex; index++)
                 {
-                    elt = layoutTarget.getVirtualElementAt(index, NaN, NaN);
+                    elt = layoutTarget.getElementAt(index);
                     elt.setLayoutBoundsPosition(dx + elt.getLayoutBoundsX(), elt.getLayoutBoundsY());
                 }
                 contentWidth += dx;