home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Corrida / drifting.swf / scripts / frame_137 / DoAction.as
Encoding:
Text File  |  2005-08-23  |  5.6 KB  |  175 lines

  1. _root.lights_mc._visible = true;
  2. _root.leagueGame = true;
  3. _root.currentDrift_str = "";
  4. var i = 1;
  5. while(i <= 3)
  6. {
  7.    game_mc["powerup" + i].gotoAndStop(1);
  8.    i++;
  9. }
  10. _root.game_mc.video_mc.gotoAndPlay("crowd");
  11. stopAllSounds();
  12. Stage.scaleMode = "noscale";
  13. _root.driftScoreMultiplier = 1;
  14. _root.DRIFT_SCORE_MULTIPLIER_INTERVAL = 15;
  15. _root.driftScoreMultiplier_str = "";
  16. _root.score = 0;
  17. _root.gateCount = 6;
  18. _root.lapCount = 1;
  19. _root.gameTicks = 0;
  20. _root.timerMinutes = 0;
  21. captureKeys = false;
  22. _root.startBonus = "";
  23. _root.readyToGo = true;
  24. _root.raceStarted = false;
  25. if(!_root.spaceToStart)
  26. {
  27.    _root.lights_mc.gotoAndPlay(2);
  28. }
  29. _root.donutChallenge = false;
  30. game_mc.car.MULTIPLIER_TIMEOUT = 15;
  31. _root.ghostPlayback = false;
  32. game_mc.car._x = game_mc.car.startX;
  33. game_mc.car._y = game_mc.car.startY;
  34. if(game_mc.car.currentSkidmarkDepth > 0)
  35. {
  36.    var i = 1;
  37.    while(i <= game_mc.car.currentSkidmarkDepth)
  38.    {
  39.       eval("game_mc.tracks" + i).removeMovieClip();
  40.       i++;
  41.    }
  42. }
  43. new mx.transitions.Tween(_root.garageButton_mc,"_alpha",easeType,_root.garageButton_mc._alpha,100,20);
  44. new mx.transitions.Tween(_root.donutButton_mc,"_alpha",easeType,_root.donutButton_mc._alpha,100,20);
  45. _root.leagueInterface_mc._visible = true;
  46. _root.lights_mc._visible = true;
  47. game_mc.gate1_mc.gotoAndStop(1);
  48. game_mc.gate2_mc.gotoAndStop(1);
  49. game_mc.gate3_mc.gotoAndStop(1);
  50. game_mc.gate4_mc.gotoAndStop(1);
  51. game_mc.gate5_mc.gotoAndStop(1);
  52. clockOn = false;
  53. _root.timerMinutes = 0;
  54. _root.timerSeconds = 0;
  55. _root.timerTicks = 0;
  56. _root.timerSeconds_str = "00";
  57. _root.timerTicks_str = "000";
  58. _root.gameActive = false;
  59. _root.readyToGo = true;
  60. if(!_root.ghostPlayback)
  61. {
  62.    keyCapture_array = new Array();
  63. }
  64. removeMovieClip(game_mc.car);
  65. game_mc.originalCar.duplicateMovieClip("car",999999);
  66. game_mc.car._alpha = 100;
  67. game_mc.originalCar._alpha = 0;
  68. if(_root.selectedCar)
  69. {
  70.    game_mc.car.carNumber = _root.selectedCar;
  71. }
  72. game_mc.car.setCarStats(game_mc.car.carNumber);
  73. game_mc.car.gotoAndStop(game_mc.car.carNumber);
  74. game_mc.car.active = true;
  75. gameStartTime = getTimer();
  76. _root.ghostPlayback = false;
  77. keyPlayback_str = "0000000000000444444444455555444444444455554444466666666664444446666666666666666444466666444444444455555555555555444444555555555555555444445555555444444444666666444444666666666666666666664444444444446666666666444444444466664444444444444444445555555555444444444444446666644446666666644444666666444444444555555544444444555444444444666444446666666666666666666666444444444444555554444444444444445555555555555555554444444000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000undefined";
  78. keyPlayback_array = keyPlayback_str.split("");
  79. for(i in keyPlayback_array)
  80. {
  81.    if(keyPlayback_array[i] == "A")
  82.    {
  83.       keyPlayback_array[i] = 10;
  84.    }
  85.    else if(keyPlayback_array[i] == "B")
  86.    {
  87.       keyPlayback_array[i] = 11;
  88.    }
  89.    else if(keyPlayback_array[i] == "C")
  90.    {
  91.       keyPlayback_array[i] = 12;
  92.    }
  93.    else if(keyPlayback_array[i] == "D")
  94.    {
  95.       keyPlayback_array[i] = 13;
  96.    }
  97.    else if(keyPlayback_array[i] == "E")
  98.    {
  99.       keyPlayback_array[i] = 14;
  100.    }
  101.    else if(keyPlayback_array[i] == "F")
  102.    {
  103.       keyPlayback_array[i] = 15;
  104.    }
  105.    else
  106.    {
  107.       keyPlayback_array[i] = Number(keyPlayback_array[i]);
  108.    }
  109. }
  110. getLeagueInfo_lv = new LoadVars();
  111. getLeagueInfo_lv.onLoad = function(success)
  112. {
  113.    trace("got league information from server");
  114.    _root.leagueName = this.LeagueName;
  115.    _root.yourName = this.YourName;
  116.    _root.yourScore = Number(this.YourScore);
  117.    _root.player_array = new Array();
  118.    _root.player_array[0] = new Array();
  119.    _root.player_array[0].name = _root.yourName;
  120.    _root.player_array[0].score = _root.yourScore;
  121.    var _loc3_ = 1;
  122.    while(_loc3_ <= 15)
  123.    {
  124.       var _loc4_ = this["player" + _loc3_ + "Name"];
  125.       var _loc6_ = Number(this["player" + _loc3_ + "Score"]);
  126.       if(_loc4_ != undefined)
  127.       {
  128.          _root.player_array[_loc3_] = new Array();
  129.          _root.player_array[_loc3_].name = _loc4_;
  130.          _root.player_array[_loc3_].score = _loc6_;
  131.       }
  132.       _loc3_ = _loc3_ + 1;
  133.    }
  134.    _root.player_array.sortOn("score",18);
  135.    _loc3_ = 1;
  136.    while(_loc3_ <= 15)
  137.    {
  138.       var _loc5_ = _root.player_array[_loc3_ - 1].name;
  139.       if(_loc5_ != undefined)
  140.       {
  141.          _root["leagueTableNumber" + _loc3_] = _loc3_;
  142.          _root["leagueTableName" + _loc3_] = _root.player_array[_loc3_ - 1].name.toUpperCase();
  143.          _root["leagueTableScore" + _loc3_] = _root.player_array[_loc3_ - 1].score;
  144.       }
  145.       else
  146.       {
  147.          _root["leagueTableName" + _loc3_] = "";
  148.          _root["leagueTableNumber" + _loc3_] = "";
  149.          _root["leagueTableScore" + _loc3_] = "";
  150.       }
  151.       if(_root.player_array.length < 15)
  152.       {
  153.          leagueInterface_mc.add_player_button_mc.gotoAndStop(_root.player_array.length + 1);
  154.       }
  155.       else
  156.       {
  157.          leagueInterface_mc.add_player_button_mc.gotoAndStop(1);
  158.       }
  159.       if(_loc5_ == _root.yourName)
  160.       {
  161.          leagueInterface_mc["leagueTableName" + _loc3_ + "_txt"].textColor = "0xB3FF00";
  162.          leagueInterface_mc["leagueTableScore" + _loc3_ + "_txt"].textColor = "0xB3FF00";
  163.       }
  164.       else
  165.       {
  166.          leagueInterface_mc["leagueTableName" + _loc3_ + "_txt"].textColor = "0xFFFFFF";
  167.          leagueInterface_mc["leagueTableScore" + _loc3_ + "_txt"].textColor = "0xFFFFFF";
  168.       }
  169.       _loc3_ = _loc3_ + 1;
  170.    }
  171. };
  172. getLeagueInfo_lv.LID = id;
  173. var serverURL = _root.serverPath + "getLeagueInfo.cfm";
  174. getLeagueInfo_lv.sendAndLoad(serverURL,getLeagueInfo_lv,"post");
  175.