home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / kingofthehill.swf / scripts / DefineSprite_80 / frame_1 / DoAction.as
Encoding:
Text File  |  2005-07-25  |  5.3 KB  |  243 lines

  1. function fNoise(which)
  2. {
  3.    var _loc1_ = which;
  4.    if(pOn == true)
  5.    {
  6.       if(_loc1_ == "scroll")
  7.       {
  8.          sScroll.start();
  9.       }
  10.       else if(_loc1_ == "click")
  11.       {
  12.          sClick.start();
  13.       }
  14.       else if(_loc1_ == "click2")
  15.       {
  16.          sClick2.start();
  17.       }
  18.    }
  19. }
  20. function fsExplode()
  21. {
  22.    if(pOn == true)
  23.    {
  24.       var _loc1_ = random(50) + 50;
  25.       sEarthLand.setVolume(_loc1_);
  26.       sEarthLand.start();
  27.    }
  28. }
  29. function fsHitEnemy()
  30. {
  31.    if(pOn == true)
  32.    {
  33.       sExplode.start();
  34.       sOnFire.start();
  35.    }
  36. }
  37. function fOil()
  38. {
  39.    if(pOn == true)
  40.    {
  41.       sHiss.setVolume(100);
  42.       sHiss.start();
  43.       sHinge.setVolume(50);
  44.       sHinge.start();
  45.    }
  46. }
  47. function fsOilBurn()
  48. {
  49.    if(pOn == true)
  50.    {
  51.       sOnFire.start();
  52.    }
  53. }
  54. function fEnemyAttack()
  55. {
  56.    if(pOn == true)
  57.    {
  58.       sHinge.setVolume(80);
  59.       sHinge.start();
  60.    }
  61. }
  62. function fsLaunch()
  63. {
  64.    if(pOn == true)
  65.    {
  66.       sHiss.setVolume(random(70) + 30);
  67.       sHiss.start();
  68.       sLaunch.setVolume(random(30) + 70);
  69.       sLaunch.start();
  70.       sReload.setVolume(random(50) + 50);
  71.       sReload.start();
  72.    }
  73. }
  74. function fsCastleBlow()
  75. {
  76.    if(pOn == true)
  77.    {
  78.       sCastleBlow.start();
  79.    }
  80. }
  81. function sWinMusic()
  82. {
  83.    if(pOn == true)
  84.    {
  85.       sDrums.stop();
  86.       sLoop.stop();
  87.       sLose.stop();
  88.       sWin.stop();
  89.       sWin.start();
  90.    }
  91. }
  92. function sLoseMusic()
  93. {
  94.    if(pOn == true)
  95.    {
  96.       sDrums.stop();
  97.       sLoop.stop();
  98.       sLose.stop();
  99.       sWin.stop();
  100.       sLose.start();
  101.    }
  102. }
  103. function sMusic()
  104. {
  105.    if(pOn == true)
  106.    {
  107.       sDrums.stop();
  108.       sLoop.stop();
  109.       sLose.stop();
  110.       sWin.stop();
  111.       sLoop.setVolume(100);
  112.       sLoop.start();
  113.       sLoop.onSoundComplete = function()
  114.       {
  115.          sLoop.start();
  116.       };
  117.    }
  118. }
  119. function sDrumsMusic()
  120. {
  121.    if(pOn == true)
  122.    {
  123.       sLoop.stop();
  124.       sLose.stop();
  125.       sWin.stop();
  126.       sLoop.stop();
  127.       sDrums.start();
  128.       sDrums.onSoundComplete = function()
  129.       {
  130.          sDrums.start();
  131.       };
  132.    }
  133. }
  134. function sStopMusic()
  135. {
  136.    if(pOn == true)
  137.    {
  138.       sLoop.stop();
  139.       sLose.stop();
  140.       sWin.stop();
  141.       sLoop.stop();
  142.       sDrums.stop();
  143.    }
  144. }
  145. function fMainSoundSwitch(which)
  146. {
  147.    var _loc1_ = _root;
  148.    if(which == "on")
  149.    {
  150.       pOn = true;
  151.       if(_loc1_.pSection == "menu")
  152.       {
  153.          sMusic();
  154.       }
  155.       else if(_loc1_.pSection != "game")
  156.       {
  157.          if(_loc1_.pSection == "ready")
  158.          {
  159.             sDrumsMusic();
  160.          }
  161.       }
  162.    }
  163.    else
  164.    {
  165.       sStopMusic();
  166.       pOn = false;
  167.    }
  168. }
  169. this.createEmptyMovieClip("insCastleBlow",1);
  170. var sCastleBlow = new Sound(this.insCastleBlow);
  171. sCastleBlow.attachSound("sCastleBlow.wav");
  172. sCastleBlow.setVolume(100);
  173. this.createEmptyMovieClip("insEarthLand",2);
  174. var sEarthLand = new Sound(this.insEarthLand);
  175. sEarthLand.attachSound("sEarthLand.wav");
  176. sEarthLand.setVolume(100);
  177. this.createEmptyMovieClip("insExplode",12);
  178. var sExplode = new Sound(this.insExplode);
  179. sExplode.attachSound("sExplode.wav");
  180. sExplode.setVolume(100);
  181. this.createEmptyMovieClip("insFireBall",3);
  182. var sFireBall = new Sound(this.insFireBall);
  183. sFireBall.attachSound("sFireBall.wav");
  184. sFireBall.setVolume(100);
  185. this.createEmptyMovieClip("insHorses",4);
  186. var sHorses = new Sound(this.insHorses);
  187. sHorses.attachSound("sHorses.wav");
  188. sHorses.setVolume(100);
  189. this.createEmptyMovieClip("insLaunch",5);
  190. var sLaunch = new Sound(this.insLaunch);
  191. sLaunch.attachSound("sLaunch.wav");
  192. sLaunch.setVolume(100);
  193. this.createEmptyMovieClip("insMarching",6);
  194. var sMarching = new Sound(this.insMarching);
  195. sMarching.attachSound("sMarching.wav");
  196. sMarching.setVolume(100);
  197. this.createEmptyMovieClip("insOnFire",7);
  198. var sOnFire = new Sound(this.insOnFire);
  199. sOnFire.attachSound("sOnFire.wav");
  200. sOnFire.setVolume(100);
  201. this.createEmptyMovieClip("insReload",8);
  202. var sReload = new Sound(this.insReload);
  203. sReload.attachSound("sReload.wav");
  204. sReload.setVolume(100);
  205. this.createEmptyMovieClip("insHiss",9);
  206. var sHiss = new Sound(this.insHiss);
  207. sHiss.attachSound("sHiss.wav");
  208. sHiss.setVolume(100);
  209. this.createEmptyMovieClip("insLoop",13);
  210. var sLoop = new Sound(this.insLoop);
  211. sLoop.attachSound("sLoop.wav");
  212. sLoop.setVolume(100);
  213. this.createEmptyMovieClip("inssWin",14);
  214. var sWin = new Sound(this.inssWin);
  215. sWin.attachSound("sWin.wav");
  216. sWin.setVolume(100);
  217. this.createEmptyMovieClip("insLose",15);
  218. var sLose = new Sound(this.insLose);
  219. sLose.attachSound("sLose.wav");
  220. sLose.setVolume(100);
  221. this.createEmptyMovieClip("insDrums",16);
  222. var sDrums = new Sound(this.insDrums);
  223. sDrums.attachSound("sDrums.wav");
  224. sDrums.setVolume(100);
  225. this.createEmptyMovieClip("insClick",17);
  226. var sClick = new Sound(this.insClick);
  227. sClick.attachSound("sClick.wav");
  228. sClick.setVolume(100);
  229. this.createEmptyMovieClip("insClick2",18);
  230. var sClick2 = new Sound(this.insClick2);
  231. sClick2.attachSound("sClick2.wav");
  232. sClick2.setVolume(100);
  233. this.createEmptyMovieClip("insScroll",19);
  234. var sScroll = new Sound(this.insScroll);
  235. sScroll.attachSound("sScroll.wav");
  236. sScroll.setVolume(100);
  237. this.createEmptyMovieClip("insHinge",20);
  238. var sHinge = new Sound(this.insHinge);
  239. sHinge.attachSound("sHinge.wav");
  240. sHinge.setVolume(100);
  241. pOn = true;
  242. stop();
  243.