Like many developers, I have a dual monitor setup. I also have certain monitors that over time have become the "Home Display" for certain programs. I almost always write code on the left-hand display (my OS primary). Firefox and applications I am developing are virtually always on the right-hand display.
So I've been developing a full screen AIR app lately and have been irritated that the AIR application always wants to open on my primary display, thus covering my IDE and also covering any debug controls in Flex Builder. For awhile I moved Flex Builder over to the right-hand screen, but that just felt wrong, so today I figured out how to programmatically move the AIR app to the secondary display.
Turns out it just took one line of code (line 10 below), setting the stage's x coordinates to the righthand boundary of my primary display (which is also the left-boundary of my right-hand display). Now this might be old hat for Flash developers, but not for me. I thought I'd post a little mini-app example of making this work.
Note that your milage with this example may vary if you:
- Only have one display (it will move the AIR app out of your visible area)
- Your displays are setup to be above each other rather than beside each other (same result as 1)
- Your primary OS display is on the right (same again)
Okay, so I thought better of my solution. This code does the same thing, but just moves the AIR app to the rightmost display. If there is only one display it will just stay there.