flash:
--------------------------------------------------------
on (release) {
function myOnConnect(success) {
if (success) {
userxml= new XML ("<new>"+nom+"</new>");
socket.send(userXML);
gotoAndStop ("main");
} else {
info= "Connection failed!";
}
}
socket = new XMLSocket();
socket.onConnect = myOnConnect;
if (!socket.connect("127.0.0.1", 10000)) {
info= "127.0.0.1 :"+port+"Connection failed!";
}
}
(Work exept that i can only read one byte each two bytes)
---------------------------------------------------
flash MAIN:
on (release) {
msgXML= new XML ("<msg>"+msg+"</msg>");
socket.send(nomXML);
}
-------------------------------------------
socket.onXML = lire;
function read(tampon) {
chat += "--------------"
}
(HEre each won't work....)
---------------------------------------------
Blitz Code:
srv=CreateTCPServer(port)
If srv=0 Then
Print "Impossible de créer une connect@"
Else
While Not KeyHit(1)
acc=AcceptTCPStream(srv
If acc
Print "Nouveau connecté
Print "**********************"
While Not Eof (acc)
byt=ReadByte(acc)
If byt>0 And ReadAvail(acc) Then
Print Chr(byt)
WriteByte acc,byt
EndIf
Wend
EndIf
Wend
--------------------------------------------------------
on (release) {
function myOnConnect(success) {
if (success) {
userxml= new XML ("<new>"+nom+"</new>");
socket.send(userXML);
gotoAndStop ("main");
} else {
info= "Connection failed!";
}
}
socket = new XMLSocket();
socket.onConnect = myOnConnect;
if (!socket.connect("127.0.0.1", 10000)) {
info= "127.0.0.1 :"+port+"Connection failed!";
}
}
(Work exept that i can only read one byte each two bytes)
---------------------------------------------------
flash MAIN:
on (release) {
msgXML= new XML ("<msg>"+msg+"</msg>");
socket.send(nomXML);
}
-------------------------------------------
socket.onXML = lire;
function read(tampon) {
chat += "--------------"
}
(HEre each won't work....)
---------------------------------------------
Blitz Code:
srv=CreateTCPServer(port)
If srv=0 Then
Print "Impossible de créer une connect@"
Else
While Not KeyHit(1)
acc=AcceptTCPStream(srv
If acc
Print "Nouveau connecté
Print "**********************"
While Not Eof (acc)
byt=ReadByte(acc)
If byt>0 And ReadAvail(acc) Then
Print Chr(byt)
WriteByte acc,byt
EndIf
Wend
EndIf
Wend