Locating the Flash Client API in SmartFoxServer

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 in the same room.

client.sendPublicMessage('Hello SmartFoxServer’);

The Flash Client API is located in SmartFoxServer installation directory | Flash API. There are four directories inside it. They are ActionScript 2.0, ActionScript 3.0, RedBoxClient_AS2, and RedBoxClient_AS3. RedBoxClient is the client API for connecting the media streaming Red5 component.

This entry was posted in Flash, Games. Bookmark the permalink.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.