home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / pc / tutorial / devglry / bigtop / shockwav / 27_pollu.dcr / 00055_volumeSlider.ls < prev    next >
Encoding:
Text File  |  1996-04-10  |  714 b   |  28 lines

  1. on mouseDown
  2.   set sliderSpr to the clickOn
  3.   set barSpr to sliderSpr - 1
  4.   set oldSndLev to the volume of sound 1
  5.   set increm to 20
  6.   set hOrg to the locH of sprite barSpr
  7.   repeat while the mouseDown
  8.     set index to (the mouseH - hOrg + (increm / 2)) / increm
  9.     if index < 0 then
  10.       set index to 0
  11.     end if
  12.     if index > 7 then
  13.       set index to 7
  14.     end if
  15.     set chanVol to index * 36
  16.     set the locH of sprite sliderSpr to hOrg + (index * increm) - 2
  17.     set the volume of sound 1 to chanVol
  18.     set the volume of sound 2 to chanVol
  19.     if oldSndLev <> chanVol then
  20.       puppetSound("pop")
  21.     end if
  22.     set oldSndLev to chanVol
  23.     updateStage()
  24.   end repeat
  25.   puppetSound(0)
  26.   hideVOL()
  27. end
  28.