Today, I give you a free utility class that handles everything you need to handle in order to establish a connection. Tomorrow, I give you the world a class that make it seem like you are calling functions directly on the server and visa versa.

Download the latest version of the ConnectionEstablisher class here.

Usage example:

ActionScript
< view plain text >
  1. // To establish a new connection, do the following:
  2. var _server:ConnectionEstablisher = new ConnectionEstablisher("127.0.0.1", 4500);
  3.  
  4. // To send data to the server, do the following:
  5. var xmlPacket:XML = <car>
  6.                         <year>2007</year>
  7.                         <make>Toyota</make>
  8.                         <model>Baja 1000 FJ Cruiser</model>
  9.                     </car>
  10.  
  11. _server.send(xmlPacket);

This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial 3.0 United States License.