phidget and AS3
Hi all,
I am trying to move my game characters using phidgets.
I have the following code but got these error messages when I run it.
1119: Access of possibly undefined property data through a reference with static type com.phidgets.events:PhidgetDataEvent.
1119: Access of possibly undefined property index through a reference with static type com.phidgets.events:PhidgetDataEvent.
Cant figure out where the problem is from. I need help
Another question is: How can i access the sensors connected to a phidget?
package{
import com.phidgets.events.*;
import com.phidgets.*
public class spacegame extends MovieClip
{
public var phid:PhidgetInterfaceKit;
public function spacegame()
{
phid = new PhidgetInterfaceKit();
phid.open("localhost", 5001);
phid.addEventListener(PhidgetDataEvent.SENSOR_CHANGE, onSensorChange);
}
public function onSensorChange(evt:PhidgetDataEvent):void
{
trace (evt.data);
trace(evt.index);
}
}
}
