home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / david.swf / scripts / __Packages / Nedtelling.as < prev    next >
Encoding:
Text File  |  2007-03-28  |  1.2 KB  |  59 lines

  1. class Nedtelling
  2. {
  3.    var mc;
  4.    var tid = 300;
  5.    var teljar = 0;
  6.    var tidaGaar = false;
  7.    function Nedtelling(mc, skjerm_x, skjerm_y)
  8.    {
  9.       this.mc = mc;
  10.       this.mc._x = skjerm_x;
  11.       this.mc._y = skjerm_y;
  12.    }
  13.    function settTid(tid)
  14.    {
  15.       this.tid = tid;
  16.       _root.tid = this.tid;
  17.    }
  18.    function startNedtelling()
  19.    {
  20.       this.tidaGaar = true;
  21.    }
  22.    function stoppNedtelling()
  23.    {
  24.       this.tidaGaar = false;
  25.    }
  26.    function tellNed()
  27.    {
  28.       if(this.tidaGaar)
  29.       {
  30.          this.teljar += 1;
  31.          if(this.teljar == 25)
  32.          {
  33.             this.tid -= 1;
  34.             _root.tid = this.tid;
  35.             if(this.tid < 31)
  36.             {
  37.                if(this.tid < 11)
  38.                {
  39.                   this.mc.gotoAndStop(3);
  40.                   _root.blipp.setVolume(100);
  41.                   _root.blipp.start();
  42.                }
  43.                else
  44.                {
  45.                   this.mc.gotoAndStop(2);
  46.                   _root.tikk.start();
  47.                }
  48.             }
  49.             this.teljar = 0;
  50.          }
  51.       }
  52.    }
  53.    function tellNedPoeng(step)
  54.    {
  55.       this.tid -= step;
  56.       _root.tid = this.tid;
  57.    }
  58. }
  59.