1047 getEnabled problem

Legacy support with Phidget21
Post Reply
Fresh meat
Posts: 3
Joined: Mon Sep 11, 2017 6:46 am

1047 getEnabled problem

Post by mindthegap »

the flash examples aren't very good.

everythings work when i activate the 4701 channel 0. when I try to open the channel in an init method it throws also an unknown error.

Code: Select all

phid = new PhidgetEncoder();	
			phid.addEventListener(PhidgetEvent.DETACH, onDetach);
			phid.addEventListener(PhidgetEvent.ATTACH, onAttach);
			phid.addEventListener(PhidgetErrorEvent.ERROR, onError);
			phid.addEventListener(PhidgetDataEvent.INPUT_CHANGE, onInputChange);
			phid.addEventListener(PhidgetDataEvent.POSITION_CHANGE, onPositionChange);
			phid.open("localhost", 5001);
			stage.addEventListener(MouseEvent.CLICK, onStageClick);
			if (phid.getEnabled(0) == false){
				phid.setEnabled( 0, true);
Ok, when I enable the channel delayed, it works. how can I check if the phidget is initialized?
User avatar
Site Admin
Posts: 923
Joined: Fri Oct 28, 2011 12:17 pm

Re: 1047 getEnabled problem

Post by mparadis »

You may be able to use the "isAttached" function to determine if the Phidget has attached before trying to access it.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest