1 Reply Latest reply on Apr 23, 2009 2:12 AM by Starlover_jacob

    application position on screen

    Starlover_jacob Level 1
      hi there,
      i have an application(air) i want to load in the center of my desktop.
      the application has a fixed size.
      If i start my application it is not loaded in the center of my screen, the bottom of my application runs out of the screen.

      so my question; How to calculate the desktop sizes and set the application on a specific point?
      for example top right or bottom left.

      Greetz, jacob
        • 1. Re: application position on screen
          Starlover_jacob Level 1

          Hi,  i found a solution.


          Sinse i use a custom chrome i could not use:




          this.nativeWindow.x=(Capabilities.screenResolutionX - this.width)/2;

          this.nativeWindow.y=(Capabilities.screenResolutionY - this.height)/2;

          (This will work when u use <mx:WindowedApplication> instead of <mx:Application>)


          That shifted the container on the stage, not the position of the window on the screen.


          I was almost going to use the window's initial x and y position with a value of 0 in the centerapp-app.xml

          between the <initialWindow> tags, so my application is at least fully shown on my 1280x800 screen.



          The solution i used:

          stage.nativeWindow.x=(Capabilities.screenResolutionX - this.width)/2;


          y is set to 0 because when i use (Capabilities.screenResolutionY - this.height)/2

          the application is running out of my screen at the bottom.

          Perhaps this is a MS Windows thing, cause I've seen checks of the operating system.


          It could be possible that there has to be a check on operating system first, and when its Windows, you need to subtract another 50 pix or so from they position.


          Greets, Jacob.