ThemeForest

Shared Object cross domain AS2

1495 posts
  • Sold between 50 000 and 100 000 dollars
  • Helped protect Envato Marketplaces against copyright violations
  • Microlancer Beta Tester
  • Exclusive Author
  • Has been a member for 3-4 years
  • Europe
  • Referred between 10 and 49 users
  • Bought between 50 and 99 items
Firsh says

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.

System.security.allowDomain("domain1.com");
System.security.allowDomain("domain2.com");

Like this or how should I do that?

270 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • Sold between 100 and 1 000 dollars
magickaito says

i dun think the allowdomain has to do with sharedobject i dun think swf on domain1 can read sharedobject on domain 2.

1518 posts
  • Bought between 1 and 9 items
  • Europe
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 100 and 199 users
  • Sold between 50 000 and 100 000 dollars
dSKY says

can’t be done.
There is no way to read shared objects from one domain on the other.

1495 posts
  • Sold between 50 000 and 100 000 dollars
  • Helped protect Envato Marketplaces against copyright violations
  • Microlancer Beta Tester
  • Exclusive Author
  • Has been a member for 3-4 years
  • Europe
  • Referred between 10 and 49 users
  • Bought between 50 and 99 items
Firsh says

Any workaround? I read an article that was using loadmovie – a 3rd swf as a helper.

CreativeAddiction
CreativeAddiction Recent Posts
Threads Started
160 posts
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Europe
  • Exclusive Author
  • Has been a member for 2-3 years
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
CreativeAddiction says

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

1495 posts
  • Sold between 50 000 and 100 000 dollars
  • Helped protect Envato Marketplaces against copyright violations
  • Microlancer Beta Tester
  • Exclusive Author
  • Has been a member for 3-4 years
  • Europe
  • Referred between 10 and 49 users
  • Bought between 50 and 99 items
Firsh says

They are physically on the same server.. Maybe with database and sessions with php? Or that’s an overkill? :D

1571 posts
  • Beta Tester
  • Bought between 50 and 99 items
  • Canada
  • Exclusive Author
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 5 000 and 10 000 dollars
mafloral says

Hey Firsh

Try this post it explains further what you have to do.

http://forums.devshed.com/flash-help-38/help-system-security-allowdomain-any-domain-289646.html

Cheers

Lester

571 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 1 and 9 users
  • Singapore
  • Sold between 10 000 and 50 000 dollars
  • Won a Competition
dexterous says

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.

regards.

1495 posts
  • Sold between 50 000 and 100 000 dollars
  • Helped protect Envato Marketplaces against copyright violations
  • Microlancer Beta Tester
  • Exclusive Author
  • Has been a member for 3-4 years
  • Europe
  • Referred between 10 and 49 users
  • Bought between 50 and 99 items
Firsh says

http://danielmclaren.net/2007/03/22/cross-domain-shared-objects-in-flash

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

System.security.allowDomain("*");

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..

1495 posts
  • Sold between 50 000 and 100 000 dollars
  • Helped protect Envato Marketplaces against copyright violations
  • Microlancer Beta Tester
  • Exclusive Author
  • Has been a member for 3-4 years
  • Europe
  • Referred between 10 and 49 users
  • Bought between 50 and 99 items
Firsh says

It’s working now, thanks everybody. Seems like it wasn’t so impossible after all :P

by
by
by
by
by