Connect SmartFox Server using Action Script 3 In Flash Builder 4.6

In this tutorial we are going to connect SmartFox Server using Action Script 3 in Flash Builder 4.6. Mostly you won’t get action script 3 code to connect smartfox server, here i’ll provide action script 3 source code at end of the tutorial.

At the end of the tutorial you came knw following this…

1. Action Script 3 code to connect SmartFox Server.

2. Action Script 3 SmartFox Server API.

3. Action Script 3 event listeners and etc..

Step 1: Create action script 3 project by going File -> New -> Action Script project.

Step 2: Once I created Action Script project, then I imported following action script packages in the project to utilize SmartFox Server  api to connect with server.

import it.gotoandplay.smartfoxserver.*;

Step 3: Then I instantiated SmartFoxClient class object using following syntax.

private var sfs:SmartFoxClient = new SmartFoxClient();

Step 4: By using connect() method we made a connection request to SmartFox Server.


Step 5: Once the connection is success, the following event is triggered to indicate the connection was success.

sfs.addEventListener(SFSEvent.onConnection, onConnect);

Here is the whole source code.

If any problem to make a connection to the Server, let me know using below comment box.

Posted by:

  • muni

    nice script…….thanks

Related articles

My Favorite Blog

Quiz Web App

Responsive Quiz Application Using PHP, MySQL, jQuery, Ajax and Twitter Bootstrap

Be Happy!!!

Inspirational Quotes - Motivational Quotes- Short Stories

Does God Exists?

Inspirational Quotes - Motivational Quotes- Short Stories

Back to Top