home *** CD-ROM | disk | FTP | other *** search
/ Champak 112 / jogo-disk-112.iso / Games / mon_the_monkey.swf / scripts / frame_4 / DoAction.as
Text File  |  2010-07-14  |  4KB  |  214 lines

  1. function backSound()
  2. {
  3.    mySound.stop();
  4.    mySound = new Sound("sound1");
  5.    mySound.attachSound("backGame");
  6.    mySound.start(0,9999);
  7. }
  8. function backGame()
  9. {
  10.    mySound.stop();
  11.    mySound = new Sound("sound1");
  12.    mySound.attachSound("backSound");
  13.    mySound.start(0,9999);
  14. }
  15. function jam()
  16. {
  17.    mySound3 = new Sound("sound3");
  18.    mySound3.attachSound("jam");
  19.    mySound3.start(0,999);
  20. }
  21. function over()
  22. {
  23.    mySound2 = new Sound("sound2");
  24.    mySound2.attachSound("over");
  25.    mySound2.start(0,1);
  26. }
  27. function klik()
  28. {
  29.    mySound2 = new Sound("sound2");
  30.    mySound2.attachSound("klik");
  31.    mySound2.start(0,1);
  32. }
  33. function gagal()
  34. {
  35.    mySound2 = new Sound("sound2");
  36.    mySound2.attachSound("gagal");
  37.    mySound2.start(0,1);
  38. }
  39. function sukses()
  40. {
  41.    mySound2 = new Sound("sound2");
  42.    mySound2.attachSound("sukses");
  43.    mySound2.start(0,1);
  44. }
  45. function buah1()
  46. {
  47.    mySound2 = new Sound("sound2");
  48.    mySound2.attachSound("buah1");
  49.    mySound2.start(0,1);
  50. }
  51. function buah2()
  52. {
  53.    mySound2 = new Sound("sound2");
  54.    mySound2.attachSound("buah2");
  55.    mySound2.start(0,1);
  56. }
  57. function onyet()
  58. {
  59.    mySound2 = new Sound("sound2");
  60.    mySound2.attachSound("onyet");
  61.    mySound2.start(0,1);
  62. }
  63. function drum()
  64. {
  65.    mySound2 = new Sound("sound2");
  66.    mySound2.attachSound("drum");
  67.    mySound2.start(0,1);
  68. }
  69. function loncat()
  70. {
  71.    mySound2 = new Sound("sound2");
  72.    mySound2.attachSound("loncat");
  73.    mySound2.start(0,1);
  74. }
  75. function jalan()
  76. {
  77.    mySound2 = new Sound("sound2");
  78.    mySound2.attachSound("jalan");
  79.    mySound2.start(0,1);
  80. }
  81. function lose()
  82. {
  83.    mySound2 = new Sound("sound2");
  84.    mySound2.attachSound("lose");
  85.    mySound2.start(0,1);
  86. }
  87. function poing3()
  88. {
  89.    mySound2 = new Sound("sound2");
  90.    mySound2.attachSound("poing3");
  91.    mySound2.start(0,1);
  92. }
  93. function cherr()
  94. {
  95.    mySound2 = new Sound("sound2");
  96.    mySound2.attachSound("cherr");
  97.    mySound2.start(0,1);
  98. }
  99. function door()
  100. {
  101.    mySound2 = new Sound("sound2");
  102.    mySound2.attachSound("door");
  103.    mySound2.start(0,1);
  104. }
  105. function exel()
  106. {
  107.    mySound2 = new Sound("sound2");
  108.    mySound2.attachSound("exel");
  109.    mySound2.start(0,1);
  110. }
  111. function whoops()
  112. {
  113.    mySound2 = new Sound("sound2");
  114.    mySound2.attachSound("whoops");
  115.    mySound2.start(0,1);
  116. }
  117. function ah()
  118. {
  119.    mySound2 = new Sound("sound2");
  120.    mySound2.attachSound("ah");
  121.    mySound2.start(0,1);
  122. }
  123. function hurry()
  124. {
  125.    mySound2 = new Sound("sound2");
  126.    mySound2.attachSound("hurry");
  127.    mySound2.start(0,1);
  128. }
  129. function bacaData()
  130. {
  131.    iq = 1;
  132.    while(iq <= 10)
  133.    {
  134.       xxnama = "namaBretto" + String(iq);
  135.       xxskor = "scoreBretto" + String(iq);
  136.       Cookies = SharedObject.getLocal(xxnama,"/");
  137.       this["namanya" + iq] = Cookies.data.txt;
  138.       Cookies = SharedObject.getLocal(xxskor,"/");
  139.       this["scorenya" + iq] = Cookies.data.txt;
  140.       iq++;
  141.    }
  142. }
  143. function buatData()
  144. {
  145.    iq = 1;
  146.    while(iq <= 10)
  147.    {
  148.       xxnama = "namaBretto" + String(iq);
  149.       xxskor = "scoreBretto" + String(iq);
  150.       Cookies = SharedObject.getLocal(xxnama,"/");
  151.       Cookies.data.txt = "User-" + iq;
  152.       Cookies = SharedObject.getLocal(xxskor,"/");
  153.       Cookies.data.txt = "0";
  154.       Cookies.flush();
  155.       iq++;
  156.    }
  157. }
  158. stop();
  159. backSound();
  160. sudahMenang = false;
  161. awalSaja = true;
  162. sound1._visible = false;
  163. sound2._visible = false;
  164. i = 1;
  165. while(i <= 7)
  166. {
  167.    this["xjatuh" + i].gotoAndStop(i);
  168.    i++;
  169. }
  170. easy_btn.onRollOver = normal_btn.onRollOver = hard_btn.onRollOver = top_btn.onRollOver = exit_btn.onRollOver = function()
  171. {
  172.    over();
  173. };
  174. easy_btn.onRelease = function()
  175. {
  176.    klik();
  177.    xlevel = "EASY";
  178.    level = 1;
  179.    batasLevel = 5;
  180.    gotoAndStop("game");
  181. };
  182. normal_btn.onRelease = function()
  183. {
  184.    klik();
  185.    xlevel = "NORMAL";
  186.    level = 5;
  187.    batasLevel = 9;
  188.    gotoAndStop("game");
  189. };
  190. hard_btn.onRelease = function()
  191. {
  192.    xlevel = "HARD";
  193.    level = 9;
  194.    batasLevel = 13;
  195.    gotoAndStop("game");
  196. };
  197. top_btn.onRelease = function()
  198. {
  199.    klik();
  200.    gotoAndStop("top2");
  201.    tandaBalik = "menu";
  202. };
  203. exit_btn.onRelease = function()
  204. {
  205.    klik();
  206.    fscommand("quit");
  207. };
  208. bacaData();
  209. if(namanya1 == null)
  210. {
  211.    buatData();
  212.    bacaData();
  213. }
  214.