home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Classicos / smashout.swf / scripts / __Packages / Game / ModalDialogs / PongGameOver.as next >
Encoding:
Text File  |  2005-11-09  |  1.0 KB  |  42 lines

  1. class Game.ModalDialogs.PongGameOver extends Game.PongModal
  2. {
  3.    var score_txt;
  4.    var base_mc;
  5.    var submit_btn;
  6.    var __score;
  7.    var dispatchEvent;
  8.    var screenName = "gameover";
  9.    var __emptyScore = "";
  10.    function PongGameOver()
  11.    {
  12.       super();
  13.       this.score_txt = this.base_mc.score_mc.score_txt;
  14.       this.submit_btn = this.base_mc.submit_btn;
  15.       var controller = this;
  16.       this.submit_btn.onRelease = function()
  17.       {
  18.          controller.submitScore();
  19.       };
  20.    }
  21.    function set score(myScore)
  22.    {
  23.       if(myScore == undefined)
  24.       {
  25.          myScore = 0;
  26.       }
  27.       this.__score = myScore;
  28.       var _loc2_ = String(this.__score);
  29.       var _loc3_ = this.__emptyScore.length - _loc2_.length;
  30.       _loc2_ = this.__emptyScore.substr(0,_loc3_) + this.score;
  31.       this.score_txt.text = _loc2_;
  32.    }
  33.    function get score()
  34.    {
  35.       return this.__score;
  36.    }
  37.    function submitScore()
  38.    {
  39.       this.dispatchEvent({type:"onSubmitScore",score:this.score});
  40.    }
  41. }
  42.