home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / grannyinparadise.swf / scripts / frame_77 / DoAction.as
Encoding:
Text File  |  2007-03-12  |  2.2 KB  |  59 lines

  1. function DoNextLevel()
  2. {
  3.    Key.removeListener(postLevelSpaceListener);
  4.    _root.GotoNextLevel();
  5. }
  6. stop();
  7. _root.PlayOneOf(Array({f:"finishlevel.mp3",p:90},{f:"finishlevel1.mp3",p:5},{f:"finishlevel2.mp3",p:5}));
  8. _root.Localizer.Localize("_root.PostLevelMC.ui.NextLevelButton.ButtonText","nextLevel");
  9. _root.Localizer.Localize("_root.PostLevelMC.ui.NextLevelButton.ButtonTextShadow","nextLevel");
  10. _root.Localizer.Localize("_root.PostLevelMC.ui.FinishedLevelText","finishedLevel");
  11. _root.Localizer.Localize("_root.PostLevelMC.ui.HintText","hint");
  12. if(_global.isBonusLevel)
  13. {
  14.    _root.Localizer.Localize("_root.PostLevelMC.ui.FlowersFoundText","bonusHeartsCollected");
  15.    var bonusHeartsText = _root.PostLevelMC.ui.FlowersFoundText.text + " " + _global.NumBonusHearts;
  16.    _root.PostLevelMC.ui.FlowersFoundText.text = bonusHeartsText;
  17.    _root.PostLevelMC.ui.FlowersFoundTextShadow.text = bonusHeartsText;
  18.    _root.Localizer.Localize("_root.PostLevelMC.ui.TotalPointsText","totalPoints");
  19.    var finalPointsText = _root.PostLevelMC.ui.TotalPointsText.text + " " + _global.TotalBonusPoints;
  20.    _root.PostLevelMC.ui.TotalPointsText.text = finalPointsText;
  21.    _root.PostLevelMC.ui.TotalPointsTextShadow.text = finalPointsText;
  22. }
  23. else
  24. {
  25.    _root.Localizer.Localize("_root.PostLevelMC.ui.FlowersFoundText","flowersFound");
  26.    var finalFlowerText = _root.PostLevelMC.ui.FlowersFoundText.text + " " + _global.PercentOfFlowersCollected + "%";
  27.    _root.PostLevelMC.ui.FlowersFoundText.text = finalFlowerText;
  28.    _root.PostLevelMC.ui.FlowersFoundTextShadow.text = finalFlowerText;
  29. }
  30. _root.PostLevelMC.ui.NextLevelButton.onGrannyButtonPress = function()
  31. {
  32.    Key.removeListener(spaceListener);
  33.    if(_global.FinishedLastLevel == true)
  34.    {
  35.       _root.EndGame();
  36.    }
  37.    else
  38.    {
  39.       _root.DoNextLevel();
  40.    }
  41. };
  42. var postLevelSpaceListener = new Object();
  43. postLevelSpaceListener.onKeyDown = function()
  44. {
  45.    if(Key.isDown(32))
  46.    {
  47.       Key.removeListener(postLevelSpaceListener);
  48.       if(_global.FinishedLastLevel == true)
  49.       {
  50.          _root.EndGame();
  51.       }
  52.       else
  53.       {
  54.          _root.DoNextLevel();
  55.       }
  56.    }
  57. };
  58. Key.addListener(postLevelSpaceListener);
  59.