home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 18 / MacAddict_018_1998_02.iso / MEDIA / Software.dxr / LingoLib_7.ls < prev    next >
Encoding:
Text File  |  1997-12-04  |  780 b   |  27 lines

  1. on playSound whichChannel, whichSound
  2.   puppetSound(0)
  3.   puppetSound(whichChannel, whichSound)
  4.   updateStage()
  5. end
  6.  
  7. on setSoundLevel whichSprite, pmin, pmax
  8.   global gSoundLevel, gThumbPuppet
  9.   set curpos to the locH of sprite whichSprite
  10.   set gSoundLevel to integer((curpos - pmin) * 8 / (pmax - pmin))
  11.   set gSoundLevel to min(max(gSoundLevel, 0), 7)
  12.   set the soundLevel to gSoundLevel
  13.   set gThumbPuppet to whichSprite
  14.   return gSoundLevel
  15. end
  16.  
  17. on setSoundPos whichSprite, pmin, pmax
  18.   global gSoundLevel, gThumbPuppet
  19.   set curpos to pmin + integer(gSoundLevel * (pmax - pmin) / 7)
  20.   puppetSprite(whichSprite, 1)
  21.   set the locH of sprite whichSprite to curpos
  22.   set the locV of sprite whichSprite to 468
  23.   updateStage()
  24.   set gThumbPuppet to whichSprite
  25.   return curpos
  26. end
  27.