Wowza Community

sharedObject.send with as3

Here is the Adobe example for using so.send() with a non-permanent SO-

var so = SharedObject.getRemote(“foo”, nc.uri, false); so.connect(nc);

so.doSomething = function(str) {

// Process the str object.

};

Adobe also give this code:

var so = SharedObject.get(“foo”, true);

so.send(“doSomething”, “This is a test”);

The above doesn’t have the nc.uri or say “Remote” after the “get”, so I guess it is on the server. As it would be in actionscript, can you direct me where the server-side script for wowza is to use the so.send() command?

However, I am sure the SO.doSomething(whatever) will still give the error “undefined property doSomething”.

Also, as it is a non-permanent SO and can have any name, how would the server be able to know to attach the client-function’s name to it.

I am confused.:confused:

What do you want to do?

Richard

Use the sharedObject.send() instruction for my chat (I have been using sharedObject.setProperty for a year now, but this will save me a using a special shared object just to send messages on chat. I can just use an existing shared object with the SO.send() instruction)

OK - perhaps not clear (I had the 'flu coming on then) -

Question: Is there any additional server-side code needed to use the sharedObject.send() instruction to/from temporary remote shared objects? Everything else works with the shared objects, but I am having difficulty with this particular function.

Thanks Richard, so it is just my coding.

I eventually got a call-back function attached to my shared object in actionscript 3 - that was my problem - here is how I did it:

var someClient:Object = {};

someClient.chatMsg=showMessage

mySo=SharedObject.getRemote(“myNonPermanentSo”,nc.uri);

mySo.client=someClient

private function showMessage(myStr:String):void{

//show message

}

mySo.send(“chatMsg”, “someDataToo”);

No, I don’t think so. No server-side required, it is all client-side. To listen, a client needs to attach a function to the shared object.

Sender client:

someSharedObject.send("someCallBack", "someDataToo");

Listener client

someSharedObject.someCallBack = function(data:String):void
{
trace(data)
};

http://livedocs.adobe.com/flashmediaserver/3.0/hpdocs/help.html?content=00000208.html

Richard