home *** CD-ROM | disk | FTP | other *** search
/ Imagination Express: Destination Pyramids / PYRAMIDS.ISO / THEMES / PYRAMIDS / FACTBOOK / FACTBOOK.EXE / FACTBOOK.DXR / 00002.ls < prev    next >
Encoding:
Text File  |  1996-02-21  |  21.0 KB  |  669 lines

  1. on startMovie
  2.   global gPreroll, gFirstLinkSprite, gLastLinkSprite, gSpecialAnimSprite, gQTlocs, gGoBackBtnSprite, gGoFwrdBtnSprite, gStopBtnSprite, gPlayTopicBtnSndSprite, gFirstChapSprite, gLastChapSprite, gChapCasts, gPlayMovieBtnSprite, gMovieRectSprite, gPlaySndSprite, gTabBtnSprite, gTabRectSprite, gMvbtnLocs, gSndbtnLocs, gChapStartNums, RFBIndex, gTabRectsList, gTabLoc, gSoundFolder, gLabelLocs, gAlreadyOverChaps, gGoFwrdBtnSpriteIntro
  3.   clearGlobals()
  4.   set gAlreadyOverChaps to 0
  5.   if the machineType = 256 then
  6.     set gSoundFolder to "PFBSOUND\"
  7.   else
  8.     set gSoundFolder to "PFBSOUND:"
  9.   end if
  10.   set lb1 to the number of cast "SCROLL_1"
  11.   set lb2 to the number of cast "SCROLL_2"
  12.   set lb3 to the number of cast "SCROLL_3"
  13.   set lb4 to the number of cast "SCROLL_4"
  14.   set lb5 to the number of cast "SCROLL_5"
  15.   set lb6 to the number of cast "SCROLL_6"
  16.   set lb7 to the number of cast "SCROLL_7"
  17.   set lb8 to the number of cast "SCROLL_8"
  18.   set gChapCasts to [41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64]
  19.   set gLabelLocs to [[lb1, 452, 33, 592, 67], [lb2, 436, 90, 592, 121], [lb3, 394, 141, 592, 176], [lb4, 374, 193, 592, 229], [lb5, 373, 251, 592, 287], [lb6, 403, 302, 592, 334], [lb7, 324, 346, 592, 398], [lb8, 433, 412, 592, 443]]
  20.   cursor(4)
  21.   set the mouseDownScript to "lockMouseDownscript"
  22.   set the mouseUpScript to "lockMouseUpscript"
  23.   set the keyDownScript to "doCommandKey"
  24.   set gTabLoc to [605, 231]
  25.   set gChapStartNums to [1, 7, 18, 28, 34, 48, 68, 79]
  26.   set gQTlocs to [[303, 59]]
  27.   set gMvbtnLocs to [[50, 174], [49, 174], [49, 174], [49, 174], [49, 174], [49, 173], [49, 173]]
  28.   set gSndbtnLocs to [[50, 115], [50, 115], [50, 115], [50, 115], [50, 114], [50, 114], [50, 114]]
  29.   set gTabRectSprite to 2
  30.   set gGoBackBtnSprite to 3
  31.   set gGoFwrdBtnSprite to 4
  32.   set gGoFwrdBtnSpriteIntro to 48
  33.   set gStopBtnSprite to 5
  34.   set gTabBtnSprite to 6
  35.   set gPlayTopicBtnSndSprite to 7
  36.   set gPlayMovieBtnSprite to 8
  37.   set gPlaySndSprite to 9
  38.   set gMovieRectSprite to 10
  39.   set gFirstChapSprite to 11
  40.   set gLastChapSprite to 18
  41.   set gAllChapSprites to [11, 12, 13, 14, 15, 16, 17, 18]
  42.   set gFirstLinkSprite to 20
  43.   set gLastLinkSprite to 40
  44.   set gSpecialAnimSprite to 41
  45.   set the centerStage to 1
  46.   initTabLocs()
  47.   initRFIndex()
  48.   set the mouseDownScript to EMPTY
  49.   set the mouseUpScript to EMPTY
  50.   cursor(-1)
  51. end
  52.  
  53. on keyDown
  54.   dontPassEvent()
  55. end
  56.  
  57. on keyUp
  58.   dontPassEvent()
  59. end
  60.  
  61. on initRFIndex
  62.   global RFBIndex
  63.   set RFBIndex to value(field "rfb index")
  64. end
  65.  
  66. on getMovieLoc movieName
  67.   global gQTlocs
  68.   set emptylist to list(0)
  69.   set letterCharPos to length(movieName)
  70.   set testLetterChar to char letterCharPos of movieName
  71.   set indexAsciiVal to charToNum(testLetterChar) - 64
  72.   if indexAsciiVal > count(gQTlocs) then
  73.     return emptylist
  74.   else
  75.     return getAt(gQTlocs, indexAsciiVal)
  76.   end if
  77. end
  78.  
  79. on initTabLocs
  80.   global gTabRectsList, gHiliteTabRectsList, gNumTabs, gTabWidth, gTabHeight
  81.   set tabStartX to 582
  82.   set tabStartY to 31
  83.   set gTabWidth to 27
  84.   set gTabHeight to 44
  85.   set tabEndX to tabStartX + gTabWidth
  86.   set tabEndY to 370
  87.   set tabGap to 5
  88.   set gNumTabs to 7
  89.   set gTabRectsList to list(0)
  90.   repeat with tabNum = 1 to gNumTabs
  91.     set thisTabY1 to tabStartY + ((gTabHeight + tabGap) * (tabNum - 1))
  92.     set thisTabY2 to thisTabY1 + gTabHeight
  93.     set thisTabRect to rect(tabStartX, thisTabY1, tabEndX, thisTabY2)
  94.     set thisTabRect to rect(tabStartX, thisTabY1, tabEndX, thisTabY2)
  95.     setAt(gTabRectsList, tabNum, thisTabRect)
  96.   end repeat
  97. end
  98.  
  99. on docommandKey
  100.   if the commandDown and (the key = ".") then
  101.     dontPassEvent()
  102.   end if
  103. end
  104.  
  105. on lockMousedownscript
  106.   dontPassEvent()
  107. end
  108.  
  109. on lockMouseUpscript
  110.   dontPassEvent()
  111. end
  112.  
  113. on soundMousedownscript
  114.   dontPassEvent()
  115.   set the mouseDownScript to EMPTY
  116. end
  117.  
  118. on soundMouseupscript
  119.   cursor(-1)
  120.   dontPassEvent()
  121.   set the mouseUpScript to EMPTY
  122. end
  123.  
  124. on mymouseUpScript
  125.   cursor(-1)
  126.   dontPassEvent()
  127.   set the mouseUpScript to EMPTY
  128. end
  129.  
  130. on mymouseDownScript
  131.   global gMoovExitFrame, gCallingFrame, mouseDown, gStartMovframe, gPlayMovieBtnSprite
  132.   pause()
  133.   cursor(4)
  134.   dontPassEvent()
  135.   set gMoovExitFrame to 0
  136.   sound stop 1
  137.   sound stop 2
  138.   puppetSound(0)
  139.   cursor(-1)
  140.   updateStage()
  141.   spriteBox(1, -50, -50, -40, -40)
  142.   puppetSprite(1, 0)
  143.   spriteBox(6, -50, -50, -40, -40)
  144.   puppetSprite(6, 0)
  145.   unLoad(gStartMovframe, the frame)
  146.   go(gCallingFrame)
  147.   set the castNum of sprite gPlayMovieBtnSprite to cast "MOVIEU"
  148.   updateStage()
  149.   set the mouseDownScript to EMPTY
  150. end
  151.  
  152. on mouseUp
  153.   global gFirstLinkSprite, gLastLinkSprite, gSpecialAnimSprite, gGoBackBtnSprite, gGoFwrdBtnSprite, gStopBtnSprite, gPlayTopicBtnSndSprite, gPlayMovieBtnSprite, gMovieRectSprite, gPlaySndSprite, gTabclicked, gTabBtnSprite, gFirstChapSprite, gLastChapSprite, gSoundFolder, gGoFwrdBtnSpriteIntro, gTabRectSprite
  154.   set sprt to the clickOn
  155.   if sprt = 0 then
  156.     exit
  157.   end if
  158.   if rollOver(sprt) then
  159.     cursor(4)
  160.     if (sprt >= gFirstLinkSprite) and (sprt <= gLastLinkSprite) then
  161.       if (the frameLabel <> EMPTY) and (the frameLabel <> "stop") then
  162.         set OffsetFrames to sprt - gFirstLinkSprite + 1
  163.         updateMovieSoundBtns(the frame + OffsetFrames)
  164.         go(the frame + OffsetFrames)
  165.       else
  166.         set linkNumber to sprt - gFirstLinkSprite + 1
  167.         set theLinkFrame to RFInfo("link" & linkNumber) + 1
  168.         updateMovieSoundBtns(theLinkFrame)
  169.         go(theLinkFrame)
  170.       end if
  171.     else
  172.       if sprt = gStopBtnSprite then
  173.         puppetSprite(gPlayTopicBtnSndSprite, 0)
  174.         puppetSprite(gPlayMovieBtnSprite, 0)
  175.         updateStage()
  176.         go(label("black"))
  177.         updateStage()
  178.         quit()
  179.       else
  180.         if (sprt >= gFirstChapSprite) and (sprt <= gLastChapSprite) then
  181.           set chapNum to sprt - gFirstChapSprite + 1
  182.           updateMovieSoundBtns(label("chapter" & chapNum))
  183.           go(label("chapter" & chapNum))
  184.           set the mouseDownScript to "soundMouseDownScript"
  185.           set the mouseUpScript to "soundMouseUpScript"
  186.           set soundStopped to 0
  187.           set soundFName to the pathName & gSoundFolder & "SND" & the frame - 1
  188.           sound playFile 1, soundFName
  189.           repeat while soundBusy(1)
  190.             if the mouseDown then
  191.               sound stop 1
  192.               set soundStopped to 1
  193.               dontPassEvent()
  194.               exit repeat
  195.             end if
  196.           end repeat
  197.           if soundStopped = 0 then
  198.             soundMousedownscript()
  199.             soundMouseupscript()
  200.           end if
  201.           cursor(-1)
  202.         else
  203.           if sprt = gGoBackBtnSprite then
  204.             if the frameLabel <> "cover" then
  205.               updateMovieSoundBtns(the frame - 1)
  206.               go(the frame - 1)
  207.             end if
  208.           else
  209.             if sprt = gGoFwrdBtnSprite then
  210.               if the frameLabel <> "stop" then
  211.                 updateMovieSoundBtns(the frame + 1)
  212.                 go(the frame + 1)
  213.               end if
  214.             else
  215.               if sprt = gGoFwrdBtnSpriteIntro then
  216.                 if the frameLabel <> "stop" then
  217.                   updateMovieSoundBtns(the frame + 1)
  218.                   go(the frame + 1)
  219.                 end if
  220.               else
  221.                 if sprt = gPlayTopicBtnSndSprite then
  222.                   set the mouseDownScript to "soundMouseDownScript"
  223.                   set the mouseUpScript to "soundMouseUpScript"
  224.                   set the castNum of sprite gPlayTopicBtnSndSprite to cast "SOUNDE"
  225.                   updateStage()
  226.                   set soundStopped to 0
  227.                   set soundFName to the pathName & gSoundFolder & "SND" & RFInfo("ID")
  228.                   sound playFile 1, soundFName
  229.                   repeat while soundBusy(1)
  230.                     if the mouseDown then
  231.                       sound stop 1
  232.                       set soundStopped to 1
  233.                       dontPassEvent()
  234.                       exit repeat
  235.                     end if
  236.                   end repeat
  237.                   if soundStopped = 0 then
  238.                     soundMousedownscript()
  239.                     soundMouseupscript()
  240.                   end if
  241.                   set the castNum of sprite gPlayTopicBtnSndSprite to cast "SOUNDU"
  242.                   updateStage()
  243.                   cursor(-1)
  244.                 else
  245.                   if sprt = gPlaySndSprite then
  246.                     set the mouseDownScript to "soundMouseDownScript"
  247.                     set the mouseUpScript to "soundMouseUpScript"
  248.                     set soundFName to the pathName & gSoundFolder & RFInfo("extraSound")
  249.                     sound playFile 1, soundFName
  250.                     repeat while soundBusy(1)
  251.                       if the mouseDown then
  252.                         sound stop 1
  253.                         dontPassEvent()
  254.                         exit repeat
  255.                       end if
  256.                     end repeat
  257.                     cursor(-1)
  258.                   else
  259.                     if sprt = gPlayMovieBtnSprite then
  260.                       set movieName to RFInfo("animation")
  261.                       set castNum to the number of cast movieName
  262.                       if castNum = -1 then
  263.                         alert("Sorry. No animation yet.")
  264.                         cursor(-1)
  265.                         exit
  266.                       end if
  267.                       set movieLoc to getMovieLoc(movieName)
  268.                       playDirMoov(movieLoc, movieName)
  269.                     else
  270.                       if sprt = gSpecialAnimSprite then
  271.                         set movieName to RFInfo("animation")
  272.                         playSpecialDirMoov(movieName)
  273.                       end if
  274.                     end if
  275.                   end if
  276.                 end if
  277.               end if
  278.             end if
  279.           end if
  280.         end if
  281.       end if
  282.     end if
  283.     cursor(-1)
  284.   end if
  285. end
  286.  
  287. on mouseDown
  288.   global gFirstLinkSprite, gLastLinkSprite, gSpecialAnimSprite, gGoBackBtnSprite, gGoFwrdBtnSprite, gStopBtnSprite, gPlayTopicBtnSndSprite, gTabBtnSprite, gPlayMovieBtnSprite, gMovieRectSprite, gPlaySndSprite, gTabRectsList, gFirstChapSprite, gLastChapSprite, gTabWidth, gTabHeight, gTabclicked
  289.   set sprt to the clickOn
  290.   set btnStateOffset to 1
  291.   sound stop 1
  292.   sound stop 2
  293.   updateStage()
  294.   if (sprt >= gFirstChapSprite) and (sprt <= gLastChapSprite) then
  295.     set chapNum to sprt - gFirstChapSprite + 1
  296.     set oldcast to the castNum of sprite sprt
  297.     set testChar to char 7 of the name of cast oldcast
  298.     if testChar = "U" then
  299.       set btnStateOffset to 1
  300.     else
  301.       if testChar = "E" then
  302.         set btnStateOffset to -1
  303.       end if
  304.     end if
  305.   end if
  306.   if sprt <> 0 then
  307.     set oldcast to the castNum of sprite sprt
  308.     set newCast to the castNum of sprite sprt + btnStateOffset
  309.     set the castNum of sprite sprt to newCast
  310.     updateStage()
  311.     repeat while the mouseDown
  312.       if rollOver(sprt) then
  313.         set the castNum of sprite sprt to newCast
  314.         updateStage()
  315.         next repeat
  316.       end if
  317.       set the castNum of sprite sprt to oldcast
  318.       updateStage()
  319.     end repeat
  320.   end if
  321. end
  322.  
  323. on waitSound
  324.   repeat while soundBusy(1)
  325.     if the mouseDown then
  326.       sound stop 1
  327.       cursor(-1)
  328.       pause()
  329.       exit repeat
  330.     end if
  331.   end repeat
  332. end
  333.  
  334. on waitVideo
  335.   set the movieRate of sprite 5 to 1
  336.   set movieLen to the duration of cast the castNum of sprite 5
  337.   repeat while the movieTime of sprite 5 < movieLen
  338.     if the mouseDown then
  339.       set the movieRate of sprite 5 to 0
  340.       cursor(-1)
  341.       go(label("moviestop"))
  342.       returnFromDirMovie()
  343.     end if
  344.     updateStage()
  345.   end repeat
  346. end
  347.  
  348. on enterFrame
  349. end
  350.  
  351. on exitFrame
  352.   global gMoovExitFrame, gFirstChapSprite, gLastChapSprite, gLabelLocs, gChapCasts, gAlreadyOverChaps
  353.   set labelSprt to 19
  354.   if gMoovExitFrame = 0 then
  355.     set lastCast to the mouseCast
  356.     if getOne(gChapCasts, lastCast) then
  357.       set lastChap to (lastCast - 38) / 3
  358.       set x to gFirstChapSprite + lastChap - 1
  359.       if gAlreadyOverChaps = 0 then
  360.         startTimer()
  361.         repeat while the timer < 30
  362.           nothing()
  363.         end repeat
  364.       end if
  365.       if rollOver(x) then
  366.         puppetSprite(labelSprt, 1)
  367.         set the stretch of sprite labelSprt to 0
  368.         set lbInfo to getAt(gLabelLocs, lastChap)
  369.         set the castNum of sprite labelSprt to getAt(lbInfo, 1)
  370.         spriteBox(labelSprt, getAt(lbInfo, 2), getAt(lbInfo, 3), getAt(lbInfo, 4), getAt(lbInfo, 5))
  371.         updateStage()
  372.         set gAlreadyOverChaps to 1
  373.         repeat while rollOver(x)
  374.           if the mouseDown then
  375.             exit repeat
  376.           end if
  377.         end repeat
  378.         spriteBox(labelSprt, -100, -100, -50, -50)
  379.         puppetSprite(x, 0)
  380.         updateStage()
  381.       end if
  382.     else
  383.       set gAlreadyOverChaps to 0
  384.     end if
  385.     go(the frame)
  386.   end if
  387. end
  388.  
  389. on playCDsoundNoStop sndName
  390.   global gSoundFolder
  391.   cursor(4)
  392.   set soundFName to the pathName & gSoundFolder & sndName
  393.   sound playFile 1, soundFName
  394. end
  395.  
  396. on playCDsound sndName
  397.   global gSoundFolder
  398.   cursor(4)
  399.   set soundFName to the pathName & gSoundFolder & sndName
  400.   sound playFile 1, soundFName
  401.   repeat while soundBusy(1)
  402.     if the mouseDown then
  403.       sound stop 1
  404.       cursor(-1)
  405.       dontPassEvent()
  406.       returnFromDirMovie()
  407.     end if
  408.   end repeat
  409.   cursor(-1)
  410. end
  411.  
  412. on updateMovieSoundBtns goFrame
  413.   global RFBIndex, gPlayTopicBtnSndSprite, gPlayMovieBtnSprite
  414.   set sndNumber to the castNum of sprite gPlayTopicBtnSndSprite
  415.   set movNumber to the castNum of sprite gPlayMovieBtnSprite
  416.   set movUpNumber to the number of cast "movieU"
  417.   set movUnderNumber to the number of cast "mbt5"
  418.   set sndUpNumber to the number of cast "SoundU"
  419.   set sndUnderNumber to the number of cast "sbt6"
  420.   if (RFInfo("ArtName", goFrame) = "0") and (RFInfo("ArtName", goFrame) <> EMPTY) then
  421.     if sndNumber = sndUpNumber then
  422.       playSndButtonAnim("fwd")
  423.     end if
  424.   else
  425.     if sndNumber = sndUnderNumber then
  426.       playSndButtonAnim("rev")
  427.     end if
  428.   end if
  429.   if RFInfo("animation", goFrame) = EMPTY then
  430.     if movNumber = movUpNumber then
  431.       playMovieButtonAnim("fwd")
  432.     end if
  433.   else
  434.     if movNumber = movUnderNumber then
  435.       playMovieButtonAnim("rev")
  436.     end if
  437.   end if
  438. end
  439.  
  440. on RFInfo query, lookAheadEntry
  441.   global RFBIndex, gChapStartNums
  442.   if integerp(lookAheadEntry) = 1 then
  443.     set indexNum to lookAheadEntry - 1
  444.   else
  445.     set indexNum to the frame - 1
  446.   end if
  447.   if indexNum = 0 then
  448.     return 0
  449.   end if
  450.   if query = "ID" then
  451.     return getAt(getAt(RFBIndex, indexNum), 1)
  452.   else
  453.     if query = "ArtName" then
  454.       return getAt(getAt(RFBIndex, indexNum), 2)
  455.     else
  456.       if query = "Title" then
  457.         return getAt(getAt(RFBIndex, indexNum), 3)
  458.       else
  459.         if query = "link1" then
  460.           return getAt(getAt(RFBIndex, indexNum), 4)
  461.         else
  462.           if query = "link2" then
  463.             return getAt(getAt(RFBIndex, indexNum), 5)
  464.           else
  465.             if query = "link3" then
  466.               return getAt(getAt(RFBIndex, indexNum), 6)
  467.             else
  468.               if query = "link4" then
  469.                 return getAt(getAt(RFBIndex, indexNum), 7)
  470.               else
  471.                 if query = "link5" then
  472.                   return getAt(getAt(RFBIndex, indexNum), 8)
  473.                 else
  474.                   if query = "animation" then
  475.                     return getAt(getAt(RFBIndex, indexNum), 9)
  476.                   else
  477.                     if query = "extraSound" then
  478.                       return getAt(getAt(RFBIndex, indexNum), 10)
  479.                     else
  480.                       if query = "chapter" then
  481.                         repeat with x = count(gChapStartNums) down to 1
  482.                           if indexNum >= getAt(gChapStartNums, x) then
  483.                             return x
  484.                           end if
  485.                         end repeat
  486.                       end if
  487.                     end if
  488.                   end if
  489.                 end if
  490.               end if
  491.             end if
  492.           end if
  493.         end if
  494.       end if
  495.     end if
  496.   end if
  497. end
  498.  
  499. on tabclick thePoint
  500.   global gTabBtnSprite, gTabBtnCast, gTabRectsList, gNumTabs
  501.   repeat with tabNum = 1 to gNumTabs
  502.     set thisTabRect to getAt(gTabRectsList, tabNum)
  503.     if inside(thePoint, thisTabRect) then
  504.       return tabNum
  505.     end if
  506.   end repeat
  507.   return 0
  508. end
  509.  
  510. on pauseTicks tickNumber
  511.   startTimer()
  512.   repeat while the timer < tickNumber
  513.     if the mouseDown then
  514.       exit
  515.     end if
  516.   end repeat
  517. end
  518.  
  519. on playSpecialDirMoov movieName
  520.   global gMoovExitFrame, gCallingFrame
  521.   cursor(4)
  522.   set gCallingFrame to the frame
  523.   set gMoovExitFrame to 1
  524.   set pageCast to the castNum of sprite 1
  525.   set the mouseDownScript to "mymouseDownScript"
  526.   puppetSprite(8, 1)
  527.   set the castNum of sprite 8 to 417
  528.   puppetSprite(1, 1)
  529.   spriteBox(1, -50, -50, -40, -40)
  530.   set the castNum of sprite 1 to pageCast
  531.   spriteBox(1, 0, 0, 640, 480)
  532.   updateStage()
  533.   go(label(movieName))
  534. end
  535.  
  536. on playDirMoov movieLoc, movieName
  537.   global gMoovExitFrame, gCallingFrame, gStartMovframe, gPlayMovieBtnSprite, gTabLoc
  538.   cursor(4)
  539.   set gCallingFrame to the frame
  540.   set gMoovExitFrame to 1
  541.   set pageCast to the castNum of sprite 1
  542.   set sprWt to the width of cast movieName
  543.   set sprHt to the height of cast movieName
  544.   set MovieCastNum to the number of cast movieName
  545.   set the mouseDownScript to "mymouseDownScript"
  546.   set the mouseUpScript to "mymouseUpScript"
  547.   puppetSprite(1, 1)
  548.   spriteBox(1, -50, -50, -40, -40)
  549.   set the castNum of sprite 1 to pageCast
  550.   spriteBox(1, 0, 0, 640, 480)
  551.   updateStage()
  552.   set the visible of sprite 6 to 1
  553.   puppetSprite(6, 1)
  554.   spriteBox(6, -50, -50, -40, -40)
  555.   set the castNum of sprite 6 to MovieCastNum
  556.   spriteBox(6, getAt(movieLoc, 1), getAt(movieLoc, 2), getAt(movieLoc, 1) + sprWt, getAt(movieLoc, 2) + sprHt)
  557.   set the castNum of sprite gPlayMovieBtnSprite to cast "MOVIEE"
  558.   updateStage()
  559.   go(label(movieName))
  560.   set gStartMovframe to the frame
  561.   puppetTempo(6)
  562.   cursor(4)
  563. end
  564.  
  565. on returnFromDirMovie
  566.   global gMoovExitFrame, gCallingFrame, gStartMovframe, gPlayMovieBtnSprite
  567.   puppetTempo(30)
  568.   dontPassEvent()
  569.   cursor(-1)
  570.   updateStage()
  571.   set gMoovExitFrame to 0
  572.   sound stop 1
  573.   puppetSound(0)
  574.   spriteBox(1, -50, -50, -40, -40)
  575.   puppetSprite(1, 0)
  576.   spriteBox(6, -50, -50, -40, -40)
  577.   puppetSprite(6, 0)
  578.   unLoad(gStartMovframe, the frame)
  579.   go(gCallingFrame)
  580.   set the castNum of sprite gPlayMovieBtnSprite to cast "MOVIEU"
  581.   updateStage()
  582.   set the mouseDownScript to EMPTY
  583.   mymouseUpScript()
  584. end
  585.  
  586. on playMoov whichsprite, movieLoc, whichMovieCast
  587.   cursor(4)
  588.   set dummyCast to 23
  589.   go(the frame)
  590.   puppetSprite(whichsprite, 1)
  591.   set spriteWidth to the width of cast whichMovieCast
  592.   set spriteHeight to the height of cast whichMovieCast
  593.   set spriteLeft to getAt(movieLoc, 1)
  594.   set spriteTop to getAt(movieLoc, 2)
  595.   set spriteRight to spriteLeft + spriteWidth
  596.   set spriteBottom to spriteTop + spriteHeight
  597.   spriteBox(whichsprite, -100, -100, -50, -50)
  598.   set the castNum of sprite whichsprite to whichMovieCast
  599.   spriteBox(whichsprite, spriteLeft, spriteTop, spriteRight, spriteBottom)
  600.   updateStage()
  601.   set movieLen to the duration of cast whichMovieCast
  602.   repeat while the movieTime of sprite whichsprite < movieLen
  603.     if the mouseDown then
  604.       exit repeat
  605.     end if
  606.     updateStage()
  607.   end repeat
  608.   set the movieRate of sprite whichsprite to 0
  609.   set the castNum of sprite whichsprite to dummyCast
  610.   spriteBox(whichsprite, 0, 0, 640, 480)
  611.   updateStage()
  612.   spriteBox(whichsprite, -200, -200, 100, 100)
  613.   updateStage()
  614.   puppetSprite(whichsprite, 0)
  615.   cursor(0)
  616.   go(the frame + 1)
  617. end
  618.  
  619. on toggleChapterButton sprt
  620.   set castNumber to the castNum of sprite sprt
  621.   set castName to the name of cast castNumber
  622.   if char 6 of castName = "U" then
  623.     put "D" into char 6 of castName
  624.     set the castNum of sprite sprt to cast castName
  625.     updateStage()
  626.   end if
  627. end
  628.  
  629. on playMovieButtonAnim whichWay
  630. end
  631.  
  632. on playSndButtonAnim whichWay
  633.   global gPlayTopicBtnSndSprite, gSndbtnLocs
  634.   puppetSprite(gPlayTopicBtnSndSprite, 1)
  635.   if whichWay = "fwd" then
  636.     set the castNum of sprite gPlayTopicBtnSndSprite to cast "SOUNDU"
  637.     set the locH of sprite gPlayTopicBtnSndSprite to getAt(getAt(gSndbtnLocs, 1), 1)
  638.     set the locV of sprite gPlayTopicBtnSndSprite to getAt(getAt(gSndbtnLocs, 1), 2)
  639.     updateStage()
  640.     repeat with x = 2 to 7
  641.       set the castNum of sprite gPlayTopicBtnSndSprite to cast ("SBT" & x - 1)
  642.       set the locH of sprite gPlayTopicBtnSndSprite to getAt(getAt(gSndbtnLocs, x), 1)
  643.       set the locV of sprite gPlayTopicBtnSndSprite to getAt(getAt(gSndbtnLocs, x), 2)
  644.       updateStage()
  645.     end repeat
  646.   else
  647.     if whichWay = "rev" then
  648.       repeat with x = 7 down to 2
  649.         set the castNum of sprite gPlayTopicBtnSndSprite to cast ("SBT" & x - 1)
  650.         set the locH of sprite gPlayTopicBtnSndSprite to getAt(getAt(gSndbtnLocs, x), 1)
  651.         set the locV of sprite gPlayTopicBtnSndSprite to getAt(getAt(gSndbtnLocs, x), 2)
  652.         updateStage()
  653.       end repeat
  654.       set the castNum of sprite gPlayTopicBtnSndSprite to cast "SOUNDU"
  655.       set the locH of sprite gPlayTopicBtnSndSprite to getAt(getAt(gSndbtnLocs, 1), 1)
  656.       set the locV of sprite gPlayTopicBtnSndSprite to getAt(getAt(gSndbtnLocs, 1), 2)
  657.       updateStage()
  658.     end if
  659.   end if
  660. end
  661.  
  662. on setSprite whichsprite, xLeft, yTop
  663.   set cstNum to the castNum of sprite whichsprite
  664.   set sprtwdth to the width of sprite whichsprite
  665.   set sprtHite to the height of sprite whichsprite
  666.   spriteBox(whichsprite, xLeft, yTop, xLeft + sprtwdth, yTop + sprtHite)
  667.   updateStage()
  668. end
  669.