Interfacing Kinect with Flash & AS3

AS3KinectDemo

A very quick guide on how to hook up the Kinect with the AS3Kinect project, you can find all the relevant information on the different wrappers for AS3Kinect at: http://www.as3kinect.org/download/.

The AS3Kinect project works with either OpenKinect and OpenNI and you’ll need a specific version depending on the wrapper that you’re using. Talking of wrappers here’s a couple of things to remember about them:

  • You can’t have more than one running, so you have to pick and install one
  • Each one has different features, the main advantage of OpenNI is that it provides skeletal tracking data

I show how to set up the OpenNI & Primesense drivers here: Getting the Kinect setup on your PC: OpenNI / Primesense

I went the route of OpenNI purely for skeletal tracking for some of the projects I was working on. To get that skeletal data you just as easily could use the Microsoft drivers that they released only after everyone hacked the Kinect and then Microsoft realised they were missing out. BUT while they work a bit better and provide everything, it ties you to Windows 7, which I don’t have and don’t need. I also dislike the idea of being tied to specific software.

So, anyway, follow my set up for OpenNI as that’s what I’ll be using in later tutorials. Now you’ve done that it’s very easy to use the AS3 server, just download it at: http://www.as3kinect.org/distribution/win/openni_win_as3server.zip

Unzip that somewhere and in the XML file you’ll need to add in the license key (Similar to the OpenNI setup steps):




For reference my later projects/ examples will have this info done for you.

The .exe file is your AS3 socket server that pulls the data from the OpenNI drivers for you to use in your Flash projects via the as3kinect actionscript libraries. I tend to keep an instance of the server in the same folder as my Flash project as well as the libraries. You’ll always need to have this running to get Kinect data, incidentally, if you close your Flash projector file (.exe, .swf) you’ll need to restart the server each time.

AS3demofilesIf the AS3 server doesn’t start and if you’re sure the drivers are installed, first check the power! If the Kinect is not plugged into the power supply and you’re just trying to use the USB power, this isn’t going to work.

Anyway, to test this works download the demo AS3 files: http://www.as3kinect.org/distribution/win/openni_demo_pkg.zip

Unzip that, start up your AS3server and then run 3d_test.exe if it’s all working then you should get something like the following screenshot:

AS3KinectDemo

To get the Kinect/ OpenNI drivers to recognise you, you’ll need to perform the pose which I’ll refer to as ‘The Cornholio’ cornholio

Once you’ve done that you should be able to see the program tracking your hand movements.

Now that’s all working have a look at test_3d.as to get an idea of how to pull data using the as3kinect library (in the org folder).

Got it? Good, time to move on and I’ll show some examples of using this data.

2 Comments

  • Excellent tutotial, thanks larry!!!!

    Bless and huges

  • I am trying to run kinect as3 application for past 8 hours. I have managed to implement some simple depth readings but had no luck whit scelet implementation. When I try to run server that supports sleket i ge following error:

    Application can ‘t start because openNI.dll is missing from your computer. Try reinstaling the program to fix this issue. When I start any demo regarding skelet whit out this server i get blanck screen.

You must be logged in to post a comment.