home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 6 / MacAddict_006_1997_02.iso / media / Main.Dxr / Internal_1.ls < prev    next >
Encoding:
Text File  |  1996-11-25  |  3.1 KB  |  124 lines

  1. on startMovie
  2.   global adbanner, editbanner, gSoundLevel
  3.   openXLib("MacAddict:Media:Xtras:FileIOXtraFat")
  4.   if (gSoundLevel = 0) and (the soundLevel <> 0) then
  5.     set gSoundLevel to 6
  6.   end if
  7.   set the soundLevel to gSoundLevel
  8.   set the volume of sound 1 to 255
  9.   set the volume of sound 2 to 255
  10.   set the visible of sprite 6 to 0
  11.   set the visible of sprite 14 to 0
  12.   set the visible of sprite 15 to 0
  13.   set the visible of sprite 16 to 0
  14.   set the visible of sprite 17 to 0
  15.   set the visible of sprite 21 to 0
  16.   set the visible of sprite 25 to 0
  17.   set the visible of sprite 26 to 0
  18.   set the visible of sprite 27 to 0
  19.   set the visible of sprite 32 to 0
  20.   set the visible of sprite 33 to 0
  21.   set the visible of sprite 36 to 0
  22.   set the visible of sprite 37 to 0
  23.   set the visible of sprite 45 to 0
  24.   set the visible of sprite 46 to 0
  25.   set the visible of sprite 47 to 0
  26.   set the visible of sprite 48 to 0
  27.   set the constraint of sprite 12 to 11
  28. end
  29.  
  30. on soundswitch
  31.   global trak
  32.   set trak to trak + 1
  33.   if trak = 1 then
  34.     playtrak1()
  35.   else
  36.     if trak = 2 then
  37.       playtrak2()
  38.     else
  39.       if trak = 3 then
  40.         playtrak3()
  41.       else
  42.         if trak = 4 then
  43.           playtrak4()
  44.         end if
  45.       end if
  46.     end if
  47.   end if
  48. end
  49.  
  50. on playtrak1
  51.   sound playFile 2, "MacAddict:Media:audio:track1"
  52.   set the visible of sprite 24 to 1
  53.   set the visible of sprite 25 to 0
  54.   set the visible of sprite 26 to 0
  55.   set the visible of sprite 27 to 0
  56. end
  57.  
  58. on playtrak2
  59.   sound playFile 2, "MacAddict:Media:audio:track2"
  60.   set the visible of sprite 25 to 1
  61.   set the visible of sprite 24 to 0
  62.   set the visible of sprite 26 to 0
  63.   set the visible of sprite 27 to 0
  64. end
  65.  
  66. on playtrak3
  67.   sound playFile 2, "MacAddict:Media:audio:track3"
  68.   set the visible of sprite 26 to 1
  69.   set the visible of sprite 25 to 0
  70.   set the visible of sprite 24 to 0
  71.   set the visible of sprite 27 to 0
  72. end
  73.  
  74. on playtrak4
  75.   global trak
  76.   set trak to 0
  77.   sound playFile 2, "MacAddict:Media:audio:track4"
  78.   set the visible of sprite 27 to 1
  79.   set the visible of sprite 24 to 0
  80.   set the visible of sprite 25 to 0
  81.   set the visible of sprite 26 to 0
  82. end
  83.  
  84. on setSoundLevel whichSprite, pmin, pmax
  85.   global gSoundLevel, gThumbPuppet
  86.   set curpos to the locH of sprite whichSprite
  87.   set gSoundLevel to integer((curpos - pmin) * 8 / (pmax - pmin))
  88.   set gSoundLevel to min(max(gSoundLevel, 0), 7)
  89.   set the soundLevel to gSoundLevel
  90.   set gThumbPuppet to whichSprite
  91.   return gSoundLevel
  92. end
  93.  
  94. on setSoundPos whichSprite, pmin, pmax
  95.   global gSoundLevel, gThumbPuppet
  96.   set curpos to pmin + integer(gSoundLevel * (pmax - pmin) / 7)
  97.   set curposY to the locV of sprite whichSprite
  98.   put curposY
  99.   puppetSprite(whichSprite, 1)
  100.   set the locH of sprite whichSprite to curpos
  101.   set the locV of sprite whichSprite to curposY
  102.   updateStage()
  103.   set gThumbPuppet to whichSprite
  104.   return curpos
  105. end
  106.  
  107. on clearThumb
  108.   global gThumbPuppet
  109.   puppetSprite(gThumbPuppet, 0)
  110.   updateStage()
  111. end
  112.  
  113. on stopMovie
  114.   clearThumb()
  115. end
  116.  
  117. on resetpuppets
  118.   repeat with spritenum = 1 to 48
  119.     if the puppet of sprite spritenum then
  120.       puppetSprite(spritenum, 0)
  121.     end if
  122.   end repeat
  123. end
  124.