 
             // If parent is a UIComponent, check for clipping between
             // the object and its SystemManager
-            if (o.parent is UIComponent)
+            if (popUpParent is UIComponent)
             {
-                rect = UIComponent(o.parent).getVisibleRect();
-                var offset:Point = o.parent.globalToLocal(rect.topLeft);
+                rect = UIComponent(popUpParent).getVisibleRect();
+                var offset:Point = popUpParent.globalToLocal(rect.topLeft);
                 clippingOffset.x += offset.x;
                 clippingOffset.y += offset.y;
                 parentWidth = rect.width;

            }   
            else
            {          
                parentWidth = o.parent.width;
                parentHeight = o.parent.height;
            }

            // The appWidth may smaller than parentWidth if the application is

            IInvalidating(popUp).validateNow();

        const o:PopUpData = findPopupInfoByOwner(popUp);
        
        // If we don't find the pop owner or if the owner's parent is not specified or is not on the
        // stage, then center based on the popUp's current parent.
        var popUpParent:DisplayObject = (o && o.parent && o.parent.stage) ? o.parent : popUp.parent;
        if (popUpParent)
        {
            var systemManager:ISystemManager = o.systemManager;
            var x:Number;
