Tony
Tony

Reputation:

Flash AS3 - Can I prevent my shared object from saving on the .swf close?

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?

Upvotes: 0

Views: 1145

Answers (2)

back2dos
back2dos

Reputation: 15623

no, you cannot prevent flash from saving shared objects ...

also, i think, you should not use shared objects to maintain your applications state, unless you want to use that exact effect ...

when you read that object, copy it, and on save, write the copy into the original ...

greetz

back2dos

Upvotes: 0

George Phillips
George Phillips

Reputation: 4654

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.

Upvotes: 1

Related Questions