home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Diversos / beaverblast.swf / scripts / DefineSprite_233 / frame_1 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  653 b   |  41 lines

  1. top = vol._y;
  2. left = vol._x;
  3. right = vol._x;
  4. bottom = vol._y + 100;
  5. level = 35;
  6. _root.strength = level;
  7. vol.onPress = function()
  8. {
  9.    startDrag("vol",0,left,top,right,bottom);
  10.    dragging = true;
  11. };
  12. vol.onRelease = function()
  13. {
  14.    stopDrag();
  15.    dragging = false;
  16. };
  17. vol.onReleaseOutside = function()
  18. {
  19.    dragging = false;
  20. };
  21. this.onEnterFrame = function()
  22. {
  23.    if(dragging)
  24.    {
  25.       level = 100 - (vol._y - top);
  26.    }
  27.    else if(level > 100)
  28.    {
  29.       level = 100;
  30.    }
  31.    else if(level < 0)
  32.    {
  33.       level = 0;
  34.    }
  35.    else
  36.    {
  37.       vol._y = - level + 100 + top;
  38.    }
  39.    _root.strength = int(level);
  40. };
  41.