# Array (Highscore) into Shared Object

**URL:** <https://forum.kirupa.com/t/array-highscore-into-shared-object/273408>\
**Category:** flash\
**Created:** [October 15, 2008, 8:19am UTC](https://forum.kirupa.com/t/array-highscore-into-shared-object/273408 "2008-10-15T08:19:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![busmakaronen](https://avatars.discourse-cdn.com/v4/letter/b/3da27b/32.png) [@busmakaronen](https://forum.kirupa.com/u/busmakaronen)\
**Post date:** [October 15, 2008, 8:19am UTC](https://forum.kirupa.com/t/array-highscore-into-shared-object/273408/1 "2008-10-15T08:19:27Z")

</div>

Hey, I have a problem.  
We are designing a game for an exhibition and we’re having problems saving data. We want to have a highscore that saves name and score in to an Shared Object.  
I can now save and load the name and the score to the Shared Object, but when I start a new game the old data is erased. How should I do to be able to save it like this in the Shared Object:  
name1 score1  
name2 score2  
?

This is what I got so far (just to save and load the Shared Object):

```auto
//in the top of the document
var so:SharedObject = SharedObject.getLocal("userHighScore");
//so.data.highScore = 0; // För att resetta Shared Object
//so.flush();
if (so.data.highScore != null){
	highscorenr.text = so.data.highScore;
	highscorename.text = so.data.highScoreName;
}

//when the game is done
var so:SharedObject = SharedObject.getLocal("userHighScore");
	so.data.highScore = scorenr;
	so.data.highScoreName = highscorename.text;
	so.flush();
	highscorenr.text = so.data.highScore;
	highscorename.text = so.data.highScoreName;

```

If you post any code, please comment it so that I can fully understand it.  
Thanks
