home *** CD-ROM | disk | FTP | other *** search
/ A Virtual Reality Guide to Texas / CD.iso / texdata / arcextra / extras.cst / 00086.ls < prev    next >
Encoding:
Text File  |  1998-06-23  |  2.8 KB  |  118 lines

  1. on exitFrame
  2.   global songtimed,songframe,songh,songv,prev_vol
  3.   
  4.   checkpage
  5.   
  6.   repeat with i in [3,4]
  7.     if rollover(i) then
  8.       if the visible of sprite i = false then
  9.         set the visible of sprite i = true
  10.         if soundbusy(1)=false then puppetsound "markdwn.aif"
  11.       end if
  12.     else
  13.       set the visible of sprite i = false
  14.     end if
  15.   end repeat
  16.   
  17.   if songtimed = false then
  18.     if soundbusy(3) then
  19.       go the frame
  20.     else
  21.       set prev_vol = abs(prev_vol) * -1
  22.       repeat with i in [1,3,4]
  23.         puppetsprite i,false
  24.       end repeat
  25.       if marker(0) = label("sing3") then
  26.         go "sing"
  27.       end if     -- else we advance to the next frame because we don't loop to this frame
  28.     end if
  29.   else  -- here because of a timeout
  30.     set stay = false
  31.     if the mouseh = songh then
  32.       if the mousev = songv then
  33.         set stay = true
  34.       end if
  35.     end if
  36.     if stay then
  37.       if soundbusy(3) then
  38.         go the frame
  39.       else
  40.         put "song done"
  41.         set songtimed = false
  42.         set the timeoutlapsed = 0
  43.         set the visible of sprite 3 = true
  44.         set the visible of sprite 4 = true
  45.         repeat with i in [1,3,4]
  46.           puppetsprite i,false
  47.         end repeat
  48.         set prev_vol = abs(prev_vol)
  49.         set the volume of sound 3 = prev_vol
  50.         sound close 3
  51.         go songframe
  52.       end if
  53.     else
  54.       put "the mouse moved"
  55.       puppetsound 0
  56.       set songtimed = false
  57.       repeat with i in [1,3,4]
  58.         puppetsprite i,false
  59.       end repeat
  60.       set prev_vol = abs(prev_vol)
  61.       set the volume of sound 3 = prev_vol
  62.       sound close 3
  63.       go songframe
  64.     end if
  65.   end if
  66. end
  67.  
  68. on mouseup
  69.   global songtimed,songframe,prev_vol
  70.   
  71.   if songtimed = true then
  72.     put "the mouse was clicked"
  73.     set songtimed = false
  74.     set the visible of sprite 3 = true
  75.     set the visible of sprite 4 = true
  76.     repeat with i in [1,3,4]
  77.       puppetsprite i,false
  78.     end repeat
  79.     
  80.     set prev_vol = abs(prev_vol)
  81.     set the volume of sound 3 = prev_vol
  82.     sound close 3
  83.     go songframe
  84.   else
  85.     if the clickon = 4 then
  86.       sound close 3
  87.       set prev_vol = abs(prev_vol) * -1
  88.       if marker(0) <> label("sing3") then
  89.         repeat with i in [1,3,4]
  90.           puppetsprite i,false
  91.         end repeat
  92.         go marker(1)
  93.       else
  94.         repeat with i in [1,3,4]
  95.           puppetsprite i,false
  96.         end repeat
  97.         go "sing"
  98.       end if
  99.     end if
  100.   end if
  101. end
  102.  
  103. on keyup
  104.   global songtimed,songframe,prev_vol
  105.   
  106.   if songtimed= true then
  107.     put "a key was pressed"
  108.     sound close 3
  109.     set the visible of sprite 3 = true
  110.     set the visible of sprite 4 = true
  111.     set songtimed = false
  112.     repeat with i in [1,3,4]
  113.       puppetsprite i,false
  114.     end repeat
  115.     set the volume of sound 3 = abs(prev_vol)
  116.     go songframe
  117.   end if
  118. end