                 }
 
                 if (constraintsHolder["left"] !== undefined)
-                    constraintsHolder["left"] = Math.round(location.x);
+                    constraintsHolder["left"] = Math.round(targetX);
                 if (constraintsHolder["top"] !== undefined)
-                    constraintsHolder["top"] = Math.round(location.y);
+                    constraintsHolder["top"] = Math.round(targetY);
 
                 // Only bother adjusting 'right' if our target is
                 // parented to an object with a positive width
                 if (parentW > 0 && constraintsHolder["right"] !== undefined)
-                    constraintsHolder["right"] = parentW - location.x - size.x;
+                    constraintsHolder["right"] = parentW - targetX - targetW;
 
                 // Only bother adjusting 'bottom' if our target is
                 // parented to an object with a positive height
                 if (parentH > 0 && constraintsHolder["bottom"] !== undefined)
-                    constraintsHolder["bottom"] = parentH - location.y - size.y;
+                    constraintsHolder["bottom"] = parentH - targetY - targetH;
 
                 // Only bother adjusting 'horizontalCenter' if our target is
                 // parented to an object with a positive width
                 if (parentW > 0 && constraintsHolder["horizontalCenter"] !== undefined)
                 {
                     // Layout uses horizontalCenter to calculate position this way
-                    // location.x = parentW / 2 - size.x / 2 + horizontalCenter
-                    constraintsHolder["horizontalCenter"] = location.x + size.x / 2 - parentW / 2;
+                    // targetX = parentW / 2 - targetW / 2 + horizontalCenter
+                    constraintsHolder["horizontalCenter"] = targetX + targetW / 2 - parentW / 2;
                 }
 
                 // Only bother adjusting 'verticalCenter' if our target is

        {
            if (adjustConstraints)
            {
                var layoutItem:ILayoutItem = LayoutItemFactory.getLayoutItemFor(target);
                var location:Point = layoutItem.actualPosition;
                var size:Point = layoutItem.actualSize;
                var parentW:int = 0;
                var parentH:int = 0;
                
                // For 'bottom' or 'verticalCenter' we need the parent height
                if (constraintsHolder["bottom"] !== undefined ||

import mx.effects.interpolation.IEaser;
import mx.effects.interpolation.IInterpolator;
import mx.events.AnimationEvent;
import mx.layout.ILayoutElement;
import mx.layout.LayoutElementFactory;
import mx.managers.LayoutManager;
import mx.styles.IStyleClient;
import mx.core.IVisualElementContainer;
