Flash On

Flex 3: Messages between multiple browsers and AIR

17-08-2009

copy

Sending messages from the browser and AIR using the Flex localConnection class is fairly well documented. I recently needed to extend this to support multiple instances of the same browser flex application talking to a single AIR app. (Cheers to Dave for this trick!)

To do this I assigned each browser instance a random ID, which is sent across in the arguments of a standard AIR launch call…

_air.launchApplication(appID, pubID, currentlyConnectedSwf);

or on install of the application

_air.installApplication(appURL, runtimeVersion, currentlyConnectedSwf);

Over in the AIR application I then return the message from the AIR app targeting the specific browser instance using the ID collected by the browserInvoke method….

outGoingConn.send(”www.imbimp.com” + “:” + currentlyConnectedSwf, “localConnectionHandler”, ‘AIR to SWF’);

Written By Tim for the Web Technology section Tags: , , ,

Comments/Trackbacks

  1. No comments yet.
  1. No trackbacks yet.

Name (required)

E-Mail (required)

Website