Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SharedOblect.send() with FMS3 and AS3.0

110 views
Skip to first unread message

a218150

unread,
Mar 28, 2008, 1:56:11 PM3/28/08
to
Now that AS3.0 client side script is more strongly typed, it appears you cannot
dynamically add a callback function as in the following example. I've tried
using a Responder in the client code and it didn't work. The code compiled and
ren but the callback wasn't invoked.

// Sever side...
var myShared = SharedObject.get("foo", true);
myShared.send("doSomething", "this is a test");

// Client side
connection = new NetConnection();
connection.connect("rtmp://www.macromedia.com/someApp");
var x = SharedObject.getRemote("foo", connection.uri, true);
x.connect(connection);
x.doSomething = function(str) {
// Process the str object.
};


a218150

unread,
Mar 28, 2008, 1:56:11 PM3/28/08
to

KevinStreeter

unread,
Mar 31, 2008, 4:12:23 PM3/31/08
to
The NetConnection event handling did have to change slightly in AS3 to better
deal with strong typing. The AS3 NetConnection object has a "client" property
that is treated as a DynamicObject, and therefore can have methods added to it
dynamically, like the AS2 NetConnection could. Use this object to add all your
dynamic handlers for things like shared objects and RPC calls.

con...@trait-tendance.com

unread,
Apr 8, 2008, 11:15:46 AM4/8/08
to
On 31 mar, 16:12, "KevinStreeter" <webforumsu...@macromedia.com>
wrote:

Thanks for this answer, but i have the same problem an no idea to
resolve it with client property
I try :


var x = SharedObject.getRemote("foo", connection.uri, true);

x.client=Test
function Test(p) {


// Process the str object.
};

but it doesn't work.
do you have more information about the process?

thw a lot

0 new messages