I wrote an application that emulates touch screens using microsoft Kinect and P5.
The app would count the number of points inside a cube. If that number is bigger than a certain threshold, a signal is send to the main Macromedia Flash application.
The second app is a "watchdog" application written in cocoa/objective-c that ensured that the system was running in sync