How to Debug Fullscreen AIR Apps on a Secondary Display

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:

  1. Only have one display (it will move the AIR app out of your visible area)
  2. Your displays are setup to be above each other rather than beside each other (same result as 1)
  3. Your primary OS display is on the right (same again)

If you are looking to do something different with multiple displays, check out the Livedocs page for Enumerating the screens and the ASDoc for the Screen class.

UPDATE (10:20am)

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.

Comments (2)

Nortel NetDirect VPN Problems on Vista - TapAdapter IP not Assigned

Posting this for consumption by Google, so that when this happens to me again I can search Google and find the answer on my own blog. Then I feel silly. Then I am happy I solved my problem.

NetDirect is a Java based VPN client that requires a the installation of a little ActiveX control and then runs in the systray.

The Problem

I have two computers running this virtually identical Vista configurations. One works, one doesn't.

I'm on Vista Ultimate, and had tried getting NetDirect to work in both Firefox. Essentially, I got to the point where a little popup window opens up, I can see the NetDirect icon in the systray, and the client appears to be starting up. Then I get a long pause in feedback and an error. The output I see in the popup is as follows:

Downloading zip file...
Extracting zip file...
Loading library...
NetDirect: Initializing...
[[[ long pause here ]]]
NetDirect: TapAdapter IP not Assigned
NetDirect: Stopping...
NetDirect: Stopped!

At this point the window closes and the systray icon goes away. I tried a number of things including starting the browser "as Administrator" and also had searched Google for answers without any luck.

The Solution

The problem may have been due tot he fact that I already had installed (months earlier) OpenVPN to use a different client's VPN. As I was hunting around the system for the "TapAdapter" mentioned in the error message, I found a start menu option under OpenVPN that said "Delete ALL TAP-Win32 virtual ethernet adapters". Woah - that looked promising!

So I ran the bat file, it deleted some stuff, then I tried starting up the NetDirect connection again. Wham! It worked! Problem solved!

Note: I also started Firefox "As Administrator" when first installing the NetDirect client (it downloads and installs a couple of things). This may or may not have mattered.

Comments (1)