hiyall,
i plan to make an AS3 package to communicate with processing with flash, but it seems i cant even get xml sockets to run. i’d like to know if it’s AS3 related or if related to my network (cuz im not really good with networks)
here is what i did
package {
// imports
import flash.display.Sprite;
import flash.net.XMLSocket;
import flash.events.Event;
import flash.events.DataEvent;
import flash.events.IOErrorEvent;
// class definition
public class Main extends Sprite {
// variables
var socket:XMLSocket;
// constructor
public function Main () {
socket = new XMLSocket ();
socket.connect ("127.0.0.1", 9002);
socket.addEventListener (DataEvent.DATA, xmlSocketDataHandler);
socket.addEventListener (Event.CONNECT, xmlSocketEventsHandler);
socket.addEventListener (Event.CLOSE, xmlSocketEventsHandler);
socket.addEventListener (IOErrorEvent.IO_ERROR, xmlSocketEventsHandler);
}
// events
private function xmlSocketEventsHandler (event:Event):void {
trace (event);
}
private function xmlSocketDataHandler (dataEvent:DataEvent):void {
trace (dataEvent);
}
// functions
}
}
whether i use the loneliest number or the ip i get from my ipconfig (i work on windows xp) i get an IOerror
any help is appreciated!