Skip to main content
Participant
February 22, 2008
Question

FMS3 AS2 to AS3 SharedObject Problem

  • February 22, 2008
  • 1 reply
  • 952 views
Hello. I'm migrating a flash application writen with AS2 and working fine to AS3. The flash connects to a Flash Media Server 3 but I don't think it was the problem. I'm in a problem that I can't resolve and I don't get more information about it.

The code I want to migrate writen is:
server-side:
application.users_so.send("msgFromServer", "messageTXT");

client-side ( AS2):
users_so=SharedObject.getRemote("users_so",connection.uri,false);
users_so.connect(connection);
users.so.msgFromServer = function (msg) { trace(msg);};

But... how can I do that with AS3?

That line users.so.msgFromServer = function (msg) { trace(msg);}; works perfectly using AS2 but no with AS3. I get the run-time error #2095 was unable to invoke callback. I can't find information about resolve this with AS3 code.

Please, can anyone help me?.
Thansk!

    This topic has been closed for replies.

    1 reply

    Participant
    February 22, 2008
    hi FranMalaga, please try the below for AS3:

    users_so=SharedObject.getRemote("users_so",connection.uri,false);
    users_so.connect(connection);
    users_so.client=this; // added code

    your "users.so.msgFromServer" should be "users_so.msgFromServer", a typo I think.
    Participant
    February 25, 2008
    Thanks YimTszLing. It works!!! The result code was:

    function connectStream() {
    remoteUsers = SharedObject.getRemote("users_so",connection.uri,false);
    remoteUsers.connect(connection);
    remoteUsers.client=this;
    }

    function msgFromSrvr (msg:String)
    {
    trace(msg);
    }

    Thanks a lot!
    February 26, 2008
    Hey please paste here full code .....i m also in same problem ..:(