package { import com.phidgets.*; import com.phidgets.events.*; import flash.display.Sprite; public class actionscript_phidget_system_PhidgetLEDTest extends Sprite { private var phid:PhidgetLED; public function actionscript_phidget_system_PhidgetLEDTest() { phid = new PhidgetLED(); phid.addEventListener(PhidgetEvent.CONNECT, onConnect); phid.addEventListener(PhidgetEvent.DISCONNECT, onDisconnect); phid.addEventListener(PhidgetEvent.DETACH, onDetach); phid.addEventListener(PhidgetEvent.ATTACH, onAttach); phid.addEventListener(PhidgetErrorEvent.ERROR, onError); phid.open("localhost", 5001); } private function onError(evt:PhidgetErrorEvent):void { trace(evt); } private function onAttach(evt:PhidgetEvent):void{ trace(evt); var i:int; for(i=0;i