                 newAncestor.addEventListener(ResizeEvent.RESIZE, ancestor_resizeHandler, false, 0, true);
                 newAncestor.addEventListener(FlexEvent.SHOW, ancestor_showHandler, false, 0, true);
                 newAncestor.addEventListener(FlexEvent.HIDE, ancestor_hideHandler, false, 0, true);
+                
+                if (newAncestor.isPopUp)
+                {
+                    newAncestor.addEventListener(PopUpEvent.CLOSE, ancestor_closeHandler, false, 0, true);
+                    newAncestor.addEventListener(PopUpEvent.OPEN, ancestor_openHandler, false, 0, true);
+                }
             }
         }
         

            stageText.displayAsPassword = _displayAsPassword;
            stageText.maxChars = _maxChars;
            
            // Workaround for runtime bug 2931896: Don't set restrict to null
            // even though that technically shouldn't do anything. Setting
            // restrict to null disables typing.
            if (_restrict != null)
                stageText.restrict = _restrict;
            
            // Soft keyboard hints
            stageText.autoCapitalize = _autoCapitalize;

    {
        // Any change in ancestor geometry may affect the StageText's geometry.
        invalidateViewPortFlag = true;
        invalidateProperties();
    }
    
    private function ancestor_openHandler(event:PopUpEvent):void
    {
        ancestorsVisibleInvalidateFlag = true;
        invalidateViewPortFlag = true;
        
        invalidateProperties();
    }
    
