topical media & game development
actionscript-phidget-system-PhidgetRFIDTest.ax
actionscript-phidget-system-PhidgetRFIDTest.ax
[swf]
flex
package
{
import com.phidgets.*;
import com.phidgets.events.*;
import flash.display.Sprite;
public class @ax-actionscript-phidget-system-PhidgetRFIDTest extends Sprite {
private var phid:PhidgetRFID;
public function @ax-actionscript-phidget-system-PhidgetRFIDTest() {
phid = new PhidgetRFID();
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.addEventListener(PhidgetDataEvent.TAG, onTag);
phid.addEventListener(PhidgetDataEvent.TAG_LOST, onTagLoss);
phid.addEventListener(PhidgetDataEvent.OUTPUT_CHANGE, onOutputChange);
phid.open("localhost", 5001);
}
private function onError(evt:PhidgetErrorEvent):void {
trace(evt);
}
private function onAttach(evt:PhidgetEvent):void{
trace(evt);
phid.Antenna = true;
}
private function onDetach(evt:PhidgetEvent):void{
trace(evt);
}
private function onConnect(evt:PhidgetEvent):void{
trace(evt);
}
private function onDisconnect(evt:PhidgetEvent):void{
trace(evt);
}
private function onTag(evt:PhidgetDataEvent):void{
trace(evt);
phid.LED = true;
}
private function onTagLoss(evt:PhidgetDataEvent):void{
trace(evt);
phid.LED = false;
}
private function onOutputChange(evt:PhidgetDataEvent):void{
trace(evt);
}
}
}
(C) Æliens
27/08/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.