SlidesHere is my presentation from Stage3D online conference
Quick Note about my speechIt consists from 4 parts:
- quick review of LeapMotion device - not technical
- work with Raw data from WebSocket
- work with LeapMotionAS3 API
- Drag-n-Drop demos
IntroI started my speech with quick overview of LeapMotion capabilities. It's very similar to my post All About LeapMotion.
Raw data from SocketIt's never been so easy to track data from any device. Just plug to WebSocket and get raw data.
Because Adobe Flash doesn't have WebSockets we need to emulate it.
WebSocket fix recipe:
- Connect to Socket 'localhost:6437'
- Send WebSocket handshake
- Get WebSocket handshake
- Track data from socket
Here is example
Socket policy files / Cross domainThe big difference between Sockets in Flash and JS is that Flash Sockets require special CrossDomain.xml file on server side. Without it you will get an error:
onSecurityErrorHandler Error #2048: Security sandbox violation:Victor Norgren informed LeapMotion team about this issue but still haven't received any response. Maybe them will fix it in upcoming driver versions. But we don't have any confidence.
Fix itBut we can fix it.
Cross domain fix recipe:
- Don't use Flash for Socket communication
- Connect to Socket in JS
- Handle onmesssage
- Use ExternalInterface.addCallback to pass data from js to flash
PSIn upcoming part I'll show you how to use LeapMotionAs3 library from Victor Norgren and Wouter Verweirder to create 3D Controller for drag'n'drop 3D object.
PPSI plan to do more presentations on LeapMotion interaction so If you have any questions about it or you're interested in some topics - just write down here in the comments section and I'll try to address them in the upcoming speeches.
Thanks, See you guys!