Search code examples
actionscript-3airflash-cs5

Adobe AIR, how to open a scene in a new window


I'm developing a networked AIR application in Flash Professional. I need to open two instances of the application and after searching I found that launching the app multiple times just causes an invoke event to be sent to the currently running app.

Up until now I've been using NetConnection & NetGroup (Supported by Flash Player 10.1+), now that I'm using ServerSocket & Socket, it requires the AIR 2+ runtime.

I found a solution to open a window on invoke.

my solution would be to launch a new window on invoke

function openWindow():void
{
newWin = new NativeWindow(init); //Initialize the Native Window
newWin.activate();
newWin.height = 200;
newWin.width = 300;
newWin.title = "My First New Win!";
}

and have it

gotoAndPlay(1, "Scene 1");

Is there a way to execute that on the new window? Or is there a way to open two instances of an AIR app?

Edit You can open two instances of the same air app by changing it's ID. However, this is a very involved process every time I want to debug!


Solution

  • Turns out AIR on Android doesn't support ServerSockets. This means I must use non-AIR flash methods to achieve communication.

    I can then achieve network testing through multiple Flash Player instances.

    I don't believe ADL has the ability to run more than instance at a time.