0

I'm using the method described in the link (http://www.nuff-respec.com/technology/cross-browser-cookies-with-flash) to implement a crossbrowser tracking with flash. Everything is working fine when all pieces are together in the same server, but for deploy, i really need to add the swf from our central server, to another different one. Just to simplify this is my html in domain2.com:

<html>  
  <head>
    <script src="http://dom1/control_cookie.js" type="application/javascript"></script>
    <script type="text/javascript">
      function flash_ready() {
        alert('begin!');
        CB_Cookie.init('CBCookie');
        CB_Cookie.set('cookie_name','value');
        alert(CB_Cookie.get('cookie_name'));
      };
    </script>
  </head>

  <body>
    <object id="CBCookie">
      <param name="allowScriptAccess" value="always" />
      <param name="movie" value="http://dom1/CB_Cookie.swf" />
      <embed src="http://dom1/CB_Cookie.swf" name="CBCookie" allowScriptAccess="always" type="application/x-shockwave-flash"/>
    </object>
  </body>
</html>

function flash_ready is called from the swf itself, so, seems to be added correctly, because I can see the first alert. However, It stops execution of the function in CB_Cookie.init('CBCookie');

I also have a crossdomain.xml in the dom1 root, but it's no working anyhow...

Any ideas or known alternatives to do this between domains? Thank you in advance!

Javi Prieto
  • 429
  • 3
  • 14
  • Are you sure cookie.js is loaded? This is bad practice you should validate both pieces are loaded before you try to access the functions – The_asMan Mar 21 '11 at 18:02

1 Answers1

0

Duplicated. Sorry I didn't find it before.

Are Cross Domain Flash Local Shared Objects (LSO aka Flash Cookie) possible (stackoverflow)

And the solution is in the link below:

http://magp.ie/2010/10/15/javascript-library-to-manage-flash-local-stored-objects/

Community
  • 1
  • 1
Javi Prieto
  • 429
  • 3
  • 14