Skip to main content
Participating Frequently
December 19, 2011
Question

Connect and sync to remote shared object works in Authoring, but not in browser

  • December 19, 2011
  • 1 reply
  • 634 views

Hi. I'm having trouble connecting to a remote persistent shared object.

When I run from the Flash authoring environment it works. But when I run it from a browser it doesn't.

The code attaches an event listener to the sync event, and then calls so.connect(nc).

 

As mentioned - it works inside Flash authoring only.

In both cases the connection to the server is successful.

Is this a security issue?

I also tried setting client.readAccess to "/" in the application.onConnect function of the server-side code - but it doesn't help.

 

What can cause this? 

(Everything was written by me including the server-side application code. I have full control and access to the server).

Also, I can see the remote object exists on the server in the admin console.

And as mentioned, when running inside Flash CS5 - the onsync gets triggered after connecting to the shared object.

But, the same code under a browser - doesn't trigger the onsync.

The SharedObject.getRemote method on the client side returns an object on both occasions.

I will appreciate any ideas...



Thanks.

This topic has been closed for replies.

1 reply

Yuvali25Author
Participating Frequently
December 19, 2011

I tried to put the 'so.connect' line on the client in setTimeout. I put a 10 seconds delay, and... what do you know - it worked...

This means that the so.connect on the client is run before the "client.readAccess = "/";" line in the onConnect in the server side...

uuf, so much time I spent on this...

UPDATE:

so, regardless of the "readAccess" line on the server - it works if I also omit it (as the default is a read access of "/" anyway) -

it only works if I set a delay on the "so.connect" call. I tried a delay of 1 second and it works - but if there isn't a delay it doesn't.

So, now, does anybody know what can cause this delay to happen? Maybe one of the settings in the configuration XMLs in the server?