home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Esportes / CrossingCup.swf / scripts / __Packages / CNewGameScreen.as < prev    next >
Text File  |  2007-12-11  |  2KB  |  64 lines

  1. class CNewGameScreen extends CScreen
  2. {
  3.    function CNewGameScreen()
  4.    {
  5.       super();
  6.       if(_global.AppStarted == undefined)
  7.       {
  8.          return undefined;
  9.       }
  10.       this.ctr = 0;
  11.       this.onEnterFrame = function()
  12.       {
  13.          if(this.ctr > 1)
  14.          {
  15.             this.onEnterFrame = null;
  16.             this.CreateList();
  17.             _global.__DISPATCH({type:"changeTeam",id:1});
  18.          }
  19.          this.ctr = this.ctr + 1;
  20.       };
  21.       EventCenter.access().addEventListener("teamChanged",this);
  22.       _global.__DISPATCH({type:"changeTeam",id:1});
  23.    }
  24.    function teamChanged(event)
  25.    {
  26.       var _loc2_ = CTeamManager.ins().currentTeam;
  27.       this.txTeamName.text = _loc2_.teamname;
  28.       this.myflag.toid = _loc2_.flagid;
  29.       this.myflag.setFlag(_loc2_.flagid);
  30.       this.txCornerKicker.text = _loc2_.cornerkicker;
  31.       this.txKicker.text = _loc2_.kicker;
  32.       this.txGoalie.text = _loc2_.goalie;
  33.       this.mcUniform1.shirt.gotoAndStop(_loc2_.shirtcolor1);
  34.       this.mcUniform1.pants.gotoAndStop(_loc2_.pantscolor1);
  35.       this.mcUniform2.shirt.gotoAndStop(_loc2_.shirtcolor2);
  36.       this.mcUniform2.pants.gotoAndStop(_loc2_.pantscolor2);
  37.       SoundManager.ins().playMouseover();
  38.    }
  39.    function selectTeam()
  40.    {
  41.       CTournament.ins().newTournament();
  42.       _global.__DISPATCH({type:"endScreen",name:this._name});
  43.    }
  44.    function CreateList()
  45.    {
  46.       CTeamManager.ins().randomTeam();
  47.       var _loc6_ = CTeamManager.ins().teams;
  48.       var _loc5_ = 0;
  49.       while(_loc5_ < _loc6_.length)
  50.       {
  51.          var _loc4_ = CTeam(_loc6_[_loc5_]);
  52.          var _loc3_ = this.ListTeam.addThumb({identifier:"ItemList",height:25});
  53.          _loc3_.id = _loc4_.id;
  54.          _loc3_.txJudul.text = _loc4_.teamname;
  55.          _loc3_.flag.toid = _loc4_.flagid;
  56.          _loc3_.onPress = function()
  57.          {
  58.             _global.__DISPATCH({type:"changeTeam",id:this.id});
  59.          };
  60.          _loc5_ = _loc5_ + 1;
  61.       }
  62.    }
  63. }
  64.