SharedObject Send method (remote method invocation)

View: New views
1 Messages — Rating Filter:   Alert me  

SharedObject Send method (remote method invocation)

by NullString :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm having an issue: I want to use the "send" method of SharedObject to broadcast some data (a string). I connect the as3 client to the server, in this case is SOSample. Everything works as expected, I can use setProperty and everything works great, except when I want to set the function to call when a "send" occurs, like the function "newMessage" here: so.send("newMessage",string_to_send); to assign newMessage to the sharedObject, I've tried the following: ---> so.messageHandler=newMessageHandler; so.connect(nc); ---> that doesnt' compile, throws 1119: Access of possibly undefined property messageHandler through a reference with static type flash.net:SharedObject. FlexPaint2/src revampedConnection.as line 51 also testing with different ways to assign the function to call, gets me runtime errors: ---> so.setProperty("sharedArray", arr); --or-- so.data["nmh"]=newMessageHandler; --> Throws Error #2044: Uncontrolled AsyncErrorEvent: text=Error #2095: flash.net.SharedObject couldn't invoke callback function newMessage. error=ReferenceError: Error #1069: Couldn't find property newMessage in flash.net.SharedObject and there is no default value. Am I doing something wrong? do I need a special Red5 application running for this feature of sharedObjects? Thanks in advance. Running red5 0.8, SOSample r2967