Marcos is Currently...
- Hypnotizing: "Mechanical Principles", circa 1930 http://t.co/pFMNRnEk | 2 weeks ago
- Lazy saturday refactoring http://t.co/AhBDeVNL Rewrote the flickr API bit + added snappy mysql caching. Response cut down from 10s to 1s :] | 2 weeks ago
- @canoeberry @didierh There's a bit of trickery involving an 85mm 1.4 lens, a DSLR body, 2 flashes, a softbox and an iPhone in my pocket | 3 weeks ago
- Whatever you do, just don't mess with @didierh during a design review http://t.co/y17BbNhn | 3 weeks ago
shared items in Google Reader
- Dune House by Jarmund/Vigsnæs AS Architects | October 2011
- Barcode House by David Jameson | October 2011
- On the Corner | October 2011
- Looks Cool, But What Does It Actually Shelter? | October 2011
- Wall Photos | Facebook | October 2011
- La Fontaine Apartment \ Esrawe Studio | October 2011
- The HI-MACS® House in Bavaria, Germany | October 2011
- Ravenscroft Desk by Leonhard Pfeifer | October 2011
- Coldwater Studio by Casey Hughes Architects | September 2011
- A Unique LA Home With Arcade Wall Graphics | September 2011
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!



















