Skip to main content
Inspiring
Feb 11, 2014 5:53 AM UTC
Question

sharedObject not saving for iOS

Is anyone else having troubles using sharedObjects ?

It works properly when I compile frome the IDE. Doesnt work on device. 

Any help here would be appreciated.

This topic is closed to new replies. Start a new post to keep the conversation going.

30 replies

Known Participant
Feb 11, 2014 8:35 AM UTC

I'm not having the problem. You should post your code.

Translate
Applauz78Author
Inspiring
Feb 11, 2014 1:08 PM UTC

Here is my code

var so:SharedObject = SharedObject.getLocal("HighScoreData");

     so.data.highscore;

     loadScore();

     // SHARED OBJECT

     function saveScore():void

  {

      // Get the shared object.

      var so:SharedObject = SharedObject.getLocal("HighScoreData");

      

     so.data.highscore;

     

      // Update the score variable.

 

        if(theScore > so.data.highscore){

      so.data.highscore = theScore;

      theHighScore = so.data.highscore;

      }

     

      results_mc.best.text = so.data.highscore;

     

      // And flush our changes.

      so.flush();

     

      // Also, indicate the value for debugging.

      trace("Highest Score saved: " + so.data.highscore);

  }

function loadScore():void

  {

      // Get the shared object.

       var so:SharedObject = SharedObject.getLocal("HighScoreData");

       so.data.highscore;

     

      if (so.data.highscore == undefined) {

          so.data.highscore = 0;

      }

     

      //so.data.highscore = so.data.highscore;

     

      theHighScore = so.data.highscore;

      results_mc.best.text = theHighScore;

      // And indicate the value for debugging.

      trace("Loaded highscore loaded: " + so.data.highscore);

  }

Translate
Known Participant
Feb 11, 2014 1:15 PM UTC