Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/slikland/LeapMotionAIR
LeapMotion code to be used wir Adobe AIR AS3
https://github.com/slikland/LeapMotionAIR
Last synced: about 2 months ago
JSON representation
LeapMotion code to be used wir Adobe AIR AS3
- Host: GitHub
- URL: https://github.com/slikland/LeapMotionAIR
- Owner: slikland
- License: mit
- Created: 2013-02-08T17:01:24.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-02-08T17:41:40.000Z (almost 12 years ago)
- Last Synced: 2024-08-04T05:06:06.224Z (5 months ago)
- Language: ActionScript
- Size: 190 KB
- Stars: 9
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE.txt
Awesome Lists containing this project
- awesome-actionscript-sorted - LeapMotionAIR - LeapMotion code to be used wir Adobe AIR AS3 (Unsorted / Other API)
README
LeapMotionAIR
=============LeapMotion code to be used wir Adobe AIR AS3 3.0 or greater.
It uses the HTTP WebSocket protocol for HTML5 to communicate.
It means, doesn't need to add any native extension, just add the code to your library and you can connect to LeapMotion socket.public function Main()
{
var leapSocket:LeapSocket = new LeapSocket();
leapSocket.addEventListener(Event.CONNECT, socketConnect);
leapSocket.addEventListener(Event.CLOSE, close);
leapSocket.addEventListener(IOErrorEvent.IO_ERROR, error);
leapSocket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, error);
leapSocket.addEventListener(LeapEvent.DATA, leapData);
leapSocket.connect("127.0.0.1", 6437);
}private function leapData(event:LeapEvent):void
{
// Returns a Frame Object
// Frame object: https://developer.leapmotion.com/documentation/api/class_leap_1_1_frame
// LeapMotion Javascript tutorial: https://developer.leapmotion.com/documentation/guide/Sample_JavaScript_Tutorial
trace(event.data);
}private function error(event:ErrorEvent):void
{
trace("Error:", event.text);
}private function close(event:Event):void
{
trace("Close");
}private function connect(event:Event):void
{
trace("Connect")
}