Flasher Archive

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


Subject: RE: FLASH: Reading data from the xml socket
From: Damien Morton
Date: Sat, 9 Sep 2000 17:49:32 +0100

As far as I can tell, the XMLsocket isnt really an XMLsocket, but rather a
simple socket.

The data you send and get can be arbritary text data.

Im not sure if this helps, but why not treat the data you get from your
onXML handler as straight text data and either display that, or parse it
into a new XML object.

BTW, I find it easier to express my socket handlers like this:

sock.onConnect = function(success) {
if (success) {
// foo
} else {
// bar
}
}

> -----Original Message-----
> From: Adrian Harris [adrianatduual [dot] com (mailto:adrianatduual [dot] com)]
> Sent: Saturday, September 09, 2000 2:43 AM
> To: flasheratchinwag [dot] com
> Subject: FLASH: Reading data from the xml socket
>
>
> 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
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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


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