home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / pc / tutorial / devglry / elementl / source / main.dir / 00034.ls < prev    next >
Encoding:
Text File  |  1996-11-11  |  5.8 KB  |  175 lines

  1. on startMovie
  2.   global gQuestionLock
  3.   set gQuestionLock to 0
  4. end
  5.  
  6. on spritesOn
  7.   repeat with x = 10 to 13
  8.     puppetSprite(x, 1)
  9.   end repeat
  10. end
  11.  
  12. on selectInterviewee castMemberNumber, castMemberName
  13.   global gWhichName
  14.   puppetSprite(3, 1)
  15.   set currentCast to word 2 of castMemberName + 0
  16.   set whatItIs to word 2 of the name of cast the castNum of sprite 3
  17.   if whatItIs < currentCast then
  18.     puppetSound("Cube Snap.aiff")
  19.     repeat with y = whatItIs to currentCast
  20.       set the castNum of sprite 3 to the number of member ("Cube" && y)
  21.       set castMemberNumber to the castNum of sprite 3
  22.       set castMemberName to the name of cast castMemberNumber
  23.       updateStage()
  24.     end repeat
  25.   else
  26.     if whatItIs > currentCast then
  27.       puppetSound("Cube Snap.aiff")
  28.       repeat with y = whatItIs down to currentCast
  29.         set the castNum of sprite 3 to the number of member ("Cube" && y)
  30.         set castMemberNumber to the castNum of sprite 3
  31.         set castMemberName to the name of cast castMemberNumber
  32.         updateStage()
  33.       end repeat
  34.     else
  35.       nothing()
  36.     end if
  37.   end if
  38.   goToPage()
  39. end
  40.  
  41. on buttonDown
  42.   puppetSound("Chip.aiff")
  43.   set selectedSprite to the clickOn
  44.   set castMemberName to the name of cast the castNum of sprite selectedSprite
  45.   set the foreColor of sprite selectedSprite to 255
  46.   set the backColor of sprite selectedSprite to 23
  47.   updateStage()
  48.   repeat while the mouseDown
  49.     if rollOver(selectedSprite) = 0 then
  50.       set the foreColor of sprite selectedSprite to 255
  51.       set the backColor of sprite selectedSprite to 0
  52.       updateStage()
  53.       next repeat
  54.     end if
  55.     set the foreColor of sprite selectedSprite to 255
  56.     set the backColor of sprite selectedSprite to 23
  57.     updateStage()
  58.   end repeat
  59. end
  60.  
  61. on spinCube
  62.   global gSpinDirection
  63.   if the doubleClick then
  64.     goToPage()
  65.   end if
  66.   cursor(200)
  67.   puppetSprite(3, 1)
  68.   set selectedSprite to the clickOn
  69.   set castMemberNumber to the castNum of sprite selectedSprite
  70.   set castMemberName to the name of cast castMemberNumber
  71.   set firstCast to 1.0
  72.   set lastCast to 20.0
  73.   set initialMouseH to the mouseH
  74.   repeat while the mouseDown
  75.     if the mouseH < initialMouseH then
  76.       if word 2 of the name of cast castMemberNumber = lastCast then
  77.         set the castNum of sprite selectedSprite to the number of member "Cube 1.0"
  78.         set castMemberNumber to the castNum of sprite selectedSprite
  79.         updateStage()
  80.       end if
  81.       set the castNum of sprite selectedSprite to the number of member ("Cube" && word 2 of the name of cast castMemberNumber + 1)
  82.       set castMemberNumber to the castNum of sprite selectedSprite
  83.       set castMemberName to the name of cast castMemberNumber
  84.       set gSpinDirection to "LEFT"
  85.     end if
  86.     if the mouseH > initialMouseH then
  87.       if word 2 of the name of cast castMemberNumber = firstCast then
  88.         set the castNum of sprite selectedSprite to the number of member "Cube 20.0"
  89.         set castMemberNumber to the castNum of sprite selectedSprite
  90.         updateStage()
  91.       end if
  92.       set the castNum of sprite selectedSprite to the number of member ("Cube" && word 2 of the name of cast castMemberNumber - 1)
  93.       set castMemberNumber to the castNum of sprite selectedSprite
  94.       set castMemberName to the name of cast castMemberNumber
  95.       set gSpinDirection to "RIGHT"
  96.     end if
  97.     set initialMouseH to the mouseH
  98.     updateStage()
  99.   end repeat
  100. end
  101.  
  102. on snapTo
  103.   global gSpinDirection
  104.   cursor(-1)
  105.   set selectedSprite to the clickOn
  106.   set castMemberNumber to the castNum of sprite selectedSprite
  107.   set castMemberName to the name of cast castMemberNumber
  108.   set firstCast to 1.0
  109.   set lastCast to 20.0
  110.   set howManyPositions to 4
  111.   set mainPositions to []
  112.   repeat with x = 0 to 3
  113.     set listItem to (x * (lastCast / howManyPositions)) + firstCast
  114.     append(mainPositions, listItem)
  115.   end repeat
  116.   if gSpinDirection = "LEFT" then
  117.     set currentCast to word 2 of the name of cast castMemberNumber + 0
  118.     add(mainPositions, currentCast)
  119.     sort(mainPositions)
  120.     add(mainPositions, 20)
  121.     set listPosition to findPos(mainPositions, currentCast) + 1
  122.     set targetCast to getAt(mainPositions, listPosition + 1)
  123.     if (currentCast - targetCast) <> 0 then
  124.       puppetSound("Cube Snap.aiff")
  125.     end if
  126.     repeat with y = currentCast to targetCast
  127.       set the castNum of sprite selectedSprite to the number of member ("Cube" && y)
  128.       set castMemberNumber to the castNum of sprite selectedSprite
  129.       set castMemberName to the name of cast castMemberNumber
  130.       updateStage()
  131.       if y = 20 then
  132.         set the castNum of sprite selectedSprite to the number of member "Cube 1.0"
  133.         updateStage()
  134.       end if
  135.     end repeat
  136.   end if
  137.   if gSpinDirection = "RIGHT" then
  138.     set currentCast to word 2 of the name of cast castMemberNumber + 0
  139.     add(mainPositions, currentCast)
  140.     sort(mainPositions)
  141.     set listPosition to findPos(mainPositions, currentCast) + 1
  142.     append(mainPositions, 1)
  143.     if currentCast = getAt(mainPositions, listPosition + 1) then
  144.       nothing()
  145.     else
  146.       puppetSound("Cube Snap.aiff")
  147.       repeat with y = currentCast down to getAt(mainPositions, listPosition - 1)
  148.         set the castNum of sprite selectedSprite to the number of member ("Cube" && y)
  149.         set castMemberNumber to the castNum of sprite selectedSprite
  150.         set castMemberName to the name of cast castMemberNumber
  151.         updateStage()
  152.       end repeat
  153.     end if
  154.   end if
  155. end
  156.  
  157. on goToPage
  158.   set currentPosition to word 2 of the name of cast the castNum of sprite 3
  159.   if currentPosition = 1 then
  160.     goToNetPage("../fun.html")
  161.   else
  162.     if currentPosition = 6 then
  163.       goToNetPage("../art.html")
  164.     else
  165.       if currentPosition = 11 then
  166.         goToNetPage("../who.html")
  167.       else
  168.         if currentPosition = 16 then
  169.           goToNetPage("../svc.html")
  170.         end if
  171.       end if
  172.     end if
  173.   end if
  174. end
  175.