Error #2031: Socket Error. URL: localhost

Legacy support with Phidget21
digitalmatt
Phidgetsian
Posts: 12
Joined: Wed Jul 25, 2012 1:24 pm
Contact:

Error #2031: Socket Error. URL: localhost

Postby digitalmatt » Wed Jul 25, 2012 4:51 pm

(posted this here as well in case the Mac forum wasn't appropriate)

Tearing my hair out here. I keep getting the following error when I compile my flash file from within CS5:

Phidget Error Event: Error #2031: Socket Error. URL: localhost


I've triple checked that my webservice is running. I've added the flash file to the list of trusted locations in flash global security settings. But continue to receive this error. I'm running Mac OSX 10.7.4.

Here's my code:

Code: Select all


public var phid:PhidgetInterfaceKit;
      
      public function PhidgetTest() {
         
         addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
         
      }
      
      public function onAddedToStage(e:Event):void {
         trace("Added to stage");
         removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
         phid = new PhidgetInterfaceKit();
         
         phid.addEventListener(PhidgetErrorEvent.ERROR, onError);
         phid.addEventListener(PhidgetEvent.DETACH,   onDetach);
         phid.addEventListener(PhidgetEvent.ATTACH,   onAttach);
         phid.addEventListener(PhidgetEvent.CONNECT,   onConnect);
         phid.addEventListener(PhidgetEvent.DISCONNECT,   onDisconnect);
         
         phid.open("localhost", 5001);
         
         tracesensor_btn.addEventListener(MouseEvent.CLICK, onTraceSensor);
         tracesensor_btn.buttonMode = true;
      }
      
      public function onTraceSensor(e:MouseEvent):void {
         trace(phid);
         //output_txt.appendText( "TRACE DEVICE: " + phid.Device.Name + ", Serial Number: " + phid.Device.serialNumber.toString() + "\n" );
         output_txt.appendText("PHID: " + phid + "\n");
      }
      
      public function onError(e:PhidgetErrorEvent):void {
         trace("**ERROR**: " + e);
         output_txt.appendText("**ERROR**: " + e);
      }
      
      public function onAttach(e:PhidgetEvent):void {
         
         trace("ATTACH: " + e.Device.Name + ", Serial Number: " + e.Device.serialNumber.toString() + "\n" );
         output_txt.appendText( "ATTACH: " + e.Device.Name + ", Serial Number: " + e.Device.serialNumber.toString() + "\n" );
      }
      
      public function onDetach(e:PhidgetEvent):void {
         
         trace("DETACH: " + e.Device.Name + ", Serial Number: " + e.Device.serialNumber.toString() + "\n" );
         output_txt.appendText( "DETACH: " + e.Device.Name + ", Serial Number: " + e.Device.serialNumber.toString() + "\n" );
      }
      
      public function onConnect(e:PhidgetEvent):void {
         
         trace("CONNECT: " + e.Device.Name + ", Serial Number: " + e.Device.serialNumber.toString() + "\n" );
         output_txt.appendText( "CONNECT: " + e.Device.Name + ", Serial Number: " + e.Device.serialNumber.toString() + "\n" );
      }
      
      public function onDisconnect(e:PhidgetEvent):void {
         
         trace("DISCONNECT: " + e.Device.Name + ", Serial Number: " + e.Device.serialNumber.toString() + "\n" );
         output_txt.appendText( "DISCONNECT: " + e.Device.Name + ", Serial Number: " + e.Device.serialNumber.toString() + "\n" );
      }


Return to “ActionScript 3.0 - Flash CS3 / Flex / AIR”

Who is online

Users browsing this forum: No registered users and 3 guests