I have an swf that will be used on two different domains. It has to behave the same way on both domains, and the variables that get stored on one domain must be accessible on the other. It’s a shop with a cart system. The visitor puts things in the cart, goes to the other domain and continues shopping. Items added to the cart in the other shop should still be in the cart.
Like this or how should I do that?
i dun think the allowdomain has to do with sharedobject i dun think swf on domain1 can read sharedobject on domain 2.
can’t be done.
There is no way to read shared objects from one domain on the other.
Any workaround? I read an article that was using loadmovie – a 3rd swf as a helper.
localconnection MIGHT help… not sure
EDIT : Something like this… http://active.tutsplus.com/tutorials/actionscript/interface-between-two-files-using-the-localconnection-class/
There might be a workaround using this… good luck
They are physically on the same server.. Maybe with database and sessions with php? Or that’s an overkill?
Try this post it explains further what you have to do.
Hi Firsh, If they are in the same domain you can try passing a path to shared object :
sol = SharedObject.getLocal("name","/");
when you use the ”/” as the path, it gets stored at root and then other swf from same domain can use it. Don’t know will it work with different domains.
I have succuessfully used it once.
This is it, but I still got some problems. It was working for some time then everything went wrong.. I have 3 domains: 2 domains as clients and one domain as server. It’s logical, loading an SWF from the server that handles all sharedobject stuff. I have crossdomain.xml’s with a * on every domain
<cross-domain-policy> <allow-access-from domain="*" /> </cross-domain-policy>
and in every SWF
I know it’s not secure like this, but I want it to see it working first then I can tighten security..
It uses the server swf very well if I just test it locally but once they are on the domains it doesn’t work..
- Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
- Open a support ticket if you would like specific help with your account, deposits or purchases.
- Item Support by authors is optional and may vary. Please see the Support tab on each item page.
Most of all, enjoy your time here. Thank you for being a valued Envato community member.