You can get the screen bounds via window.runtime.flash.display.Screen.mainScreen.visibleBounds.
here's some additional code etc.
//default bounds of nativeWindow
var applicationBounds = window.nativeWindow.bounds;
//determine which screen we're located on
var screens = air.Screen.getScreensForRectangle(window.nativeWindow.bounds);
var screenBounds = (screens.length > 0) ? screens.visibleBounds : air.Screen.mainScreen.visibleBounds;
//get initial position
x = (screenBounds.width - applicationBounds.width) / 2;
y = (screenBounds.height - applicationBounds.height) / 2;
//adjust for offset x or offset y (multi monitors)
x = screenBounds.x + x;
y = screenBounds.y + y;
window.nativeWindow.x = x;
window.nativeWindow.y = y;
It works for me. I put those line of codes and load it using "onload" event in <body>.
although it works, but i'm finding another method to call the function.
Is there any other way?
Thank you for the codes, it helps me a lot.