Skip to main content
Participant
February 8, 2011
Question

Remote SharedObject writeAccess question

  • February 8, 2011
  • 1 reply
  • 1032 views

Hello!

I'm trying to create a FMS application that is broadcasting some data across connected clients using SharedObject.

I want only the Application to be granted to set SharedObject properties.

In application.onConect I do the following:

application.onConnect = function() {

     //Grant read access to streams and shared objects

     client.readAccess = this.streamPath + ";" + this.soPath;

     //Restrict write access

     client.writeAccess = "";

}

When connecting the shared object from client SWF the SYNC event never gets fired in client and FMS log shows:

Write access denied for shared object data/playlist

So I guess the whole "connect" procedure is not working properly.

Is there any way to manage the "one way" server to client updates with shared object or I miss the concept of using it?

I'm using FMS 4 (dev. edition)

Thank you!

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    February 8, 2011

    You application.onConnect code looks incomplete - have you just pasted few lines or whole code inside application.onConnect. If its whole code - then you must remember to put "return true" or application.acceptConnection(client) - where client is argument in application.onConnection function

    Participant
    February 8, 2011

    Hello SE_0208!

    The code I've posted is indeed an abstract - so the "return true" is "somewhere out there" :O)

    By the way, I forgot to mention that

    this.soPath = "data/"


    If I set

    client.writeAccess = "/"

    sync works.

    February 9, 2011

    Hi,

    You said that the sync works when you set writeaccess to "/", but does it work when you set writeaccess to 'data' (I think it should). As in your first code the snippet you had set writeaccess to "", which means client cannot write to shared object. Is there any specific reason you want, client to not to write anything to shared object. As such the purpose of shared obect is when you make changes on one client it should be reflected to all. Also can you post some client code as to how you are connecting to shared object

    Thanks,

    Abhishek