     //
     //--------------------------------------------------------------------------
     
+    /**
+     *  A reference to the ActiveWindowManager is necessary for detecting when a
+     *  popup is displayed. If that popup obscures any StyleableStageText, the
+     *  StageText within needs to be hidden so it doesn't draw on top of the
+     *  popup.
+     */
+    private static var awm:ActiveWindowManager;
+    
     private static var supportedStyles:String = "textAlign fontFamily fontWeight fontStyle fontSize color locale";
     
     /**

                textImage.scaleY = 1.0 / densityScale;
                addChild(textImage);
                
                // Don't just invalidate the viewport. Update it now so the
                // StageText doesn't lag the animation.
                updateViewPort();
            }
        }
    }

            updateViewPort();
        
        registerStageTextListeners();
        
        invalidateAncestorsVisibleFlag = true;
        invalidateEffectiveEnabledFlag = true;
        invalidateProperties();
    }
    
    private function removedFromStageHandler(event:Event):void
    {
        if (awm)
        {
            awm.removeEventListener("activatedForm", awm_activatedFormHandler);
            awm.removeEventListener("deactivatedForm", awm_deactivatedFormHandler);
        }
        
        if (stageText == null)
            return;
        
