Page 1 of 1

problem with connection

Posted: 15 Feb 2010, 19:19
by slayerzphb
Version: SFS Basic with the latest patch and latest apis

Debug:
[Sending]: <msg t='sys'><body action='verChk' r='0'><ver v='153' /></body></msg>

[Received]: <cross-domain-policy><allow-access-from domain="*" to-ports="9339" /></cross-domain-policy>
[Received]: <msg t="sys"><body action="apiOK" r="0" /></msg>

So...later this... i don't recieve any message...
the sfs tris example run normally for example...
but my game...see my codes...

Part of the code:
_root.zoneGame = "mygamezone";
_root.sfcl = new SFCl(username, ip, port, true, _root.zoneGame);
---------------------------------------------------------------------

Part of my class SFCl.as:
class SFCl extends it.gotoandplay.smartfoxserver.SmartFoxClient
{
static var zone;
function SFCl(username, ip, port, debug, z)
{
super();
this.debug = debug;
this.username = username;
this.ip = ip;
this.port = port;
zone = z;
this.connect(ip, port);

function onObjectReceived(obj, sender)
{
------------------------------------------------

*The api is appointed correctly to the classpath of sfs basic/flash api/actionscript 2...
-----------------------------------------------------------------

Anybody Can Help me?

Posted: 15 Feb 2010, 22:07
by Lapo
What does your onConnection handler do?

onconnection handler

Posted: 16 Feb 2010, 13:20
by slayerzphb
Lapo wrote:What does your onConnection handler do?

function onConnection(success)
{
_global.currentRoom = undefined;
if (success)
{
this.login(SFCl.zone, username);
}
else
{
var errorwind = _root.showWindow("errorWindow");
errorwind.errorMsg.text = "Error. Try again later.";
} // end else if
}


----------------------
i tried too:
function onConnectionHandler(success:Boolean):Void
function onConnectionHandler(success)
-----------------------------
i tried this.onConnection = handleConnection (in part of my class)
and function handleConnection(success:Boolean)
( equal example of sfs tris)
but
any message...
don't happen nothing!

Posted: 16 Feb 2010, 15:03
by Lapo
Ok, veeery confusing. :)
I would suggest that you start with one of our examples, like the SimpleChat and verify that it works. Those examples are meant to work out of the box.
Let us know.