home *** CD-ROM | disk | FTP | other *** search
- score = totalscore;
- stop();
- showScores = function()
- {
- var i = 10;
- while(i > 0)
- {
- var n = scoreboard_lv["name" + (page + i)];
- var s = scoreboard_lv["score" + (page + i)];
- var l_mc = this["line" + i + "_mc"];
- l_mc.rank_txt.text = page + i + ".";
- l_mc.name_txt.text = !n.length ? "-" : n.toUpperCase();
- l_mc.score_txt.text = s;
- l_mc.rank_txt.textColor = l_mc.name_txt.textColor = l_mc.score_txt.textColor = !(playerName.length && n.toUpperCase() == playerName.toUpperCase()) ? 16777215 : 3407616;
- l_mc._visible = true;
- loading_mc._visible = false;
- i--;
- }
- };
- page = 0;
- maxScore = 100;
- scoreboard_lv = new LoadVars();
- if(score > 0 && playerName.length > 0)
- {
- scoreboard_lv.score = score;
- scoreboard_lv.name = playerName.toLowerCase();
- }
- scoreboard_lv.game = "sheepteroids";
- scoreboard_lv.sendAndLoad("http://www.kwikgames.com/cgi/games_score_sql.php",scoreboard_lv,"POST");
- scoreboard_lv.onLoad = function(success)
- {
- if(success)
- {
- if(Boolean(scoreboard_lv.success))
- {
- next_btn._visible = true;
- if(scoreboard_lv.maxScore.length > 0)
- {
- maxScore = Number(scoreboard_lv.maxScore);
- }
- showScores();
- }
- else
- {
- loading_mc.errorMsg = scoreboard_lv.errorMsg.toUpperCase();
- loading_mc.gotoAndStop(2);
- }
- }
- else
- {
- loading_mc.errorMsg = "COULD NOT ACCESS SCORES.";
- loading_mc.gotoAndStop(2);
- }
- };
- score = 0;
- next_btn._visible = last_btn._visible = false;
- last_btn.onPress = function()
- {
- page -= 10;
- if(page < 0)
- {
- page = 0;
- }
- if(page < 10)
- {
- last_btn._visible = false;
- }
- next_btn._visible = true;
- showScores();
- };
- next_btn.onPress = function()
- {
- page += 10;
- if(page > maxScore)
- {
- page = maxScore;
- }
- if(page > maxScore - 20)
- {
- next_btn._visible = false;
- }
- last_btn._visible = true;
- showScores();
- };
-