Locating the Flash Client API

API is Application Programming Interface that allows other software to interact with it. Flash Client API for SmartFoxServer is the interface that allows Flash to connect to the SmartFoxServer and interact with it.

The following code snippet shows how Flash uses the client API to interact with SmartFoxServer.

Create an instance of client API object:

var client = new SmartFoxClient();

Connect the client to the SmartFoxServer with specific IP address and port number:

client.connect("127.0.0.1",9339);

The connection between the Flash client and the SmartFoxServer is established now. Next, we log in the user to the zone simpleChat with the username John.

client.login("simpleChat","John","");

Send public messages to all users ...

Get Flash Multiplayer Virtual Worlds now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.