[JDEV] Flash MX XMLsocket to Jabberd Help Needed.
dlb
civintel at comcast.net
Sun Oct 27 12:21:45 CST 2002
Rick
I'm not familiar w/ the libraries you're using. Flash's onClose is a
callback that's fired when you're disconnected by the server , it's not
activated when the client kills the connection.
as Iain stated , FML provides a set of AS libraries and a demo client for
developing Flash Jabber apps. The current release ( 0.7 ) isn't actually MX
compliant , but I do have an MX compliant version that I can send you if
you're interested.
-D
----- Original Message -----
From: "Mooner Entertainment" <moonerent at yahoo.com>
To: <jdev at jabber.org>
Sent: Thursday, October 24, 2002 5:30 PM
Subject: [JDEV] Flash MX XMLsocket to Jabberd Help Needed.
> Hello,
>
> Lovin' Flash MX however I'm having a tough time
> getting it to work as a Jabber client. I'm running
> Jabberd server 1.42 on Win2K Server.
>
> Below the .as script (it's fla is simply a connect and
> disconnect button with a text field) has two bugs,
> please let me know what you think...
>
> 1) When I comment out
> file://_root.jabberSocket.send(this.node_stream);
>
> then click connect there is a successful connection to
> the server. However if I click disconnect the close()
> function does not activate _root.jabberSocket.onClose.
>
> My current workaround is to add
> delete {_root.jabberSocket);
>
> 2) With
> _root.jabberSocket.send(this.node_stream);
>
> active I click on connect and immediately
> _root.jabberSocket.onClose is called and now the
> client is disconnected from the server.
>
> Mind you I haven't called close(), why is the jabber
> server closing the socket on it's own?
>
> Thank you in advance.
>
> Rick
>
>
> function connect() {
> if(!_root.jabberSocket){
> // Create new XMLSocket object
> _root.jabberSocket = new XMLSocket();
> _root.myVars = new Object();
> _root.myVars.serverName = "myServer.com";
> _root.myVars.serverPort = 5222;
>
> _root.jabberSocket.connect(_root.myVars.serverName,
> _root.myVars.serverPort);
>
> _root.jabberSocket.onXML = newXML;
> _root.jabberSocket.onConnect = newConnection;
> _root.jabberSocket.onClose = disconnectedConnection;
> _root.status.text = "waiting";
>
> }else{
> _root.status.text = "still connected";
> }
> }
>
> function newConnection (success) {
> if (success) {
> _root.status.text = "connected!";
>
> // prepare and send in log in info
> this.node_stream = new XML();
> this.node_stream.xmlDecl = '<?xml version="1.0"
> encoding="UTF-8"?>';
> this.node_stream =
> this.node_stream.createTextNode('<flash:stream
> to="'+_root.myVars.serverName+'" xmlns="jabber:client"
> xmlns:flash="http://www.jabber.com/streams/flash"
> />');
> _root.jabberSocket.send(this.node_stream);
>
> }
> else {
> _root.status.text = "error connecting";
> }
> }
>
> function closeConnection(){
> _root.jabberSocket.send("</flash:stream>");
> _root.jabberSocket.close();
> delete(_root.jabberSocket);
> }
>
> function disconnectedConnection () {
> _root.status.text = "disconnected";
> }
>
> THE END
>
>
>
> function newXML (input) {
> // convert XML object to string
> _root.status.text = input.toString();
> }
>
> stop();
>
>
>
> __________________________________________________
> Do you Yahoo!?
> Y! Web Hosting - Let the expert host your web site
> http://webhosting.yahoo.com/
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev
More information about the JDev
mailing list