home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Aventura / tall-ships.swf / scripts / frame_3 / DoAction.as
Encoding:
Text File  |  2005-09-29  |  2.8 KB  |  138 lines

  1. function goToRaceStart()
  2. {
  3.    _global.shipClass = shipChoice;
  4.    _global.startSeconds = 60;
  5.    _global.startMilliseconds = 0;
  6.    _global.leg = "london";
  7.    _global.nextCity = "lisbon";
  8.    _global.nextDock = "lisbonDock_mc";
  9.    _global.shipRotation = 0;
  10.    gotoAndStop("start");
  11.    play();
  12. }
  13. function goToPracticeStart()
  14. {
  15.    gotoAndStop("slideShow0");
  16.    play();
  17.    _global.shipClass = shipChoice;
  18.    _global.shipRotation = 0;
  19. }
  20. stop();
  21. _quality = "HIGH";
  22. detailToggle_mc._visible = false;
  23. soundToggle_mc._visible = false;
  24. _global.city = new Array();
  25. _global.totalPoints = 0;
  26. nextPortArrow_mc.removeMovieClip();
  27. endA = 237;
  28. endB = 150;
  29. endC = 71;
  30. endY = endB;
  31. shipChoice = "B";
  32. arrowDown = false;
  33. openingSound.stop();
  34. slider_mc.onEnterFrame = function()
  35. {
  36.    if(_xmouse < 120 && _xmouse > 20)
  37.    {
  38.       if(_ymouse >= endC)
  39.       {
  40.          if(_ymouse < endC + 70)
  41.          {
  42.             endY = endC;
  43.             shipChoice = "C";
  44.          }
  45.          else if(_ymouse < endB + 70)
  46.          {
  47.             endY = endB;
  48.             shipChoice = "B";
  49.          }
  50.          else if(_ymouse < endA + 70)
  51.          {
  52.             endY = endA;
  53.             shipChoice = "A";
  54.          }
  55.       }
  56.    }
  57.    if(Key.isDown(49))
  58.    {
  59.       endY = endC;
  60.       shipChoice = "C";
  61.    }
  62.    else if(Key.isDown(50))
  63.    {
  64.       endY = endB;
  65.       shipChoice = "B";
  66.    }
  67.    else if(Key.isDown(51))
  68.    {
  69.       endY = endA;
  70.       shipChoice = "A";
  71.    }
  72.    if(Key.isDown(38) && !arrowDown)
  73.    {
  74.       arrowDown = true;
  75.       if(shipChoice == "A")
  76.       {
  77.          endY = endB;
  78.          shipChoice = "B";
  79.       }
  80.       else
  81.       {
  82.          endY = endC;
  83.          shipChoice = "C";
  84.       }
  85.    }
  86.    else if(Key.isDown(40) && !arrowDown)
  87.    {
  88.       arrowDown = true;
  89.       if(shipChoice == "C")
  90.       {
  91.          endY = endB;
  92.          shipChoice = "B";
  93.       }
  94.       else
  95.       {
  96.          endY = endA;
  97.          shipChoice = "A";
  98.       }
  99.    }
  100.    else if(!Key.isDown(38) && !Key.isDown(40))
  101.    {
  102.       arrowDown = false;
  103.    }
  104.    shipDescriptions_mc.gotoAndPlay(shipChoice);
  105.    if(shipChoice == "A")
  106.    {
  107.       slider_mc.selectArrowUp_mc._visible = true;
  108.       slider_mc.selectArrowDown_mc._visible = false;
  109.    }
  110.    else if(shipChoice == "B")
  111.    {
  112.       slider_mc.selectArrowUp_mc._visible = true;
  113.       slider_mc.selectArrowDown_mc._visible = true;
  114.    }
  115.    else if(shipChoice == "C")
  116.    {
  117.       slider_mc.selectArrowUp_mc._visible = false;
  118.       slider_mc.selectArrowDown_mc._visible = true;
  119.    }
  120.    if(Key.isDown(32) || Key.isDown(82))
  121.    {
  122.       goToRaceStart();
  123.    }
  124.    this._y += (endY - this._y) / 5;
  125. };
  126. textBGMask_mc.onEnterFrame = function()
  127. {
  128.    this._y += (163 + endY - this._y) / 5;
  129. };
  130. btnRace_mc.onRelease = function()
  131. {
  132.    goToRaceStart();
  133. };
  134. btnPractice_mc.onRelease = function()
  135. {
  136.    goToPracticeStart();
  137. };
  138.