home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 February / macformat-047.iso / Demos / Simpsons Cartoon Studio™ Demo / Simpdata / simpmain / 00005_playbackManager parent.ls < prev    next >
Encoding:
Text File  |  1996-09-06  |  18.9 KB  |  585 lines

  1. property theLength, firstRecordingSprNumber, frameCounterMinH, frameNumberMinH, firstKrustyCastNumber, lastKrustyCastNumber, stopButtonCastNumber, theSoundLoop, theFrameNumber, thePreviousSoundLoop, thePreviousSoundFx, theScoreLength, sndLoopDataCnt, sndFXDataCnt, sndLoopDataLast, bgdDataCnt, bgdFXDataCnt, fgdFXDataCnt
  2. global shuttleSpr, shuttleFldSpr, backgroundSpr, playBtnSpr, foregroundFXSpr, backgroundFXSpr, creditSpr, scoreData, dispatchTable, currentFrame, bgdData, fgdFXData, bgdFXData, soundFXData, soundLoopData, PCflag, gLoopFlag, gStopFlag
  3.  
  4. on birth me
  5.   set backgroundSpr to 1
  6.   set creditSpr to 23
  7.   puppetSprite(creditSpr, 1)
  8.   formatTextFields(me)
  9.   puppetSprites(2, 14, 1)
  10.   set firstRecordingSprNumber to 3
  11.   set theLength to 235.0
  12.   set frameCounterMinH to 194
  13.   set frameNumberMinH to 180
  14.   set firstKrustyCastNumber to the number of cast "first krusty"
  15.   set lastKrustyCastNumber to the number of cast "last krusty" - 1
  16.   set stopButtonCastNumber to the number of cast "stop button"
  17.   set theUnloadList to []
  18.   return me
  19. end
  20.  
  21. on playBackClip me, startFrame
  22.   set gStopFlag to 0
  23.   set theScoreLength to count(scoreData)
  24.   set sndLoopDataCnt to count(soundLoopData)
  25.   set sndLoopDataLast to getLast(soundLoopData)
  26.   set sndFXDataCnt to count(soundFXData)
  27.   set bgdFXDataCnt to count(bgdFXData)
  28.   set bgdDataCnt to count(bgdData)
  29.   set fgdFXDataCnt to count(fgdFXData)
  30.   set thePreviousSoundFx to [EMPTY, 0]
  31.   set thePreviousSoundLoop to [EMPTY, 0]
  32.   if (startFrame < theScoreLength) or gLoopFlag then
  33.     if (startFrame <> 1) or (theScoreLength <> 1) then
  34.       repeat with theFrameNumber = startFrame to theScoreLength
  35.         startTimer()
  36.         if stopPlayBack(me) then
  37.           exit
  38.         end if
  39.         playBackSoundLoop(me)
  40.         playBackSoundFX(me)
  41.         playBackBackgrounds(me)
  42.         playBackBackgroundFX(me)
  43.         playBackScoreData(me)
  44.         playBackForegroundFX(me)
  45.         updateStage()
  46.         if stopPlayBack(me) then
  47.           exit
  48.         end if
  49.         setKrusty(me)
  50.         set currentFrame to currentFrame + 1
  51.         repeat while the timer < 5
  52.         end repeat
  53.         if stopPlayBack(me) then
  54.           exit
  55.         end if
  56.       end repeat
  57.       repeat while gLoopFlag
  58.         resetKrusty(me)
  59.         set thePreviousSoundFx to [EMPTY, 0]
  60.         repeat with theFrameNumber = 1 to theScoreLength
  61.           startTimer()
  62.           if stopPlayBack(me) then
  63.             exit
  64.           end if
  65.           playBackSoundLoop(me)
  66.           playBackSoundFX(me)
  67.           playBackBackgrounds(me)
  68.           playBackBackgroundFX(me)
  69.           playBackScoreData(me)
  70.           playBackForegroundFX(me)
  71.           updateStage()
  72.           if stopPlayBack(me) then
  73.             exit
  74.           end if
  75.           setKrusty(me)
  76.           set currentFrame to currentFrame + 1
  77.           repeat while the timer < 5
  78.           end repeat
  79.           if stopPlayBack(me) then
  80.             exit
  81.           end if
  82.         end repeat
  83.       end repeat
  84.       set currentFrame to currentFrame - 1
  85.     end if
  86.   end if
  87.   if soundBusy(1) then
  88.     puppetSound(1, 0)
  89.   end if
  90.   if soundBusy(2) then
  91.     puppetSound(2, 0)
  92.   end if
  93.   playBtnClick(interfaceMgr, playBtnSpr)
  94. end
  95.  
  96. on playBackSoundLoop me
  97.   if sndLoopDataCnt >= theFrameNumber then
  98.     if theFrameNumber > 1 then
  99.       set thePreviousSoundLoop to getAt(soundLoopData, theFrameNumber - 1)
  100.     end if
  101.     set theSoundLoop to getAt(soundLoopData, theFrameNumber)
  102.     set soundLoopCastNum to getAt(theSoundLoop, 2)
  103.     if getAt(thePreviousSoundLoop, 2) <> soundLoopCastNum then
  104.       puppetSound(1, soundLoopCastNum)
  105.       set the text of field "loopStatusField" to getAt(theSoundLoop, 1)
  106.     else
  107.       if not soundBusy(1) then
  108.         puppetSound(1, soundLoopCastNum)
  109.       end if
  110.     end if
  111.   else
  112.     set thePreviousSoundLoop to sndLoopDataLast
  113.     if not soundBusy(1) then
  114.       puppetSound(1, getAt(thePreviousSoundLoop, 2))
  115.     end if
  116.   end if
  117. end
  118.  
  119. on playBackSoundFX me
  120.   if sndFXDataCnt >= theFrameNumber then
  121.     if theFrameNumber > 1 then
  122.       set thePreviousSoundFx to getAt(soundFXData, theFrameNumber - 1)
  123.     end if
  124.     set theSoundFX to getAt(soundFXData, theFrameNumber)
  125.     set soundFXCastNum to getAt(theSoundFX, 2)
  126.     if getAt(thePreviousSoundFx, 2) <> soundFXCastNum then
  127.       if soundFXCastNum <> 0 then
  128.         puppetSound(2, soundFXCastNum)
  129.       end if
  130.     end if
  131.     set the text of field "soundStatusField" to getAt(theSoundFX, 1)
  132.   else
  133.     set the text of field "soundStatusField" to EMPTY
  134.   end if
  135. end
  136.  
  137. on playBackBackgrounds me
  138.   if bgdDataCnt >= theFrameNumber then
  139.     set theBackground to getAt(bgdData, theFrameNumber)
  140.     set the castNum of sprite 1 to getAt(theBackground, 1)
  141.     set the loc of sprite 1 to point(getAt(theBackground, 2), getAt(theBackground, 3))
  142.   end if
  143. end
  144.  
  145. on playBackBackgroundFX me
  146.   if bgdFXDataCnt >= theFrameNumber then
  147.     set theBackgroundFX to getAt(bgdFXData, theFrameNumber)
  148.     if theBackgroundFX <> [EMPTY, 0] then
  149.       set the castNum of sprite 2 to getAt(theBackgroundFX, 2)
  150.       set the loc of sprite 2 to point(313, 218)
  151.     else
  152.       set the locH of sprite 2 to -1000
  153.     end if
  154.   else
  155.     set the locH of sprite 2 to -1000
  156.   end if
  157. end
  158.  
  159. on playBackScoreData me
  160.   set basePlayBackSpr to firstRecordingSprNumber
  161.   set theFrame to getAt(scoreData, theFrameNumber)
  162.   repeat with theLayer in dispatchTable
  163.     set curDataChannel to getAt(theLayer, 3)
  164.     set curclip to getaProp(theFrame, curDataChannel)
  165.     if not (curclip = EMPTY) then
  166.       set the castNum of sprite basePlayBackSpr to getAt(curclip, 1)
  167.       set the loc of sprite basePlayBackSpr to point(getAt(curclip, 2), getAt(curclip, 3))
  168.     else
  169.       set the locH of sprite basePlayBackSpr to -1000
  170.     end if
  171.     set basePlayBackSpr to basePlayBackSpr + 1
  172.   end repeat
  173. end
  174.  
  175. on playBackForegroundFX me
  176.   if fgdFXDataCnt >= theFrameNumber then
  177.     set theforegroundFX to getAt(fgdFXData, theFrameNumber)
  178.     if not (theforegroundFX = EMPTY) then
  179.       set the castNum of sprite foregroundFXSpr to getAt(theforegroundFX, 1)
  180.       set the loc of sprite foregroundFXSpr to point(getAt(theforegroundFX, 2), getAt(theforegroundFX, 3))
  181.     else
  182.       set the locH of sprite foregroundFXSpr to -1000
  183.     end if
  184.   else
  185.     set the locH of sprite foregroundFXSpr to -1000
  186.   end if
  187. end
  188.  
  189. on displaySoundName me
  190.   if sndLoopDataCnt >= theFrameNumber then
  191.     set theSoundLoop to getAt(soundLoopData, theFrameNumber)
  192.     set the text of field "loopStatusField" to getAt(theSoundLoop, 1)
  193.   end if
  194.   if sndFXDataCnt >= theFrameNumber then
  195.     set theSoundFX to getAt(soundFXData, theFrameNumber)
  196.     set the text of field "soundStatusField" to getAt(theSoundFX, 1)
  197.   else
  198.     set the text of field "soundStatusField" to EMPTY
  199.   end if
  200. end
  201.  
  202. on stopPlayBack me
  203.   if the mouseDown then
  204.     if the mouseCast = stopButtonCastNumber then
  205.       if soundBusy(1) then
  206.         puppetSound(1, 0)
  207.       end if
  208.       if soundBusy(2) then
  209.         puppetSound(2, 0)
  210.       end if
  211.       playBtnClick(interfaceMgr, playBtnSpr)
  212.       return 1
  213.     end if
  214.   end if
  215.   if the shiftDown then
  216.     if soundBusy(1) then
  217.       puppetSound(1, 0)
  218.     end if
  219.     if soundBusy(2) then
  220.       puppetSound(2, 0)
  221.     end if
  222.     playBtnClick(interfaceMgr, playBtnSpr)
  223.     return 1
  224.   end if
  225.   return 0
  226. end
  227.  
  228. on setKrustyForRecording me
  229.   set numberOfFrames to count(scoreData)
  230.   if currentFrame > numberOfFrames then
  231.     set numberOfFrames to currentFrame
  232.   end if
  233.   if numberOfFrames > 1 then
  234.     set theDivisor to numberOfFrames - 1
  235.     set theIncrement to float(theLength) / float(theDivisor)
  236.     set theDistance to float(currentFrame - 1) * theIncrement
  237.     if the castNum of sprite shuttleSpr > lastKrustyCastNumber then
  238.       set the castNum of sprite shuttleSpr to firstKrustyCastNumber
  239.     else
  240.       set the castNum of sprite shuttleSpr to the castNum of sprite shuttleSpr + 1
  241.     end if
  242.     set the text of field "frameNumber" to string(currentFrame)
  243.     set the locH of sprite shuttleSpr to frameCounterMinH + theDistance
  244.     set the locH of sprite shuttleFldSpr to frameNumberMinH + theDistance
  245.   else
  246.     resetKrusty(me)
  247.   end if
  248. end
  249.  
  250. on incrementCounter me
  251.   if the castNum of sprite shuttleSpr > lastKrustyCastNumber then
  252.     set the castNum of sprite shuttleSpr to firstKrustyCastNumber
  253.   else
  254.     set the castNum of sprite shuttleSpr to the castNum of sprite shuttleSpr + 1
  255.   end if
  256.   set the text of field "frameNumber" to string(currentFrame)
  257. end
  258.  
  259. on setKrusty me
  260.   set numberOfFrames to count(scoreData)
  261.   if numberOfFrames > 1 then
  262.     if the castNum of sprite shuttleSpr > lastKrustyCastNumber then
  263.       set the castNum of sprite shuttleSpr to firstKrustyCastNumber
  264.     else
  265.       set the castNum of sprite shuttleSpr to the castNum of sprite shuttleSpr + 1
  266.     end if
  267.     set theDivisor to numberOfFrames - 1
  268.     set theIncrement to float(theLength) / float(theDivisor)
  269.     set theDistance to float(currentFrame - 1) * theIncrement
  270.     set the text of field "frameNumber" to string(currentFrame)
  271.     set the locH of sprite shuttleSpr to frameCounterMinH + theDistance
  272.     set the locH of sprite shuttleFldSpr to frameNumberMinH + theDistance
  273.   else
  274.     resetKrusty(me)
  275.   end if
  276. end
  277.  
  278. on updateKrusty me
  279.   set theDivisor to float(count(scoreData))
  280.   if theDivisor > 0 then
  281.     set theIncrement to theLength / theDivisor
  282.   end if
  283.   if theIncrement < 1.0 then
  284.     set theIncrement to 1.0
  285.   end if
  286.   if the castNum of sprite shuttleSpr > lastKrustyCastNumber then
  287.     set the castNum of sprite shuttleSpr to firstKrustyCastNumber
  288.   else
  289.     set the castNum of sprite shuttleSpr to the castNum of sprite shuttleSpr + 1
  290.   end if
  291.   set the text of field "frameNumber" to string(currentFrame)
  292.   if the locH of sprite shuttleSpr <= (frameCounterMinH + theLength) then
  293.     set the locH of sprite shuttleSpr to the locH of sprite shuttleSpr + theIncrement
  294.     set the locH of sprite shuttleFldSpr to the locH of sprite shuttleFldSpr + theIncrement
  295.   end if
  296. end
  297.  
  298. on resetKrusty me
  299.   set the text of field "frameNumber" to "1"
  300.   set the locH of sprite shuttleSpr to frameCounterMinH
  301.   set the locH of sprite shuttleFldSpr to frameNumberMinH
  302.   resetFrameCounter()
  303. end
  304.  
  305. on showFrame me, whichFrame, theFilterSlot
  306.   set theFilterSlotMinus2 to theFilterSlot - 2
  307.   showFrameBackground(me, whichFrame)
  308.   if theFilterSlot <> backgroundFXSpr then
  309.     showFrameBackgroundFX(me, whichFrame)
  310.   end if
  311.   set theFrame to getAt(scoreData, whichFrame)
  312.   set basePlayBackSpr to firstRecordingSprNumber
  313.   set dispatchTableCount to count(dispatchTable)
  314.   repeat with theLayer = 1 to dispatchTableCount
  315.     if theFilterSlotMinus2 <> theLayer then
  316.       showFrameLayer(me, theLayer, basePlayBackSpr, theFrame)
  317.     end if
  318.     set basePlayBackSpr to basePlayBackSpr + 1
  319.   end repeat
  320.   if dispatchTableCount < 12 then
  321.     repeat with theLayer = dispatchTableCount + 1 to 12
  322.       set the locH of sprite basePlayBackSpr to -1000
  323.       set basePlayBackSpr to basePlayBackSpr + 1
  324.     end repeat
  325.   end if
  326.   if theFilterSlot <> foregroundFXSpr then
  327.     showFrameForegroundFX(me, whichFrame)
  328.   end if
  329.   displaySound(me, whichFrame)
  330.   updateStage()
  331. end
  332.  
  333. on showFrameLayer me, theLayer, basePlayBackSpr, theFrame
  334.   set curclip to getaProp(theFrame, getAt(getAt(dispatchTable, theLayer), 3))
  335.   if curclip = EMPTY then
  336.     set the locH of sprite basePlayBackSpr to -1000
  337.   else
  338.     set the castNum of sprite basePlayBackSpr to getAt(curclip, 1)
  339.     set the loc of sprite basePlayBackSpr to point(getAt(curclip, 2), getAt(curclip, 3))
  340.   end if
  341. end
  342.  
  343. on showFrameBackground me, whichFrame
  344.   if whichFrame <= count(bgdData) then
  345.     set theBackground to getAt(bgdData, whichFrame)
  346.   else
  347.     set theBackground to getLast(bgdData)
  348.   end if
  349.   set the castNum of sprite 1 to getAt(theBackground, 1)
  350.   set the loc of sprite 1 to point(getAt(theBackground, 2), getAt(theBackground, 3))
  351. end
  352.  
  353. on showFrameBackgroundFX me, whichFrame
  354.   if whichFrame <= count(bgdFXData) then
  355.     set theBackgroundFX to getAt(bgdFXData, whichFrame)
  356.     if theBackgroundFX = [EMPTY, 0] then
  357.       set the locH of sprite 2 to -1000
  358.     else
  359.       set the castNum of sprite 2 to getAt(theBackgroundFX, 2)
  360.       set the loc of sprite 2 to point(313, 218)
  361.     end if
  362.   else
  363.     set the locH of sprite 2 to -1000
  364.   end if
  365. end
  366.  
  367. on showFrameForegroundFX me, whichFrame
  368.   if whichFrame <= count(fgdFXData) then
  369.     set theforegroundFX to getAt(fgdFXData, whichFrame)
  370.     if theforegroundFX = EMPTY then
  371.       set the locH of sprite foregroundFXSpr to -1000
  372.     else
  373.       set the castNum of sprite foregroundFXSpr to getAt(theforegroundFX, 1)
  374.       set the loc of sprite foregroundFXSpr to point(getAt(theforegroundFX, 2), getAt(theforegroundFX, 3))
  375.     end if
  376.   else
  377.     set the locH of sprite foregroundFXSpr to -1000
  378.   end if
  379. end
  380.  
  381. on displaySound me, whichFrame
  382.   if whichFrame <= count(soundLoopData) then
  383.     set the text of field "loopStatusField" to getAt(getAt(soundLoopData, whichFrame), 1)
  384.   else
  385.     set the text of field "loopStatusField" to getAt(getLast(soundLoopData), 1)
  386.   end if
  387.   if whichFrame <= count(soundFXData) then
  388.     set the text of field "soundStatusField" to getAt(getAt(soundFXData, whichFrame), 1)
  389.   else
  390.     set the text of field "soundStatusField" to EMPTY
  391.   end if
  392. end
  393.  
  394. on rewind me
  395.   if count(scoreData) > 0 then
  396.     showFrame(me, 1, 0)
  397.     resetKrusty(me)
  398.     updateStage()
  399.   end if
  400. end
  401.  
  402. on fastForward me
  403.   set lastFrame to count(scoreData)
  404.   if lastFrame > 0 then
  405.     set currentFrame to lastFrame
  406.     showFrame(me, lastFrame, 0)
  407.     setKrusty(me)
  408.     updateStage()
  409.   end if
  410. end
  411.  
  412. on stepBack me
  413.   if currentFrame > 1 then
  414.     decrementFrame()
  415.     showFrame(me, currentFrame, 0)
  416.     setKrusty(me)
  417.     updateStage()
  418.   end if
  419. end
  420.  
  421. on stepForward me
  422.   if currentFrame < count(scoreData) then
  423.     incrementFrame()
  424.     showFrame(me, currentFrame, 0)
  425.     setKrusty(me)
  426.     updateStage()
  427.   end if
  428. end
  429.  
  430. on moveKrusty me
  431.   if (the mouseH < (frameCounterMinH - 15)) or (the mouseH > (frameCounterMinH + theLength + 15)) then
  432.     exit
  433.   end if
  434.   set theScoreLength to count(scoreData)
  435.   if theScoreLength > 1 then
  436.     set theDivisor to float(theScoreLength + 1)
  437.     if theDivisor > 0 then
  438.       set theIncrement to theLength / theDivisor
  439.     end if
  440.     repeat while the mouseDown
  441.       if the mouseH <= frameCounterMinH then
  442.         rewind(me)
  443.         next repeat
  444.       end if
  445.       if the mouseH >= (frameCounterMinH + theLength) then
  446.         fastForward(me)
  447.         next repeat
  448.       end if
  449.       set the locH of sprite shuttleSpr to the mouseH
  450.       set the locH of sprite shuttleFldSpr to the mouseH - 13
  451.       set whichFrame to integer((the locH of sprite shuttleSpr - frameCounterMinH) / theIncrement)
  452.       if whichFrame < 1 then
  453.         set whichFrame to 1
  454.       else
  455.         if whichFrame > theScoreLength then
  456.           set whichFrame to theScoreLength
  457.         end if
  458.       end if
  459.       if whichFrame <= theScoreLength then
  460.         if currentFrame < whichFrame then
  461.           if the castNum of sprite shuttleSpr >= lastKrustyCastNumber then
  462.             set the castNum of sprite shuttleSpr to firstKrustyCastNumber
  463.           else
  464.             set the castNum of sprite shuttleSpr to the castNum of sprite shuttleSpr + 1
  465.           end if
  466.         else
  467.           if currentFrame > whichFrame then
  468.             if the castNum of sprite shuttleSpr <= firstKrustyCastNumber then
  469.               set the castNum of sprite shuttleSpr to lastKrustyCastNumber
  470.             else
  471.               set the castNum of sprite shuttleSpr to the castNum of sprite shuttleSpr - 1
  472.             end if
  473.           end if
  474.         end if
  475.         set currentFrame to whichFrame
  476.         set the text of field "frameNumber" to string(currentFrame)
  477.         updateStage()
  478.         showFrame(me, whichFrame, 0)
  479.       end if
  480.     end repeat
  481.   end if
  482. end
  483.  
  484. on preview me
  485.   set backgroundSprH to the locH of sprite 1
  486.   set the locH of sprite 1 to -1000
  487.   repeat with i = 2 to 14
  488.     set the castNum of sprite i to the number of cast "placeholder cast"
  489.     set the locH of sprite i to -1000
  490.   end repeat
  491.   set the castNum of sprite 16 to the number of cast "placeholder cast"
  492.   set the locH of sprite 16 to -1000
  493.   set creditRect to the rect of sprite creditSpr
  494.   set creditHeight to getAt(creditRect, 4) - getAt(creditRect, 2)
  495.   doTitleFade(me, creditHeight)
  496.   doCreditScroll(me, creditHeight)
  497.   set the locH of sprite 1 to backgroundSprH
  498.   rewind(me)
  499.   playBackClip(me, 1)
  500. end
  501.  
  502. on doTitleFade me, creditHeight
  503.   set theCreditCast to the castNum of sprite creditSpr
  504.   set theTitle to getCurrentCartoonName(fileMgr)
  505.   set the text of field "creditScreenField" to theTitle
  506.   set the textSize of field "creditScreenField" to 36
  507.   set the loc of sprite creditSpr to point(85, 190)
  508.   repeat with theColor = 255 down to 245
  509.     set the foreColor of cast theCreditCast to theColor
  510.     updateStage()
  511.   end repeat
  512.   set titleTime to 60 + (length(theTitle) * 5)
  513.   set freeze to the timer
  514.   repeat while the timer < (freeze + titleTime)
  515.     if the mouseDown then
  516.       exit repeat
  517.     end if
  518.   end repeat
  519.   repeat with theColor = 245 to 255
  520.     set the foreColor of cast theCreditCast to theColor
  521.     updateStage()
  522.   end repeat
  523.   set the locH of sprite creditSpr to -1000
  524.   updateStage()
  525. end
  526.  
  527. on doCreditScroll me, creditHeight
  528.   set theCredits to getCurrentCartoonCredits(fileMgr)
  529.   if theCredits <> EMPTY then
  530.     set defaultCredits to RETURN & "PUT" & RETURN & RETURN & "YOUR" & RETURN & RETURN & "CREDITS" & RETURN & RETURN & "HERE"
  531.     if theCredits <> defaultCredits then
  532.       set theCreditCast to the castNum of sprite creditSpr
  533.       set the text of field "creditScreenField" to theCredits
  534.       set the textSize of field "creditScreenField" to 24
  535.       set the foreColor of cast theCreditCast to 9
  536.       set topEdge to 36
  537.       set bottomEdge to 401
  538.       set the loc of sprite creditSpr to point(85, bottomEdge)
  539.       updateStage()
  540.       set limit to topEdge - creditHeight
  541.       repeat while the locV of sprite creditSpr > limit
  542.         set the locV of sprite creditSpr to the locV of sprite creditSpr - 3
  543.         updateStage()
  544.         if the mouseDown then
  545.           exit repeat
  546.         end if
  547.       end repeat
  548.       set the locH of sprite creditSpr to -1000
  549.       updateStage()
  550.     end if
  551.   end if
  552. end
  553.  
  554. on formatTextFields me
  555.   if PCflag then
  556.     set the textFont of field "frameNumber" to "Arial"
  557.     set the textSize of field "frameNumber" to 9
  558.     set the textStyle of field "frameNumber" to "plain"
  559.     set the textFont of field "creditScreenField" to "Arial"
  560.     set the textSize of field "creditScreenField" to 36
  561.     set the textStyle of field "creditScreenField" to "bold"
  562.   else
  563.     set the textFont of field "frameNumber" to "Geneva"
  564.     set the textSize of field "frameNumber" to 9
  565.     set the textStyle of field "frameNumber" to "plain"
  566.     set the textFont of field "creditScreenField" to "Geneva"
  567.     set the textSize of field "creditScreenField" to 36
  568.     set the textStyle of field "creditScreenField" to "bold"
  569.   end if
  570. end
  571.  
  572. on previewSound me, theCategory, currentBank, paletteIndex
  573.   puppetSound(1, 0)
  574.   puppetSound(2, 0)
  575.   set clipDataField to theCategory & "data"
  576.   set currentClipLine to ((currentBank - 1) * 10) + paletteIndex
  577.   set curClipRecord to value(line currentClipLine of field clipDataField)
  578.   if listp(curClipRecord) then
  579.     set soundCastNum to getAt(curClipRecord, 3)
  580.     puppetSound(1, soundCastNum)
  581.   else
  582.     put "no clip record available"
  583.   end if
  584. end
  585.