 import mx.managers.PopUpManager;
 import mx.styles.ISimpleStyleClient;
 import mx.utils.MatrixUtil;
+import mx.utils.PopUpUtil;
 
 use namespace mx_internal;
 

        }
        
        var popUpPoint:Point = calculatePopUpPosition();
        
        // the transformation doesn't take the fullScreenRect in to account
        // if we are in fulLScreen mode. This code will throw a RTE if run from inside of a sandbox. 
        try
        {
            var smStage:Stage = systemManager.stage;
            if (smStage && smStage.displayState != StageDisplayState.NORMAL && smStage.fullScreenSourceRect)
            {
                popUpPoint.x += smStage.fullScreenSourceRect.x;
                popUpPoint.y += smStage.fullScreenSourceRect.y;
            }
        }
        catch (e:Error)
        {
            // Ignore the RTE
        }
        
        if (!m)
            return;
        
        // Position the popUp. 
        m.tx = Math.round(popUpPoint.x);
        m.ty = Math.round(popUpPoint.y);
        if (popUp is UIComponent)
            UIComponent(popUp).setLayoutMatrix(m,false);
        else if (popUp is DisplayObject)
            DisplayObject(popUp).transform.matrix = m;
        
        // apply the color transformation, but restore alpha value of popup
        var oldAlpha:Number = DisplayObject(popUp).alpha;
        var tmpColorTransform:ColorTransform = $transform.concatenatedColorTransform;
        if (tmpColorTransform != null)
        {
            tmpColorTransform.alphaMultiplier = oldAlpha;
            tmpColorTransform.alphaOffset = 0;
        }
        DisplayObject(popUp).transform.colorTransform = tmpColorTransform;
    }
    
    //--------------------------------------------------------------------------

{
    
import flash.display.DisplayObject;
import flash.events.Event;
import flash.geom.Matrix;
import flash.geom.Point;
import flash.geom.Rectangle;
