Page 1 of 1
How to connect? Can't get started!
Posted: 13 Mar 2011, 15:38
by delavega
I'm totally new to SmartFoxServer.
I installed the 2x version and everything's fine.
I have a book called Flash Multiplayer Virtual Worlds but it's based in SFS 1.X.
The server is working and the examples are working.
I have Flash CS5 installed.
I'm reading the documentation but can't find a detailed way just to connect from a simple .fla file to the server and trace it.
Next step would be to install a Java IDE, but first wanted to connect from the client using actionscript 3.
Any help is MUCH appreciated! I'm totally lost.
Many thanks!
Posted: 14 Mar 2011, 13:27
by Bax
Check the source code of the "connector" example provided with SFS2X?
Posted: 15 Mar 2011, 23:56
by delavega
bax wrote:Check the source code of the "connector" example provided with SFS2X?
Thank you. I think something is wrong.
I was trying to trace isConnected in the next line after sfs.connect and it always returns false (I thought there was something wrong with my server config because of this).
But if add the trace to isConnected inside the onConnection Event (checking for evt.params.success) it returns true.
It's already connecting but the answer is: why the isConnected property is still returning false right after executing connect?
Many thanks!
Posted: 16 Mar 2011, 09:06
by Lapo
In the docs:
http://docs2x.smartfoxserver.com
there is an entire section dedicated to getting started with SFS2X which, lo and behold, is called "Getting Started"
Next move to the "Development Basics" section and in no time you'll be an SFS2X jedi

Posted: 16 Mar 2011, 11:40
by Bax
delavega wrote:It's already connecting but the answer is: why the isConnected property is still returning false right after executing connect?
When you execute the sfs.connect() method on the client, a message is sent to the server, the server processes it and send a response. This of course takes some time (due to the network lag). If you check the isConnected flag right after sending the connect command, the client hasn't received the server response yet, so it is not yet aware if the connection was successful.
Posted: 16 Mar 2011, 13:11
by delavega
bax wrote:delavega wrote:It's already connecting but the answer is: why the isConnected property is still returning false right after executing connect?
When you execute the sfs.connect() method on the client, a message is sent to the server, the server processes it and send a response. This of course takes some time (due to the network lag). If you check the isConnected flag right after sending the connect command, the client hasn't received the server response yet, so it is not yet aware if the connection was successful.
Thank you!