home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- 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
- clearGlobals()
- set gAlreadyOverChaps to 0
- if the machineType = 256 then
- set gSoundFolder to "PFBSOUND\"
- else
- set gSoundFolder to "PFBSOUND:"
- end if
- set lb1 to the number of cast "SCROLL_1"
- set lb2 to the number of cast "SCROLL_2"
- set lb3 to the number of cast "SCROLL_3"
- set lb4 to the number of cast "SCROLL_4"
- set lb5 to the number of cast "SCROLL_5"
- set lb6 to the number of cast "SCROLL_6"
- set lb7 to the number of cast "SCROLL_7"
- set lb8 to the number of cast "SCROLL_8"
- 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]
- 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]]
- cursor(4)
- set the mouseDownScript to "lockMouseDownscript"
- set the mouseUpScript to "lockMouseUpscript"
- set the keyDownScript to "doCommandKey"
- set gTabLoc to [605, 231]
- set gChapStartNums to [1, 7, 18, 28, 34, 48, 68, 79]
- set gQTlocs to [[303, 59]]
- set gMvbtnLocs to [[50, 174], [49, 174], [49, 174], [49, 174], [49, 174], [49, 173], [49, 173]]
- set gSndbtnLocs to [[50, 115], [50, 115], [50, 115], [50, 115], [50, 114], [50, 114], [50, 114]]
- set gTabRectSprite to 2
- set gGoBackBtnSprite to 3
- set gGoFwrdBtnSprite to 4
- set gGoFwrdBtnSpriteIntro to 48
- set gStopBtnSprite to 5
- set gTabBtnSprite to 6
- set gPlayTopicBtnSndSprite to 7
- set gPlayMovieBtnSprite to 8
- set gPlaySndSprite to 9
- set gMovieRectSprite to 10
- set gFirstChapSprite to 11
- set gLastChapSprite to 18
- set gAllChapSprites to [11, 12, 13, 14, 15, 16, 17, 18]
- set gFirstLinkSprite to 20
- set gLastLinkSprite to 40
- set gSpecialAnimSprite to 41
- set the centerStage to 1
- initTabLocs()
- initRFIndex()
- set the mouseDownScript to EMPTY
- set the mouseUpScript to EMPTY
- cursor(-1)
- end
-
- on keyDown
- dontPassEvent()
- end
-
- on keyUp
- dontPassEvent()
- end
-
- on initRFIndex
- global RFBIndex
- set RFBIndex to value(field "rfb index")
- end
-
- on getMovieLoc movieName
- global gQTlocs
- set emptylist to list(0)
- set letterCharPos to length(movieName)
- set testLetterChar to char letterCharPos of movieName
- set indexAsciiVal to charToNum(testLetterChar) - 64
- if indexAsciiVal > count(gQTlocs) then
- return emptylist
- else
- return getAt(gQTlocs, indexAsciiVal)
- end if
- end
-
- on initTabLocs
- global gTabRectsList, gHiliteTabRectsList, gNumTabs, gTabWidth, gTabHeight
- set tabStartX to 582
- set tabStartY to 31
- set gTabWidth to 27
- set gTabHeight to 44
- set tabEndX to tabStartX + gTabWidth
- set tabEndY to 370
- set tabGap to 5
- set gNumTabs to 7
- set gTabRectsList to list(0)
- repeat with tabNum = 1 to gNumTabs
- set thisTabY1 to tabStartY + ((gTabHeight + tabGap) * (tabNum - 1))
- set thisTabY2 to thisTabY1 + gTabHeight
- set thisTabRect to rect(tabStartX, thisTabY1, tabEndX, thisTabY2)
- set thisTabRect to rect(tabStartX, thisTabY1, tabEndX, thisTabY2)
- setAt(gTabRectsList, tabNum, thisTabRect)
- end repeat
- end
-
- on docommandKey
- if the commandDown and (the key = ".") then
- dontPassEvent()
- end if
- end
-
- on lockMousedownscript
- dontPassEvent()
- end
-
- on lockMouseUpscript
- dontPassEvent()
- end
-
- on soundMousedownscript
- dontPassEvent()
- set the mouseDownScript to EMPTY
- end
-
- on soundMouseupscript
- cursor(-1)
- dontPassEvent()
- set the mouseUpScript to EMPTY
- end
-
- on mymouseUpScript
- cursor(-1)
- dontPassEvent()
- set the mouseUpScript to EMPTY
- end
-
- on mymouseDownScript
- global gMoovExitFrame, gCallingFrame, mouseDown, gStartMovframe, gPlayMovieBtnSprite
- pause()
- cursor(4)
- dontPassEvent()
- set gMoovExitFrame to 0
- sound stop 1
- sound stop 2
- puppetSound(0)
- cursor(-1)
- updateStage()
- spriteBox(1, -50, -50, -40, -40)
- puppetSprite(1, 0)
- spriteBox(6, -50, -50, -40, -40)
- puppetSprite(6, 0)
- unLoad(gStartMovframe, the frame)
- go(gCallingFrame)
- set the castNum of sprite gPlayMovieBtnSprite to cast "MOVIEU"
- updateStage()
- set the mouseDownScript to EMPTY
- end
-
- on mouseUp
- global gFirstLinkSprite, gLastLinkSprite, gSpecialAnimSprite, gGoBackBtnSprite, gGoFwrdBtnSprite, gStopBtnSprite, gPlayTopicBtnSndSprite, gPlayMovieBtnSprite, gMovieRectSprite, gPlaySndSprite, gTabclicked, gTabBtnSprite, gFirstChapSprite, gLastChapSprite, gSoundFolder, gGoFwrdBtnSpriteIntro, gTabRectSprite
- set sprt to the clickOn
- if sprt = 0 then
- exit
- end if
- if rollOver(sprt) then
- cursor(4)
- if (sprt >= gFirstLinkSprite) and (sprt <= gLastLinkSprite) then
- if (the frameLabel <> EMPTY) and (the frameLabel <> "stop") then
- set OffsetFrames to sprt - gFirstLinkSprite + 1
- updateMovieSoundBtns(the frame + OffsetFrames)
- go(the frame + OffsetFrames)
- else
- set linkNumber to sprt - gFirstLinkSprite + 1
- set theLinkFrame to RFInfo("link" & linkNumber) + 1
- updateMovieSoundBtns(theLinkFrame)
- go(theLinkFrame)
- end if
- else
- if sprt = gStopBtnSprite then
- puppetSprite(gPlayTopicBtnSndSprite, 0)
- puppetSprite(gPlayMovieBtnSprite, 0)
- updateStage()
- go(label("black"))
- updateStage()
- quit()
- else
- if (sprt >= gFirstChapSprite) and (sprt <= gLastChapSprite) then
- set chapNum to sprt - gFirstChapSprite + 1
- updateMovieSoundBtns(label("chapter" & chapNum))
- go(label("chapter" & chapNum))
- set the mouseDownScript to "soundMouseDownScript"
- set the mouseUpScript to "soundMouseUpScript"
- set soundStopped to 0
- set soundFName to the pathName & gSoundFolder & "SND" & the frame - 1
- sound playFile 1, soundFName
- repeat while soundBusy(1)
- if the mouseDown then
- sound stop 1
- set soundStopped to 1
- dontPassEvent()
- exit repeat
- end if
- end repeat
- if soundStopped = 0 then
- soundMousedownscript()
- soundMouseupscript()
- end if
- cursor(-1)
- else
- if sprt = gGoBackBtnSprite then
- if the frameLabel <> "cover" then
- updateMovieSoundBtns(the frame - 1)
- go(the frame - 1)
- end if
- else
- if sprt = gGoFwrdBtnSprite then
- if the frameLabel <> "stop" then
- updateMovieSoundBtns(the frame + 1)
- go(the frame + 1)
- end if
- else
- if sprt = gGoFwrdBtnSpriteIntro then
- if the frameLabel <> "stop" then
- updateMovieSoundBtns(the frame + 1)
- go(the frame + 1)
- end if
- else
- if sprt = gPlayTopicBtnSndSprite then
- set the mouseDownScript to "soundMouseDownScript"
- set the mouseUpScript to "soundMouseUpScript"
- set the castNum of sprite gPlayTopicBtnSndSprite to cast "SOUNDE"
- updateStage()
- set soundStopped to 0
- set soundFName to the pathName & gSoundFolder & "SND" & RFInfo("ID")
- sound playFile 1, soundFName
- repeat while soundBusy(1)
- if the mouseDown then
- sound stop 1
- set soundStopped to 1
- dontPassEvent()
- exit repeat
- end if
- end repeat
- if soundStopped = 0 then
- soundMousedownscript()
- soundMouseupscript()
- end if
- set the castNum of sprite gPlayTopicBtnSndSprite to cast "SOUNDU"
- updateStage()
- cursor(-1)
- else
- if sprt = gPlaySndSprite then
- set the mouseDownScript to "soundMouseDownScript"
- set the mouseUpScript to "soundMouseUpScript"
- set soundFName to the pathName & gSoundFolder & RFInfo("extraSound")
- sound playFile 1, soundFName
- repeat while soundBusy(1)
- if the mouseDown then
- sound stop 1
- dontPassEvent()
- exit repeat
- end if
- end repeat
- cursor(-1)
- else
- if sprt = gPlayMovieBtnSprite then
- set movieName to RFInfo("animation")
- set castNum to the number of cast movieName
- if castNum = -1 then
- alert("Sorry. No animation yet.")
- cursor(-1)
- exit
- end if
- set movieLoc to getMovieLoc(movieName)
- playDirMoov(movieLoc, movieName)
- else
- if sprt = gSpecialAnimSprite then
- set movieName to RFInfo("animation")
- playSpecialDirMoov(movieName)
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- cursor(-1)
- end if
- end
-
- on mouseDown
- global gFirstLinkSprite, gLastLinkSprite, gSpecialAnimSprite, gGoBackBtnSprite, gGoFwrdBtnSprite, gStopBtnSprite, gPlayTopicBtnSndSprite, gTabBtnSprite, gPlayMovieBtnSprite, gMovieRectSprite, gPlaySndSprite, gTabRectsList, gFirstChapSprite, gLastChapSprite, gTabWidth, gTabHeight, gTabclicked
- set sprt to the clickOn
- set btnStateOffset to 1
- sound stop 1
- sound stop 2
- updateStage()
- if (sprt >= gFirstChapSprite) and (sprt <= gLastChapSprite) then
- set chapNum to sprt - gFirstChapSprite + 1
- set oldcast to the castNum of sprite sprt
- set testChar to char 7 of the name of cast oldcast
- if testChar = "U" then
- set btnStateOffset to 1
- else
- if testChar = "E" then
- set btnStateOffset to -1
- end if
- end if
- end if
- if sprt <> 0 then
- set oldcast to the castNum of sprite sprt
- set newCast to the castNum of sprite sprt + btnStateOffset
- set the castNum of sprite sprt to newCast
- updateStage()
- repeat while the mouseDown
- if rollOver(sprt) then
- set the castNum of sprite sprt to newCast
- updateStage()
- next repeat
- end if
- set the castNum of sprite sprt to oldcast
- updateStage()
- end repeat
- end if
- end
-
- on waitSound
- repeat while soundBusy(1)
- if the mouseDown then
- sound stop 1
- cursor(-1)
- pause()
- exit repeat
- end if
- end repeat
- end
-
- on waitVideo
- set the movieRate of sprite 5 to 1
- set movieLen to the duration of cast the castNum of sprite 5
- repeat while the movieTime of sprite 5 < movieLen
- if the mouseDown then
- set the movieRate of sprite 5 to 0
- cursor(-1)
- go(label("moviestop"))
- returnFromDirMovie()
- end if
- updateStage()
- end repeat
- end
-
- on enterFrame
- end
-
- on exitFrame
- global gMoovExitFrame, gFirstChapSprite, gLastChapSprite, gLabelLocs, gChapCasts, gAlreadyOverChaps
- set labelSprt to 19
- if gMoovExitFrame = 0 then
- set lastCast to the mouseCast
- if getOne(gChapCasts, lastCast) then
- set lastChap to (lastCast - 38) / 3
- set x to gFirstChapSprite + lastChap - 1
- if gAlreadyOverChaps = 0 then
- startTimer()
- repeat while the timer < 30
- nothing()
- end repeat
- end if
- if rollOver(x) then
- puppetSprite(labelSprt, 1)
- set the stretch of sprite labelSprt to 0
- set lbInfo to getAt(gLabelLocs, lastChap)
- set the castNum of sprite labelSprt to getAt(lbInfo, 1)
- spriteBox(labelSprt, getAt(lbInfo, 2), getAt(lbInfo, 3), getAt(lbInfo, 4), getAt(lbInfo, 5))
- updateStage()
- set gAlreadyOverChaps to 1
- repeat while rollOver(x)
- if the mouseDown then
- exit repeat
- end if
- end repeat
- spriteBox(labelSprt, -100, -100, -50, -50)
- puppetSprite(x, 0)
- updateStage()
- end if
- else
- set gAlreadyOverChaps to 0
- end if
- go(the frame)
- end if
- end
-
- on playCDsoundNoStop sndName
- global gSoundFolder
- cursor(4)
- set soundFName to the pathName & gSoundFolder & sndName
- sound playFile 1, soundFName
- end
-
- on playCDsound sndName
- global gSoundFolder
- cursor(4)
- set soundFName to the pathName & gSoundFolder & sndName
- sound playFile 1, soundFName
- repeat while soundBusy(1)
- if the mouseDown then
- sound stop 1
- cursor(-1)
- dontPassEvent()
- returnFromDirMovie()
- end if
- end repeat
- cursor(-1)
- end
-
- on updateMovieSoundBtns goFrame
- global RFBIndex, gPlayTopicBtnSndSprite, gPlayMovieBtnSprite
- set sndNumber to the castNum of sprite gPlayTopicBtnSndSprite
- set movNumber to the castNum of sprite gPlayMovieBtnSprite
- set movUpNumber to the number of cast "movieU"
- set movUnderNumber to the number of cast "mbt5"
- set sndUpNumber to the number of cast "SoundU"
- set sndUnderNumber to the number of cast "sbt6"
- if (RFInfo("ArtName", goFrame) = "0") and (RFInfo("ArtName", goFrame) <> EMPTY) then
- if sndNumber = sndUpNumber then
- playSndButtonAnim("fwd")
- end if
- else
- if sndNumber = sndUnderNumber then
- playSndButtonAnim("rev")
- end if
- end if
- if RFInfo("animation", goFrame) = EMPTY then
- if movNumber = movUpNumber then
- playMovieButtonAnim("fwd")
- end if
- else
- if movNumber = movUnderNumber then
- playMovieButtonAnim("rev")
- end if
- end if
- end
-
- on RFInfo query, lookAheadEntry
- global RFBIndex, gChapStartNums
- if integerp(lookAheadEntry) = 1 then
- set indexNum to lookAheadEntry - 1
- else
- set indexNum to the frame - 1
- end if
- if indexNum = 0 then
- return 0
- end if
- if query = "ID" then
- return getAt(getAt(RFBIndex, indexNum), 1)
- else
- if query = "ArtName" then
- return getAt(getAt(RFBIndex, indexNum), 2)
- else
- if query = "Title" then
- return getAt(getAt(RFBIndex, indexNum), 3)
- else
- if query = "link1" then
- return getAt(getAt(RFBIndex, indexNum), 4)
- else
- if query = "link2" then
- return getAt(getAt(RFBIndex, indexNum), 5)
- else
- if query = "link3" then
- return getAt(getAt(RFBIndex, indexNum), 6)
- else
- if query = "link4" then
- return getAt(getAt(RFBIndex, indexNum), 7)
- else
- if query = "link5" then
- return getAt(getAt(RFBIndex, indexNum), 8)
- else
- if query = "animation" then
- return getAt(getAt(RFBIndex, indexNum), 9)
- else
- if query = "extraSound" then
- return getAt(getAt(RFBIndex, indexNum), 10)
- else
- if query = "chapter" then
- repeat with x = count(gChapStartNums) down to 1
- if indexNum >= getAt(gChapStartNums, x) then
- return x
- end if
- end repeat
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end
-
- on tabclick thePoint
- global gTabBtnSprite, gTabBtnCast, gTabRectsList, gNumTabs
- repeat with tabNum = 1 to gNumTabs
- set thisTabRect to getAt(gTabRectsList, tabNum)
- if inside(thePoint, thisTabRect) then
- return tabNum
- end if
- end repeat
- return 0
- end
-
- on pauseTicks tickNumber
- startTimer()
- repeat while the timer < tickNumber
- if the mouseDown then
- exit
- end if
- end repeat
- end
-
- on playSpecialDirMoov movieName
- global gMoovExitFrame, gCallingFrame
- cursor(4)
- set gCallingFrame to the frame
- set gMoovExitFrame to 1
- set pageCast to the castNum of sprite 1
- set the mouseDownScript to "mymouseDownScript"
- puppetSprite(8, 1)
- set the castNum of sprite 8 to 417
- puppetSprite(1, 1)
- spriteBox(1, -50, -50, -40, -40)
- set the castNum of sprite 1 to pageCast
- spriteBox(1, 0, 0, 640, 480)
- updateStage()
- go(label(movieName))
- end
-
- on playDirMoov movieLoc, movieName
- global gMoovExitFrame, gCallingFrame, gStartMovframe, gPlayMovieBtnSprite, gTabLoc
- cursor(4)
- set gCallingFrame to the frame
- set gMoovExitFrame to 1
- set pageCast to the castNum of sprite 1
- set sprWt to the width of cast movieName
- set sprHt to the height of cast movieName
- set MovieCastNum to the number of cast movieName
- set the mouseDownScript to "mymouseDownScript"
- set the mouseUpScript to "mymouseUpScript"
- puppetSprite(1, 1)
- spriteBox(1, -50, -50, -40, -40)
- set the castNum of sprite 1 to pageCast
- spriteBox(1, 0, 0, 640, 480)
- updateStage()
- set the visible of sprite 6 to 1
- puppetSprite(6, 1)
- spriteBox(6, -50, -50, -40, -40)
- set the castNum of sprite 6 to MovieCastNum
- spriteBox(6, getAt(movieLoc, 1), getAt(movieLoc, 2), getAt(movieLoc, 1) + sprWt, getAt(movieLoc, 2) + sprHt)
- set the castNum of sprite gPlayMovieBtnSprite to cast "MOVIEE"
- updateStage()
- go(label(movieName))
- set gStartMovframe to the frame
- puppetTempo(6)
- cursor(4)
- end
-
- on returnFromDirMovie
- global gMoovExitFrame, gCallingFrame, gStartMovframe, gPlayMovieBtnSprite
- puppetTempo(30)
- dontPassEvent()
- cursor(-1)
- updateStage()
- set gMoovExitFrame to 0
- sound stop 1
- puppetSound(0)
- spriteBox(1, -50, -50, -40, -40)
- puppetSprite(1, 0)
- spriteBox(6, -50, -50, -40, -40)
- puppetSprite(6, 0)
- unLoad(gStartMovframe, the frame)
- go(gCallingFrame)
- set the castNum of sprite gPlayMovieBtnSprite to cast "MOVIEU"
- updateStage()
- set the mouseDownScript to EMPTY
- mymouseUpScript()
- end
-
- on playMoov whichsprite, movieLoc, whichMovieCast
- cursor(4)
- set dummyCast to 23
- go(the frame)
- puppetSprite(whichsprite, 1)
- set spriteWidth to the width of cast whichMovieCast
- set spriteHeight to the height of cast whichMovieCast
- set spriteLeft to getAt(movieLoc, 1)
- set spriteTop to getAt(movieLoc, 2)
- set spriteRight to spriteLeft + spriteWidth
- set spriteBottom to spriteTop + spriteHeight
- spriteBox(whichsprite, -100, -100, -50, -50)
- set the castNum of sprite whichsprite to whichMovieCast
- spriteBox(whichsprite, spriteLeft, spriteTop, spriteRight, spriteBottom)
- updateStage()
- set movieLen to the duration of cast whichMovieCast
- repeat while the movieTime of sprite whichsprite < movieLen
- if the mouseDown then
- exit repeat
- end if
- updateStage()
- end repeat
- set the movieRate of sprite whichsprite to 0
- set the castNum of sprite whichsprite to dummyCast
- spriteBox(whichsprite, 0, 0, 640, 480)
- updateStage()
- spriteBox(whichsprite, -200, -200, 100, 100)
- updateStage()
- puppetSprite(whichsprite, 0)
- cursor(0)
- go(the frame + 1)
- end
-
- on toggleChapterButton sprt
- set castNumber to the castNum of sprite sprt
- set castName to the name of cast castNumber
- if char 6 of castName = "U" then
- put "D" into char 6 of castName
- set the castNum of sprite sprt to cast castName
- updateStage()
- end if
- end
-
- on playMovieButtonAnim whichWay
- end
-
- on playSndButtonAnim whichWay
- global gPlayTopicBtnSndSprite, gSndbtnLocs
- puppetSprite(gPlayTopicBtnSndSprite, 1)
- if whichWay = "fwd" then
- set the castNum of sprite gPlayTopicBtnSndSprite to cast "SOUNDU"
- set the locH of sprite gPlayTopicBtnSndSprite to getAt(getAt(gSndbtnLocs, 1), 1)
- set the locV of sprite gPlayTopicBtnSndSprite to getAt(getAt(gSndbtnLocs, 1), 2)
- updateStage()
- repeat with x = 2 to 7
- set the castNum of sprite gPlayTopicBtnSndSprite to cast ("SBT" & x - 1)
- set the locH of sprite gPlayTopicBtnSndSprite to getAt(getAt(gSndbtnLocs, x), 1)
- set the locV of sprite gPlayTopicBtnSndSprite to getAt(getAt(gSndbtnLocs, x), 2)
- updateStage()
- end repeat
- else
- if whichWay = "rev" then
- repeat with x = 7 down to 2
- set the castNum of sprite gPlayTopicBtnSndSprite to cast ("SBT" & x - 1)
- set the locH of sprite gPlayTopicBtnSndSprite to getAt(getAt(gSndbtnLocs, x), 1)
- set the locV of sprite gPlayTopicBtnSndSprite to getAt(getAt(gSndbtnLocs, x), 2)
- updateStage()
- end repeat
- set the castNum of sprite gPlayTopicBtnSndSprite to cast "SOUNDU"
- set the locH of sprite gPlayTopicBtnSndSprite to getAt(getAt(gSndbtnLocs, 1), 1)
- set the locV of sprite gPlayTopicBtnSndSprite to getAt(getAt(gSndbtnLocs, 1), 2)
- updateStage()
- end if
- end if
- end
-
- on setSprite whichsprite, xLeft, yTop
- set cstNum to the castNum of sprite whichsprite
- set sprtwdth to the width of sprite whichsprite
- set sprtHite to the height of sprite whichsprite
- spriteBox(whichsprite, xLeft, yTop, xLeft + sprtwdth, yTop + sprtHite)
- updateStage()
- end
-