                 // The effect may have played while a popup is open. If so, we
                 // need to make sure the proxy image stays.
                 if (awm)
-                    updateProxyImageForForm(awm.form);
+                    updateProxyImageForTopmostForm();
                 else
                     disposeProxyImage();
             }

            
            // If this is a new StageText created while a popup is already open,
            // a proxy image needs to be created for it.
            if (awm)
                updateProxyImageForForm(awm.form);            
        }
        
        updateProxyImage();

    }
    
    /**
     *  Iterate through the forms tracked by ActiveWindowManager and return the
     *  one that is highest in z-order.
     */
    private function findTopmostForm():Object
    {
        if (!awm)
            return null;
        
        var form:Object = awm.form;
        var formIndex:int = getFormIndex(form);
        
        for each (var otherForm:Object in awm.forms)
        {
            var otherIndex:int = getFormIndex(otherForm);
            
            if (otherIndex > formIndex)
            {
                form = otherForm;
                formIndex = otherIndex;
            }
        }
        
        return form;
    }
    
    /**
     *  Determine an index for the given form that may be used to determine the
     *  relative z-orders of forms.
     */
    private function getFormIndex(form:Object):int
    {
        return form is DisplayObject ?
            systemManager.rawChildren.getChildIndex(form as DisplayObject) :
            -1;
    }
    
    /**
     *  Determine whether the given form is an application. This is the same
     *  check as is used by ActiveWindowManager.
     */
    private function isFormApplication(form:DisplayObject):Boolean
    {
        return systemManager.document is IRawChildrenContainer ? 
            IRawChildrenContainer(systemManager.document).rawChildren.contains(form) :
            systemManager.document.contains(form);
    }
    
    /**
     *  Replace the existing proxy image representing this StageText with a new
     *  one. Call this whenever the StageText's properties, contents, or
     *  geometry changes. This does nothing if there is no proxy image, so it is
