 import com.tuarua.webview.WebViewEvent;
 
 import flash.desktop.NativeApplication;
+import flash.display.NativeWindow;
+import flash.display.NativeWindowDisplayState;
 import flash.display.StageDisplayState;
 import flash.events.Event;
 import flash.events.FullScreenEvent;
+import flash.events.NativeWindowBoundsEvent;
+import flash.events.NativeWindowDisplayStateEvent;
 import flash.filesystem.File;
 import flash.geom.Point;
 import flash.geom.Rectangle;


    /**
     * It's very important to call webView.shutDown(); when the app is exiting. This cleans up CEF on Windows.
     *
     */
    private function onExiting(event:Event):void {
        webView.shutDown();


    }

    private function onWindowMiniMaxi(event:NativeWindowDisplayStateEvent):void {
        /*
         !! Needed for OSX, restores webView when we restore from minimized state
         */
        if (event.beforeDisplayState == NativeWindowDisplayState.MINIMIZED) {
            webView.removeFromStage();
            webView.addToStage();
        }
    }

    private function onEscKey(event:WebViewEvent):void {
        if (WebViewANESample.target.stage.displayState == StageDisplayState.FULL_SCREEN_INTERACTIVE) {
            WebViewANESample.target.stage.displayState = StageDisplayState.NORMAL;
