topical media & game development
actionscript-phidget-system-PhidgetManagerTest.ax
actionscript-phidget-system-PhidgetManagerTest.ax
[swf]
flex
package
{
import com.phidgets.*;
import com.phidgets.events.*;
import flash.display.Sprite;
public class @ax-actionscript-phidget-system-PhidgetManagerTest extends Sprite {
private var phid:PhidgetManager;
public function @ax-actionscript-phidget-system-PhidgetManagerTest() {
phid = new PhidgetManager();
phid.addEventListener(PhidgetManagerEvent.CONNECT, onConnect);
phid.addEventListener(PhidgetManagerEvent.DISCONNECT, onDisconnect);
phid.addEventListener(PhidgetManagerEvent.DETACH, onDetach);
phid.addEventListener(PhidgetManagerEvent.ATTACH, onAttach);
phid.addEventListener(PhidgetErrorEvent.ERROR, onError);
phid.open("localhost", 5001);
}
private function onError(evt:PhidgetErrorEvent):void {
trace(evt);
}
private function onAttach(evt:PhidgetManagerEvent):void{
trace(evt);
}
private function onDetach(evt:PhidgetManagerEvent):void{
trace(evt);
}
private function onConnect(evt:PhidgetManagerEvent):void{
trace(evt);
}
private function onDisconnect(evt:PhidgetManagerEvent):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.