2 Replies Latest reply on May 22, 2008 12:38 AM by pawzlion

    Application starts off-screen in OS X

    pawzlion
      My app starts partly off-screen on OS X and I have to move it to see the whole window. When I quit the application and re-open it, it starts off-screen again, indicating it doesn't save window settings (it should, shouldnt it ? it does on windows). It does this both with the finished application and while testing the application via the ADL command. On windows, it starts off-screen the very first time, but if you move it, it saves the window position and restarts in that position.
        • 1. Re: Application starts off-screen in OS X
          Level 1
          Not sure why Mac is not saving previous windows setting, but as a work-around can you try opening the window in the center of the screen using code?

          You can try the following code in the creationcomplete handler of the window:

          var win:NativeWindow = this.systemManager.stage.nativeWindow;
          var winMaxSize:Point = NativeWindow.systemMaxSize;
          var upperLeft:Point = new Point( (flash.system.Capabilities.screenResolutionX - win.width)/2, (flash.system.Capabilities.screenResolutionY - win.height)/2);
          win.bounds = new Rectangle(upperLeft.x, upperLeft.y, win.width, win.height);
          win.activate();

          -Jeesmon
          • 2. Re: Application starts off-screen in OS X
            pawzlion Level 1
            Jeesmon, thank you for this suggestion. At first I was worried about how to convert your actionscript, since my application is written in html/ajax. Then I came up with this winner of a line that runs in the body's onload:

            self.moveTo(0,0);

            Problem solved ! :")