Eric
Eric

Reputation: 10626

Call nodeJS javascript file from Adobe AIR possible?

I have a project (adobe AIR 3.1 - NOT flex) that is running on my webserver where nodeJS is installed. I'm looking at the possibility to call NodeJS javascript files from the AIR app. Like the AIR app collects some information and calls socket.io in NodeJS to dispatch the info to html connected clients. Is it possible ?

Upvotes: 0

Views: 2079

Answers (1)

badunk
badunk

Reputation: 4350

This is certainly possible in the underlying protocols that socket io uses. I think there are a couple ways you can go about doing this:

  1. Use ExternalInterface and actually utilize the socket.io client library (http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html)
  2. Send information to the node.js application in the same way that socket.io would use for Adobe Flash Socket, long polling, or even jsonp polling (http://socket.io/#browser-support)
  3. Write a shim and initiate a stream with it through native process (http://www.adobe.com/devnet/air/flex/quickstart/articles/interacting_with_native_process.html). You can even start the node.js application this way.

Overall, while its technically possible, I believe Adobe AIR isn't often used on the server side. Is there data from there that you can't get from only using node.js?

Just to clarify, socket.io is nice, but it is only fully utilized if you need bi directional communication. If you are only sending data from the AIR app to the node.js application, you have many options (ie, sending the data through an http service like REST/SOAP, etc..)

Upvotes: 1

Related Questions