R – Flash AS3 – Can I prevent the shared object from saving on the .swf close

actionscript-3flashflushoverridingshared-objects

I have a program with a save feature – the user clicks a button, and everything is saved to a local Shared Object with the flush(); command.

My problem is that Flash .swf files automatically save to the local Shared Object when the movie is closed, overwriting their previous, manual save.

Is there anyway to prevent flash from saving to the shared object as the movie closes?

Best Answer

Here's something that could solve your problem but not answer your question. Take the properties of your shared object and duplicate them. If you have "foo", "bar" and "baz" then create "saveFoo", "saveBar" and "saveBaz".

When the movie starts, copy the "save" versions into the run-time variants. "foo = saveFoo; bar = saveBar;" and so on.

To save, copy the run-time versions into the "save" variants and flush.

Now the auto-save at the end won't change anything as the "save" variants are the only ones that really matter.

Season to taste.

Related Topic