                                             button_mouseDownHandler);
             maximizeButton.removeEventListener(MouseEvent.CLICK,
                                             maximizeButton_clickHandler);
+            DisplayObject(window).removeEventListener(
+                NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGE,
+                window_displayStateChangeHandler);
         }
         
     }

import flash.display.NativeWindowDisplayState;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.system.Capabilities;

import mx.core.IWindow;

        // work around for bugs SDK-9547 & SDK-21190
        maximizeButton.dispatchEvent(new MouseEvent(MouseEvent.ROLL_OUT));

    }
    
    /**
