[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
    Heh... yeah, I found my archive of cold docs had a nice section on
networking AFTER I sent the e-mail out. Guess that'll teach me to look
before I pester, eh? Thanks for the reply anyway, Bruce & Jeff.
    Is it a safe assumption to take the $login_interface object as an
example of how to bind a port and  accept connections? Also, regarding
Bruce's thoughts detailed below...

On Wednesday, April 04, 2001 11:53 PM Bruce wrote:
> A more fun problem to look at is what type of character data Flash5 is
> looking for.  Will it accept the regular 7 bit ASCII data?  Will it want
> UTF-8?  Some other form of Unicode?
    I included another excerpt from the help file on the socket, sorry to
spam you all... you'll see it at the end o' this ramble. I thought it would
explain a bit more about what Flash expects... cuz to be honest, I don't
completely understand what it all means yet. I plan on stumbling through it
like I always do. Nothing like a little programming experimentation to see
what happens! BOOOOOOM!

> It is odd that you bring this up though now, because I know of some
> others who want the same capabilities and some work may be done to
> Genesis to embed an XML parser in it safely (asynchronous parsing so
> that even if you need to parse a large document, you won't lock up the
> driver while the parser is running).
    That would be awesome considering the expanded use/capability of XML
over HTML. Fortunately with the project I'm working on now, I won't need to
send a great deal of information back and forth. Probably no more than a
couple kilobytes of data will be handled... like for a chat program. The
bigger goal is for me to use Cold to populate variables in Flash, but even
those won't be very large. The problem would for me would be that there
could possibly be 10 to 50 people connected at once... if I'm lucky.

> It would probably make sense for you to visit in a couple of days and
> let us know how things are going, what your experiences have been, etc.
> I'd love to hear more.
    Well those that know me realize how I like to watch m'self type. I'd be
happy to stop in but... uh... heheh.... I forgot my password on the Cold
Dark. My char is Grim. *BLUSHES with shame*

Okay, I'm out. Thanks again, folks!
- Andy/Grim/Paidran




Another excerpt from the Flash5 help on the XML socket object...
XMLSocket.onXML

Syntax
        myXMLSocket.onXML(object);

Argument
        object An instance of the XML object containing a parsed XML
document received from a server.

Description
        Method; a callback function invoked by the Flash Player when the
specified XML object containing an XML document arrives over an open
XMLSocket connection. An XMLSocket connection may be used to transfer an
unlimited number of XML documents between the client and the server. Each
document is terminated with a zero byte. When the Flash Player receives the
zero byte, it parses all of the XML received since the previous zero byte,
or since the connection was established if this is the first message
received. Each batch of parsed XML is treated as a single XML document and
passed to the onXML method.
    The default implementation of this method performs no actions. To
override the default implementation, you must assign a function containing
actions that you define.

Example
        The following function overrides the default implementation of the
onXML method in a simple chat application. The function myOnXML instructs
the chat application to recognize a single XML element, MESSAGE, in the
following format:

<MESSAGE USER="John" TEXT="Hello, my name is John!" />.
        The onXML handler must first be installed in the XMLSocket object as
follows:

socket.onXML = myOnXML;
        The function displayMessage is assumed to be a user-defined function
that displays the message received to the user.

function myOnXML(doc) {
    var e = doc.firstChild;
        if (e != null && e.nodeName == "MESSAGE") {
            displayMessage(e.attributes.user, e.attributes.text);
        }
}