Shared Object not working.

  • panzhuli
  • Graduate
  • Graduate
  • panzhuli
  • Posts: 135
  • Loc: Cleveland

Post 3+ Months Ago

hey all. i have two different swfs. one sets a shared object and one is supposed to read it. it is always coming back as undefined.

writer:

Code: [ Select ]
var user = SharedObject.getLocal("userData");
var cookieValue=_root[mcAtTarget0]._name.charAt(10)+_root[mcAtTarget0]._name.charAt(11);
user.data.first=cookieValue;
user.flush();
  1. var user = SharedObject.getLocal("userData");
  2. var cookieValue=_root[mcAtTarget0]._name.charAt(10)+_root[mcAtTarget0]._name.charAt(11);
  3. user.data.first=cookieValue;
  4. user.flush();


reader:
Code: [ Select ]
user = SharedObject.getLocal("userData");

if (user.data.first == undefined){
    text_txt.text = "not here";
} else {
    text_txt.text = user.data.first;
}
  1. user = SharedObject.getLocal("userData");
  2. if (user.data.first == undefined){
  3.     text_txt.text = "not here";
  4. } else {
  5.     text_txt.text = user.data.first;
  6. }


what am i not getting? thanks!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

Are the SWF files in different directories or otherwise effected by the Flash Security Sandbox that's normally in place ?

You can try setting the second paramater of getLocal to the root of the domain if you're not worried about naming conflicts.
Code: [ Select ]
SharedObject.getLocal("userData", "/");


If it's possible to have two shared objects with the same name in different directories you'll want to research that second paramater & refine the path to better fit your needs.
  • panzhuli
  • Graduate
  • Graduate
  • panzhuli
  • Posts: 135
  • Loc: Cleveland

Post 3+ Months Ago

the swf files are local on my machine and in the same directory, therefore I don't think they are affected by the security issue. Is there a problem with running these locally?
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

Shouldn't be.

What versions are you using ?
What else do you have going on ?
Does it work via HTTP ?
  • panzhuli
  • Graduate
  • Graduate
  • panzhuli
  • Posts: 135
  • Loc: Cleveland

Post 3+ Months Ago

I'm authoring in Flash CS3, publishing w/ as2. I don't know if it works via HTTP b/c it will have to work locally. the SO variables are being set inside a function - Do I have to use _root.user?

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 15 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.