 import mx.core.IInvalidating;
 import mx.core.IToolTip;
 import mx.core.IUIComponent;
+import mx.core.LayoutDirection;
 import mx.core.mx_internal;
 import mx.effects.IAbstractEffect;
 import mx.effects.EffectManager;

    /**
     *  @private
     */
    private function getGlobalBounds(obj:DisplayObject, parent:DisplayObject):Rectangle
    {
        var upperLeft:Point = new Point(0, 0);
        upperLeft = obj.localToGlobal(upperLeft);
        upperLeft = parent.globalToLocal(upperLeft);
        return new Rectangle(upperLeft.x, upperLeft.y, obj.width, obj.height);
    }


                    currentToolTip["text"] = currentToolTip["text"];
                }
            }
            
            // Since the border style of the error tip may have changed,
            // we have to force a remeasurement and change its size.
            // This is because objects in the toolTips layer
            // don't undergo normal measurement and layout.
            sizeTip(currentToolTip)
            
            // If we changed the tooltip max size, we change it back.
            // Otherwise, if RTL, and x wasn't set for maxWidth, reposition 
            // because the width may have changed during the remeasure.
            if (!isNaN(oldWidth))
                Object(toolTipClass).maxWidth = oldWidth;
            else if (mirror)
                x = targetGlobalBounds.right + 2 - currentToolTip.width;
        }
        else
        {
            var sm:ISystemManager = getSystemManager(currentTarget);
            // Position the upper-left (upper-right) of the tooltip
            // at the lower-right (lower-left) of the arrow cursor.
            x = DisplayObject(sm).mouseX + 11; 
            if (mirror)
                x -= currentToolTip.width;
            y = DisplayObject(sm).mouseY + 22;
            
            // If the tooltip is too wide to fit onstage, move it left (right).
            var toolTipWidth:Number = currentToolTip.width;
            if (mirror)
            {
                if (x < 2)
                    x = 2;
            }
            else if (x + toolTipWidth > screenWidth)
            {
                x = screenWidth - toolTipWidth;
            }
            
            // If the tooltip is too tall to fit onstage, move it up.
            var toolTipHeight:Number = currentToolTip.height;
            if (y + toolTipHeight > screenHeight)
                y = screenHeight - toolTipHeight;
            
            var pos:Point = new Point(x, y);
            pos = DisplayObject(sm).localToGlobal(pos);
            pos = DisplayObject(sm.getSandboxRoot()).globalToLocal(pos);
            x = pos.x;
            y = pos.y;
        }
     
        currentToolTip.move(x, y);
    }

