AIRKinect Extension is a Native Extension for use with Adobe AIR 3.0. AIRKinect allows AIR developers to tap into the rich experience of the Microsoft Kinect and push interactivity to a new level.
Before you can use the native extension in your AIR project, you will need to install the kinect drivers. You have several options, depending on your platform.
You can use the instructions "Install OpenNI,NITE and the Sensor Driver" of the SimpleOpenNI project to get OpenNI up and running on your windows 7 machine: http://code.google.com/p/simple-openni/wiki/Installation#Windows. Make sure you install the 32-bit version. AIRKinect does not work with the 64-bit version.
You can use the instructions "Install OpenNI the short way" of the SimpleOpenNI project to get OpenNI up and running on your OSX machine: http://code.google.com/p/simple-openni/wiki/Installation#OSX.
All you need is the ane file matching your driver. If you are using the MS SDK, you will need airkinect-2-core-mssdk.ane, if you are using OpenNI, you will need airkinect-2-core-openni.ane.
Once you have the correct file, you will need to link it to your AIR project:
AIRKinect has a lot of built-in features. You can check some examples in our examples repository.
A quick example, showing the depth image would be something like this:
private var depthBitmap:Bitmap;
private var device:Kinect;
public function Demo() {
if (Kinect.isSupported()) {
device = Kinect.getDevice();
depthBitmap = new Bitmap();
addChild(depthBitmap);
device.addEventListener(CameraImageEvent.DEPTH_IMAGE_UPDATE, depthImageUpdateHandler);
var settings:KinectSettings = new KinectSettings();
settings.depthEnabled = true;
device.start(settings);
}
}
protected function depthImageUpdateHandler(event:CameraImageEvent):void {
depthBitmap.bitmapData = event.imageData;
}