problem when call a client side mothed from server side
Hi, everyone! I have a problem when I call a client side mothed from server side.
Below is the code. When the swf is connected to FMS(the connection is successful) I use this application.user_so.send("enterContestGroup"); to call the client side mothed. You can see that in the client side I have defined the "enterContestGroup" mothed. However the fact is it doesn't call that mothed. Can anybody tell me what the error is?
Thank you for any help!
This is the server side code:
application.onAppStart = function()
{
application.user_so = SharedObject.get("user_so", false);
application.nextId = 0;
}
application.onConnect = function(newClient)
{
application.acceptConnection(newClient);
application.user_so.send("enterContestGroup");
}
This is the client side code:
var nc:NetConnection = new NetConnection();
var url:String = "rtmp://localhost:1935/testapp";
var user_so:SharedObject = new SharedObject();
nc.connect(url);
nc.onStatus = function(info)
{
if(info.code == "NetConnection.Connect.Success")
{
trace("success!");
}
else
{
trace(info.code)
}
}
user_so = SharedObject.getRemote("user_so", nc.uri, false);
user_so.connect(nc);
user_so.enterContestGroup = function(uid, uname, uimg, cid)
{
trace("do something about enterRoom")
}
