# AS3 Leaderboard/score system issue

**URL:** <https://forum.kirupa.com/t/as3-leaderboard-score-system-issue/306229>\
**Category:** Uncategorized\
**Created:** [March 11, 2010, 12:51pm UTC](https://forum.kirupa.com/t/as3-leaderboard-score-system-issue/306229 "2010-03-11T12:51:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![swiftmend](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@swiftmend](https://forum.kirupa.com/u/swiftmend)\
**Post date:** [March 11, 2010, 12:51pm UTC](https://forum.kirupa.com/t/as3-leaderboard-score-system-issue/306229/1 "2010-03-11T12:51:19Z")

</div>

Hi all, I’m having some issues getting my top 5 score board to work… it’s done in AS3 and is saved using a shardObject - the loading/saving aspect works 100%, but the actual scores are getting confused and overwriting each other, EG if you get the top score, it replaces both the 1. and 2. place… here’s my code - gameScore is working fine, I get the score from my game when it’s game over, etc

Anyone see an issue with my logic which is why it’s overwriting 2 places instead of moving the data down into each place under it? I have a feeling i’m overlooking something very simple!!!

function updateleaderboard():void {  
if (gamescore \>= top1) {  
top5 = top4;  
top4 = top3;  
top3 = top2;  
top2 = top1  
top1 = gamescore;

```
}
else if (gamescore &gt;= top2) {
	top5 = top4;
	top4 = top3;
	top3 = top2;
	top2 = gamescore;
}
else if (gamescore &gt;= top3) {
	top5 = top4;
	top4 = top3;
	top3 = gamescore;
}
else if (gamescore &gt;= top4) {
	top5 = top4;
	top4 = gamescore;
}
else if (gamescore &gt;= top5) {
	top5 = gamescore;
}

scoremenu.scoretop1.text = '' + top1;
scoremenu.scoretop2.text = '' + top2;
scoremenu.scoretop3.text = '' + top3;
scoremenu.scoretop4.text = '' + top4;
scoremenu.scoretop5.text = '' + top5;
savegame();

```

}

I want it to replace score 2 with score 1 before it replaces it with the current top score, etc to make the board seem more dynamic. (EG if you get top 1 position, all scores move down a rank)
