Skip to main content
Inspiring
May 7, 2009
Question

SharedObject Weirdness

  • May 7, 2009
  • 1 reply
  • 2243 views

http://www.mediafire.com/?sharekey=116783e57f76915e5a3d773badf2143048de05749e8bfd995621d66e282a0ee8

The above file is a shared object test that was working for a while, and then, it stopped.

It contains 3 fields, which write to the .sol when you TAB out of the fields.  Two buttons, one to clear the fields, and the other to reload the fields from the .sol.

From the trace messages, I surmised that it had stopped writing the .sol file.

I searched and found that this was indeed the case.  No .sol file was being written, even though there were old ones with other names in the folder (down in Documents and Settings somewhere.)

I tried deleting the old .sol files, changing the code to write to a file called "Gtest" instead of "test" 

Now, I can't getthe .fla file to write a new .sol file at all.  I must have pissed it off!  (excuse my personification.)

The question is, what would cause the sharedobject to stop working?  Is there some limiter kicking in?

I realize I'm going to have to use eval() to pass the param variable correctly. That's what I was working on when the shared object stopped doing its thing...

:<)McFrisco

This topic has been closed for replies.

1 reply

McFriscoAuthor
Inspiring
May 7, 2009

http://www.mediafire.com/?yknzuxegwkh

The fun never ends here with McFrisco and those friskly little sharedObjects.  I made this simpler example.  Thought I'd cracked the case!  It worked 2 or three times, but then, after  flushing, clearing, and reloading the sharedObject about 3 times, successfully, with the data changing as expected, it STOPPED WORKING, and now, won't change the text.sol file at all.  It maintains the original data.

Something strange here, folks.  Anybody care to take a look and tell me what's going on?

kglad
Community Expert
Community Expert
May 8, 2009

the first error i encountered was:

cSaved.data.changedField._name = changedField.text;

which should be:

cSaved.data[changedField._name] = changedField.text;

McFriscoAuthor
Inspiring
May 8, 2009

Finally, got all the kinks out and have a working SharedObject Example, thanks to kglad.

http://www.mediafire.com/?uytnzzyn4md

It traces every step, and also has an onscreen field to view, clear and reload data from the shared object.

What made it work, finally, was to make sure that the SharedObject object was active when I sent data to it.  It doesn't seem to persist as one would expect it too.

If one of our gurus care to weigh in on the why of this, I'd appreciate it.

Thanks!