views:

745

answers:

2

I am not to add method to a remote shared object in AS3. In AS2 this code used to work

SharedObjectName.MethodName = function(){}

But this code is not working for AS3. I searched in Google and other AS3 forums but didn't get any help.

can anyone provide a pointer to me please.

Thanks, Sumit

+1  A: 

SharedObject is not a dynamic class, which means you can't add properties to it à la JavaScript (apparently, objects in AS2 behave the same way, but I never used AS2, so I can't tell). Depending on what you're trying to do, you might want to subclass SharedObject or create a wrapper class.

Simon
A: 

Ok I finally solved it somehow,

this is what i did

class abc { public function MessageFromServer() {

}

SharedObject.client= this; } this allows the FMS server to control this client's public methods, Which I Wanted.

IN FMS I can call this as -

SharedObject.call("MessageFromServer")

Sumit Ghosh