home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global bg, gInited, myFlush
- if testEnvirons() = 1 then
- cursor(4)
- if stringp(gInited) = 0 then
- clearGlobals()
- initEnvironment()
- end if
- initLocal()
- cursor(-1)
- else
- quit()
- end if
- end
-
- on testEnvirons
- if the memorysize < (1500 * 1024) then
- set errMsg to "There is not enough memory to run this application"
- return errMsg
- end if
- if the colorQD <> 1 then
- put "This application will not display properly unless in colour." & RETURN & "Please set the colour depth to 256 colours or more then restart."
- into(errMsg)
- return errMsg
- end if
- return 1
- end
-
- on initEnvironment
- global CR, bg, gAudioFolder, gMoviePathName, gDontPlaySound, gErrGlobal, gInited, theTxtFont, FontRes, origSoundLevel, origColorDepth, hand, pictureList, articleList, indexText, genHotSpots, castData, browsetrail, browseNames, bkMrkLstName, bkMrkList, hiliteFlag
- openXobjs()
- set CR to RETURN
- set gInited to "1"
- cursor(4)
- set origSoundLevel to the soundLevel
- set origColorDepth to the colorDepth
- set pictureList to EMPTY
- set hiliteFlag to 0
- set gErrGlobal to EMPTY
- set castData to EMPTY
- set FontRes to "VGASys.fon"
- set theTxtFont to "System"
- set txtFlds to "442,463,483,527,528"
- repeat with n = 1 to the number of items in txtFlds
- set x to the number of chars in field value(item n of txtFlds)
- hilite char 1 to x of field value(item n of txtFlds)
- set the textFont of field value(item n of txtFlds) to theTxtFont
- end repeat
- set articleList to the text of cast 400
- set hand to [the number of cast "hand", 434]
- set genHotSpots to the text of cast 399
- if the colorDepth < 16 then
- set the colorDepth to 8
- end if
- set gMoviePathName to the pathName
- if the machineType = 256 then
- append(the searchPath, "D:\PWP\")
- append(the searchPath, "E:\PWP\")
- append(the searchPath, "F:\PWP\")
- set myPath to the pathName
- append(the searchPath, myPath & "Audio")
- append(the searchPath, myPath & "Data")
- set gAudioFolder to myPath & "AUDIO\"
- if FontRes <> EMPTY then
- openResFile(myPath & FontRes)
- end if
- else
- append(the searchPath, "PWP:")
- set myPath to the pathName
- append(the searchPath, myPath & "Audio:")
- set gAudioFolder to myPath & "Audio:"
- set the soundLevel to 7
- set gDontPlaySound to 0
- end if
- if stringp(browsetrail) = 0 then
- set browsetrail to 1 & ",Butrfly.dir"
- set browseNames to "Butterflies"
- end if
- set indexText to field 528
- set bkMrkList to EMPTY
- set bkMrkLstName to "Science Project"
- end
-
- on openXobjs
- global bg
- if the machineType = 256 then
- openXLib("fileio")
- else
- if objectp(bg) = 0 then
- openXLib("Backdrop")
- set bg to backdrop(mnew)
- closeXLib("Backdrop")
- if objectp(bg) then
- bg(mHideInBack, 0)
- bg(mSetColor, 253)
- bg(mShow)
- end if
- end if
- openXLib("Replace")
- openXLib("InRect")
- openXLib("FileExists")
- end if
- end
-
- on stopMovie
- end
-
- on cleanClose
- global bg, origSoundLevel, origColorDepth, myFlush
- if origSoundLevel > 0 then
- set the soundLevel to origSoundLevel
- end if
- if the colorDepth <> origColorDepth then
- set the colorDepth to origColorDepth
- end if
- if objectp("Replace") then
- closeXLib("Replace")
- end if
- if objectp("fileio") then
- closeXLib("fileio")
- end if
- if objectp("InRect") then
- closeXLib("InRect")
- end if
- if objectp("FileExists") then
- closeXLib("FileExists")
- end if
- if objectp("johnny") then
- closeXLib("johnny")
- myFlush(mdispose)
- end if
- when keyDown then nothing
- end
-