      */
     private function windowUnmaximizeHandler(event:Event):void
     {
-        removeEventListener("effectEnd", windowUnmaximizeHandler);
+        removeEventListener(EffectEvent.EFFECT_END, windowUnmaximizeHandler);
         if (!nativeWindow.closed)
             stage.nativeWindow.restore();
     }

        else if (getStyle("closeEffect") &&
                 stage.nativeWindow.transparent == true)
        {
            addEventListener("effectEnd", window_closeEffectEndHandler);
            dispatchEvent(new Event("windowClose"));
            event.preventDefault();
        }

import mx.core.mx_internal;
import mx.core.UIComponent;
import mx.events.AIREvent;
import mx.events.EffectEvent;
import mx.events.FlexEvent;
import mx.events.FlexNativeWindowBoundsEvent;
import mx.events.WindowExistenceEvent;
