home *** CD-ROM | disk | FTP | other *** search
- on replay playSpr
- global kBaseReplaySpr, dispatchTable, kNbChannels, curFrame, scoreData, kFrameCue, soundData, loopFlag
- repeat while the mouseDown
- end repeat
- set userClicked to 0
- set nbFrames to count(scoreData)
- set stopCastNum to the number of cast "stopBtn"
- if (curFrame >= nbFrames) and not loopFlag then
- exit
- end if
- preloadSounds()
- if curFrame <> 1 then
- triggerSound(1)
- end if
- repeat while curFrame <= nbFrames
- startTimer()
- displayBgd(curFrame)
- triggerSound()
- displayFX(curFrame)
- set curReplaySpr to kBaseReplaySpr
- set slotNum to 1
- repeat with curSlot in dispatchTable
- set dataChannel to getAt(curSlot, 3)
- set curCell to getAnimCell(curFrame, dataChannel)
- if curCell <> 0 then
- set the castNum of sprite curReplaySpr to adjustCastNum(getAt(curCell, 1))
- set the locH of sprite curReplaySpr to getAt(curCell, 2) - 80
- set the locV of sprite curReplaySpr to getAt(curCell, 3) - 35
- else
- set the locH of sprite curReplaySpr to -1000
- end if
- set curReplaySpr to curReplaySpr + 1
- end repeat
- updateShuttle()
- updateStage()
- set curFrame to curFrame + 1
- if the mouseDown then
- set curFrame to curFrame - (curFrame <> 1)
- set userClicked to 1
- exit repeat
- end if
- repeat while the timer < kFrameCue
- end repeat
- if loopFlag and (curFrame > nbFrames) then
- set curFrame to 1
- end if
- end repeat
- set curFrame to curFrame - (curFrame <> 1)
- sound stop 1
- sound stop 2
- puppetSound(0)
- updateStage()
- if userClicked then
- puppetSound("pop")
- updateStage()
- end if
- set the castNum of sprite playSpr to the number of cast "stopBtn.h"
- updateStage()
- doPause(4)
- set the castNum of sprite playSpr to the number of cast "playBtn"
- updateStage()
- end
-
- on displayFrame frameNum, filterChannel
- global curLayer, scoreData, kNbChannels, kBaseReplaySpr, dispatchTable, kRecordSpr
- if scoreData = [] then
- exit
- end if
- set curLength to count(scoreData)
- set slotNum to 0
- set curReplaySpr to kBaseReplaySpr
- displayBgd(frameNum)
- displayFX(frameNum)
- repeat with curSlot in dispatchTable
- set slotNum to slotNum + 1
- set dataChannel to getAt(curSlot, 3)
- set curCell to getAnimCell(frameNum, dataChannel)
- if dataChannel = filterChannel then
- if curCell <> 0 then
- set the castNum of sprite kRecordSpr to adjustCastNum(getAt(curCell, 1))
- set the locH of sprite kRecordSpr to getAt(curCell, 2) - 80
- set the locV of sprite kRecordSpr to getAt(curCell, 3) - 35
- else
- set the locH of sprite kRecordSpr to -1000
- end if
- else
- if curCell <> 0 then
- set the castNum of sprite curReplaySpr to adjustCastNum(getAt(curCell, 1))
- set the locH of sprite curReplaySpr to getAt(curCell, 2) - 80
- set the locV of sprite curReplaySpr to getAt(curCell, 3) - 35
- else
- set the locH of sprite curReplaySpr to -1000
- end if
- end if
- set curReplaySpr to curReplaySpr + 1
- end repeat
- updateStage()
- end
-