home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / blackknight.swf / scripts / DefineSprite_1104 / frame_1 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  1.4 KB  |  59 lines

  1. statement = new Array();
  2. statement[0] = "";
  3. statement[1] = "The peasants aren\'t paying their taxes!";
  4. statement[2] = "";
  5. statement[3] = "Go forth and beat the gold out of them!";
  6. statement[4] = "";
  7. statement[5] = "The harder you swing, the more gold I\'ll get!";
  8. statement[6] = "";
  9. statement[7] = "The Queen needs a ";
  10. statement[8] = "";
  11. statement[9] = "Why are you still here?";
  12. statement[10] = "";
  13. statement[11] = "Get me all the gold or you\'re fired!";
  14. statement[12] = "";
  15. statement[13] = "Why are my lips still moving?";
  16. statement[14] = "";
  17. randoms = new Array("new pair of shoes!","swimming pool!","botox injection!","gold-plated handbag!");
  18. curstatement = 0;
  19. wait = 0;
  20. mouthwait = 0;
  21. story.mouth.stop();
  22. talk = new Sound(_root.sounds.talkmc);
  23. talk.attachSound("kingtalk");
  24. bubbleOnEnterFrame = function()
  25. {
  26.    if(wait == 0)
  27.    {
  28.       talk.setVolume(99 * _root.sfxmute);
  29.       mouthwait = statement[curstatement].length * 2;
  30.       story.mouth.play();
  31.       speech_txt.text = statement[curstatement];
  32.       wait = 100;
  33.       if(statement[curstatement] == "")
  34.       {
  35.          wait = 30;
  36.          this._visible = false;
  37.       }
  38.       else
  39.       {
  40.          this._visible = true;
  41.       }
  42.       curstatement++;
  43.       curstatement %= statement.length;
  44.    }
  45.    else
  46.    {
  47.       wait--;
  48.    }
  49.    if(mouthwait == 0)
  50.    {
  51.       story.mouth.gotoAndStop(3);
  52.       talk.setVolume(0);
  53.    }
  54.    else
  55.    {
  56.       mouthwait--;
  57.    }
  58. };
  59.