     {
         if (!nativeWindow.closed)
             stage.nativeWindow.minimize();
-        removeEventListener("effectEnd", windowMinimizeHandler);
+        removeEventListener(EffectEvent.EFFECT_END, windowMinimizeHandler);
     }
 
     /**

        // After here, afterState is normal
        else if (event.beforeDisplayState == NativeWindowDisplayState.MINIMIZED)
        {
            addEventListener("effectEnd", windowUnminimizeHandler);
            dispatchEvent(new Event("windowUnminimize"));
        }
    }

     */
    private function windowMaximizeHandler(event:Event):void
    {
        removeEventListener(EffectEvent.EFFECT_END, windowMaximizeHandler);
        if (!nativeWindow.closed)
            stage.nativeWindow.maximize();
    }
