Marcos is Currently...
- San Fran to Yellowstone overland on a front cover "assignment" for Flipboard ;) http://post.ly/uRDH | 3 days ago
- @jackiefree hiii! | 5 days ago
- @kkfactory 久しぶり!ありがとう! | 6 days ago
- @MCHammer btw, this is the App I was telling you about today: it's called iRhyme, and done by @charlietuna http://j.mp/9aoc9u | 1 week ago
shared items in Google Reader
- Cat-trashing lady outed by internet in less than 24 hours | 2 weeks ago
- Fuck You by Cee-Lo | 2 weeks ago
- The timeless design of National Geographic | 2 weeks ago
- Pancake flipping robot | last month
- Ugur Derinogullu | last month
- 5 Porcelain Table Pieces By Aldo Bakker | last month
- Victorian Star Wars portraits | June 2010
- Place, Space and the Mobile Interface | June 2010
- Apple, AT&T sued over iPad data plan change | June 2010
- Alexis Marcou | June 2010
recent photos on flickr
recent trips
- Returned from a trip to Prescott. | February 2010
- Started a trip to Prescott. | February 2010
- Returned from a trip to Los Angeles. | October 2009
- Started a trip to Los Angeles. | October 2009
- Returned from a trip to New York. | February 2009
news / Phidgets AS3
July 17, 2006
Phidgets AS3

Here's an Alpha AS3 rewrite of the AS2 phidgets Library. It's still very early on the developing process, but I thought I'd give everyone who might be interested a quick peek of what you can do with it.
download:
you will need to have installed Phidgets.msi and have the PhidgetWebService running in order to properly connect to your phidgets. PhidgetWebService is a super light socket server to which your flash application connects to in order to properly send and receive data from all phidget components. To install Source and Samples in Flex Builder I'd really recommend you to simply choose file> Import > Archive File > Choose the zip you just downloaded If you want to go the SWC way, which is probably simpler, just create a new AS3 project in Flex Builder, Choose a name click next, and on the Library Path Tab click [ add SWC... ] and choose the location of the PhidgetLibrary.swc you just downloaded. Things are still very dirty, If you have any suggestions on how to improve the code, please let me know. I've done my best to resemble the original AS2 API as close as I could. Still, I took the liberty of creating extra objects that allow for even easier Phidget management. There's no documentation at all yet, but there's plenty of samples to dig and learn how to use most of them. If anyone out there wants tp give me a hand with docs I'd really appreciate it. I'll try in the following days to write up some simple tutorials, so if you can't deal with the samples, patience. code sample after the jump.
here's a very simple sample on how to connect and set a servo rotation.
package {
import com.phidgets.*;
import com.phidgets.events.*;
import flash.display.Sprite;
import flash.events.MouseEvent;;
public class PhidgetServoTest extends Sprite {
private var servoControl :PhidgetServoControl;
private var servo :PhidgetServo;
public function PhidgetServoTest() {
servoControl = new PhidgetServoControl();
servoControl.addEventListener(PhidgetEvent.CONNECT, onConnect);
servoControl.connect("localhost",5001,"pass");
}
private function onConnect(evt:PhidgetEvent):void{
trace("onConnect");
servo = servoControl.getServo(0);
stage.addEventListener(MouseEvent.MOUSE_DOWN,onMouseDown);
}
private function onMouseDown(evt:MouseEvent):void{
servo.rotation = Math.floor(Math.random()*180);
}
}
}
[ What Are Phidgets?
Phidgets are an easy to use set of building blocks for low cost sensing and control from your PC. Using the Universal Serial Bus (USB) as the basis for all Phidgets, the complexity is managed behind an easy to use and robust Application Programming Interface (API). Applications can be developed quickly in Visual Basic, VBA (Microsoft Access and Excel), LabView, Java, Delphi, C and C++. ]
... and AS3 now of course!
I should probably mention all phidgets you see in the image above where an awesome present by Teiichi. After I told him how I almost cry after realizing my original Phidget Box was lost somewhere inbetween Tokyo and Milan, 3 days later he dropped by with a new kit under his arm. Thank you so much!
Alright, so here you go.
Happy Hacking!



















