# sharedObject.send with as3

**URL:** https://community.wowza.com/t/sharedobject-send-with-as3/159
**Category:** Wowza Streaming Engine
**Created:** [January 6, 2011, 3:06pm UTC](https://community.wowza.com/t/sharedobject-send-with-as3/159 "2011-01-06T15:06:54Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/system/32/447_2.png) [@system](https://community.wowza.com/u/system)
#### Post date: [January 6, 2011, 3:06pm UTC](https://community.wowza.com/t/sharedobject-send-with-as3/159/1 "2011-01-06T15:06:54Z")

</div>

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.😕

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [January 6, 2011, 8:52pm UTC](https://community.wowza.com/t/sharedobject-send-with-as3/159/2 "2011-01-06T20:52:34Z")

</div>

What do you want to do?

Richard

---

<div class="post-metadata">

### Author: ![alan\_costello](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@alan\_costello](https://community.wowza.com/u/alan_costello)
#### Post date: [January 8, 2011, 3:35pm UTC](https://community.wowza.com/t/sharedobject-send-with-as3/159/3 "2011-01-08T15:35:11Z")

</div>

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)

---

<div class="post-metadata">

### Author: ![alan\_costello](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@alan\_costello](https://community.wowza.com/u/alan_costello)
#### Post date: [January 11, 2011, 12:51pm UTC](https://community.wowza.com/t/sharedobject-send-with-as3/159/4 "2011-01-11T12:51:10Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![alan\_costello](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@alan\_costello](https://community.wowza.com/u/alan_costello)
#### Post date: [January 14, 2011, 2:15pm UTC](https://community.wowza.com/t/sharedobject-send-with-as3/159/5 "2011-01-14T14:15:26Z")

</div>

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”);

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [January 11, 2011, 3:01pm UTC](https://community.wowza.com/t/sharedobject-send-with-as3/159/6 "2011-01-11T15:01:57Z")

</div>

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:

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

```

Listener client

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

```

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

Richard
