             
             // 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);            
+            updateProxyImageForTopmostForm();
         }
         
         updateProxyImage();


import mx.core.DPIClassification;
import mx.core.FlexGlobals;
import mx.core.IUIComponent;
import mx.core.LayoutDirection;
import mx.core.UIComponent;

    
    private function awm_activatedFormHandler(event:DynamicEvent):void
    {
        updateProxyImageForTopmostForm();
    }
    
    private function awm_deactivatedFormHandler(event:DynamicEvent):void
    {
        // When the ActiveWindowManager dispatches the deactivatedForm event,
        // its internal list of forms has not been updated yet. So, determining
        // the topmost form from that list will fail and find the old topmost
        // form (the one that is going away). Always assume that the form passed
        // as the event property will be the new topmost form.
        var form:Object = event.hasOwnProperty("form") ? event.form : null;
        updateProxyImageForForm(form);
    }
    
