Sending Touch/Accelerometer Events with AIR 2.0 to the Desktop

Posted on June 7, 2010 | Comments Off

During presentations I have been giving the last month or so I have been showing some AIR 2.0 demos. One demo I show uses a touch enabled device running a mobile AIR 2.0 application to send the MultiTouch and Accelerometer data points to a Desktop application. I use mDNS (Bounjour and Zeroconf) to register the AIR 2.0 desktop application as a service and then the mobile AIR 2.0 application can find the service on the network without the user having to input the ip/port of the service. Then I just send over the MultiTouch and Accelerometer event data to the Desktop application to do cool things with.

This is demo code and not meant for production but you should be able to learn a lot from the code. Also this assumes you have access and can compile out AIR for devices but the demo would work on two desktop/laptops as well.

Here is the source in the form of a Flash Builder project.