XML Socket in as3 :)

AS3 XML Sockets
Franky Natividad
I started programming at age 14. My first was ActionScript Ever since then Ive always wanted to make an Online game. Now with that successful, Now I wish to help others with their problems, and provide out of the box Flash Projects that may inspire others to do greater things.
View all articles by Franky NatividadAlright after 30 mins of testing I got it working and got all the listeners and event handlers ready to go for you all first Listeners and initiate :)
var xml_s=new XMLSocket();
xml_s.connect(ip,port);
xml_s.addEventListener(Event.CONNECT,xmlsocket);//OnConnect//
xml_s.addEventListener(Event.CLOSE,xm lsocket);//OnDisconnect//
xml_s.addEventListener(IOErrorEvent.I O_ERROR,xmlsocket);//Unable To Connect//
Now for listener handlers :)
public function xmlsocket(Event):void{
switch(Event.type){
case 'ioError':
//Unable to Connect :(//
break;
case 'connect':
//Connected :)//
break;
case 'close':
//OnDisconnect :( //
break;
}
}
Now to Send all you do is this.
xml_s.send("MESSAGE HERE");
I hope i helped you enough remember If you have any questions ask me I doubt they have anything on this yet :)
Spread The Word
2 Responses to "XML Socket in as3 :)" 
|
said this on 02 Jul 2007 3:52:13 PM CDT
i just want to ask you if i can push data i mean streaming data and it must be real time data like the finical data for every sec by using socket in flash and java server
thanks alot |


Author/Admin)