Highlighted

Shared Object Problem saving some data but not others

Engaged ,
Aug 01, 2017

Copy link to clipboard

Copied

I have a button that is being used to turn the sound on and off. There is a StatsMain class that is used to establish the shared object and the variables. I also have a Settings class that displays the button on/off. The problem I'm having is that the shared object is not remembering the status of the on/off buttons. I'm stumped because I'm using the same process for my game stats (total points, level number, etc.), which works, the only difference is that my game stats are integers and not Booleans.

I tested to see what is inside the shared object using:
for (var prop in gameSharedObject.data)
  {
  trace(prop+" : " +gameSharedObject.data[prop]);
  }
And these are the results. It's saving to the shared object when it is flushed but when I close and open the app the data is not saved.

sharedObject.jpg

The code is on Gist:Shared Object Problem · GitHub

How can I fix this?

TOPICS
Development

Views

175

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Shared Object Problem saving some data but not others

Engaged ,
Aug 01, 2017

Copy link to clipboard

Copied

I have a button that is being used to turn the sound on and off. There is a StatsMain class that is used to establish the shared object and the variables. I also have a Settings class that displays the button on/off. The problem I'm having is that the shared object is not remembering the status of the on/off buttons. I'm stumped because I'm using the same process for my game stats (total points, level number, etc.), which works, the only difference is that my game stats are integers and not Booleans.

I tested to see what is inside the shared object using:
for (var prop in gameSharedObject.data)
  {
  trace(prop+" : " +gameSharedObject.data[prop]);
  }
And these are the results. It's saving to the shared object when it is flushed but when I close and open the app the data is not saved.

sharedObject.jpg

The code is on Gist:Shared Object Problem · GitHub

How can I fix this?

TOPICS
Development

Views

176

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 01, 2017 0

Have something to add?

Join the conversation