home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Diversos / sheriff_tripeaks.swf / scripts / DefineSprite_358 / frame_1 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  639 b   |  34 lines

  1. function setVal(v)
  2. {
  3.    val = Math.max(0,Math.min(100,v));
  4. }
  5. function addVal(v)
  6. {
  7.    val = Math.max(0,Math.min(100,val + v));
  8.    if(val == 100 && star._currentframe == 1)
  9.    {
  10.       bar._yscale = 100;
  11.       star._y = - bar._height;
  12.       _global.Game.setScore(100);
  13.       setVal(0);
  14.       _root.pistol.gotoAndPlay(2);
  15.    }
  16. }
  17. function refreshMe()
  18. {
  19.    if(star._currentframe == 1)
  20.    {
  21.       var _loc1_ = Math.round(val);
  22.       if(_loc1_ != rndVal)
  23.       {
  24.          rndVal = _loc1_;
  25.       }
  26.       bar._yscale = rndVal;
  27.       star._y = - bar._height;
  28.    }
  29. }
  30. var val = 0;
  31. var rndVal = -1;
  32. refreshMe();
  33. stop();
  34.