You don't need frames to view this website. Flash communication server. Flash mx xml socket server.
Home arrow FAQ arrow How to connect from Flash (Actionscript inside)
Main Menu
Home
- - - - - - -
What is Palabre ?
Features
News
FAQ
Forum
DEMO
- - - - - - -
Downloads !
Browse SVN
- - - - - - -
Search
Contact Us
- - - - - - -
Sourceforge Project Page
Python
Links







Actionscript for Multiplayer games

 
Download Palabre Flash Xml Socket Server DOWNLOAD Download Palabre Flash Xml Socket Server FORUM Download Palabre Flash Xml Socket Server FAQ Download Palabre Flash Xml Socket Server WHAT IS IT
 


How to connect from Flash (Actionscript inside) PDF Print E-mail
Simple Actionscript code to connect to the server.

So here comes the actionscript :

 

XML.prototype.ignoreWhite = true;

/* Create a new XMLSocket Object */ 

x = new XMLSocket(); 

x.ignoreWhite = true;

/* Define an handler function to check connection */ 

x.onConnect = function (status) { 

    if(status) {

        trace('Connection OK');

        /* If connection is OK then we can identify and start sending XML */

       _root.x.send('<connect nickname="test_'+random(30)+'" ></connect>');

    } else {

        trace('No Connection');

    } 

}

 

/* Define an handler function to trace incoming XML */ 

 x.onXML = function (xmlNode) {

    trace('Just Received : '+xmlNode); 

 }

 

/* Then start the connection, adjust IP and port to reflect the server information */ 

x.connect('127.0.0.1',2468);

 

 

Or if you just want to check connection, download the example clients

Palabre example client