Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: FLASH: Reading data from the xml socket
From: Adrian Harris
Date: Sat, 9 Sep 2000 07:58:53 +0100

I connect:

stop ();
sock = new XMLSocket();
sock.connect("something.com", 3742);

function onSockConnect (success) {
if (success) {
gotoAndStop (4); //start communicating
} else {
gotoAndStop (3); //error screen
}
}
sock.onConnect = onSockConnect;

I send:

on (release) {
// Create XML to send
tosend = new XML();
updata = tosend.createElement("input");
updata.attributes.text = input;
tosend.appendChild(updata);
sock.send(tosend);
}

... so far so good. I know this gets to the server. The server just
echoes it back. Now try to read the response which is supposed to be
hiding in the socket obect:

function showit(doc) {
var e = doc.firstChild;
if (e != null && e.nodeName == "input") {
displayMessage(e.attributes.text);
}
}

function displayMessage(info) {
output = info;
}
sock.onXML = showit;


Nothing.

Would be grateful to anyone with any ideas or who points out silly mistakes.

Regards,

Adrian

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NudeGuru.com is proud to sponsor the Flasher list
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IT'S THE ART OF MONEY, HONEY!
Tips and Advice from some of the most popular Flash
artists + industry power-brokers on how to hold onto
your rights, negotiate contracts and get full value
for your work.http://www.nudeguru.com from Franke James
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  RE: FLASH: Reading data from the xml soc, Jon Williams

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]