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

  1. increment = 4;
  2. level = 30;
  3. _root.angle = level;
  4. panKnob.onPress = function()
  5. {
  6.    autoPan = false;
  7.    start = _root._xmouse;
  8.    newStart = panKnob._rotation;
  9.    dragging = true;
  10. };
  11. panKnob.onRelease = function()
  12. {
  13.    dragging = false;
  14. };
  15. panKnob.onReleaseOutside = function()
  16. {
  17.    dragging = false;
  18. };
  19. this.onEnterFrame = function()
  20. {
  21.    if(dragging)
  22.    {
  23.       pivot = (_root._xmouse - start) * 2 + newStart;
  24.       panKnob._rotation = pivot;
  25.       if(pivot < -135)
  26.       {
  27.          panKnob._rotation = -135;
  28.       }
  29.       if(pivot > 135)
  30.       {
  31.          panKnob._rotation = 135;
  32.       }
  33.    }
  34.    level = (panKnob._rotation + 135) * 100 / 270;
  35.    _root.angle = int(level / 2);
  36. };
  37.