home *** CD-ROM | disk | FTP | other *** search
/ PC Home 49 / PC_Home_Issue_49.iso / winprogs / childenc / oecdemo / shared.dir / 00381.ls next >
Encoding:
Text File  |  1996-07-24  |  3.5 KB  |  134 lines

  1. on startMovie
  2.   global bg, gInited, myFlush
  3.   if testEnvirons() = 1 then
  4.     cursor(4)
  5.     if stringp(gInited) = 0 then
  6.       clearGlobals()
  7.       initEnvironment()
  8.     end if
  9.     initLocal()
  10.     cursor(-1)
  11.   else
  12.     quit()
  13.   end if
  14. end
  15.  
  16. on testEnvirons
  17.   if the memorysize < (1500 * 1024) then
  18.     set errMsg to "There is not enough memory to run this application"
  19.     return errMsg
  20.   end if
  21.   if the colorQD <> 1 then
  22.     put "This application will not display properly unless in colour." & RETURN & "Please set the colour depth to 256 colours or more then restart."
  23.     into(errMsg)
  24.     return errMsg
  25.   end if
  26.   return 1
  27. end
  28.  
  29. on initEnvironment
  30.   global CR, bg, gAudioFolder, gMoviePathName, gDontPlaySound, gErrGlobal, gInited, theTxtFont, FontRes, origSoundLevel, origColorDepth, hand, pictureList, articleList, indexText, genHotSpots, castData, browsetrail, browseNames, bkMrkLstName, bkMrkList, hiliteFlag
  31.   openXobjs()
  32.   set CR to RETURN
  33.   set gInited to "1"
  34.   cursor(4)
  35.   set origSoundLevel to the soundLevel
  36.   set origColorDepth to the colorDepth
  37.   set pictureList to EMPTY
  38.   set hiliteFlag to 0
  39.   set gErrGlobal to EMPTY
  40.   set castData to EMPTY
  41.   set FontRes to "VGASys.fon"
  42.   set theTxtFont to "System"
  43.   set txtFlds to "442,463,483,527,528"
  44.   repeat with n = 1 to the number of items in txtFlds
  45.     set x to the number of chars in field value(item n of txtFlds)
  46.     hilite char 1 to x of field value(item n of txtFlds)
  47.     set the textFont of field value(item n of txtFlds) to theTxtFont
  48.   end repeat
  49.   set articleList to the text of cast 400
  50.   set hand to [the number of cast "hand", 434]
  51.   set genHotSpots to the text of cast 399
  52.   if the colorDepth < 16 then
  53.     set the colorDepth to 8
  54.   end if
  55.   set gMoviePathName to the pathName
  56.   if the machineType = 256 then
  57.     append(the searchPath, "D:\PWP\")
  58.     append(the searchPath, "E:\PWP\")
  59.     append(the searchPath, "F:\PWP\")
  60.     set myPath to the pathName
  61.     append(the searchPath, myPath & "Audio")
  62.     append(the searchPath, myPath & "Data")
  63.     set gAudioFolder to myPath & "AUDIO\"
  64.     if FontRes <> EMPTY then
  65.       openResFile(myPath & FontRes)
  66.     end if
  67.   else
  68.     append(the searchPath, "PWP:")
  69.     set myPath to the pathName
  70.     append(the searchPath, myPath & "Audio:")
  71.     set gAudioFolder to myPath & "Audio:"
  72.     set the soundLevel to 7
  73.     set gDontPlaySound to 0
  74.   end if
  75.   if stringp(browsetrail) = 0 then
  76.     set browsetrail to 1 & ",Butrfly.dir"
  77.     set browseNames to "Butterflies"
  78.   end if
  79.   set indexText to field 528
  80.   set bkMrkList to EMPTY
  81.   set bkMrkLstName to "Science Project"
  82. end
  83.  
  84. on openXobjs
  85.   global bg
  86.   if the machineType = 256 then
  87.     openXLib("fileio")
  88.   else
  89.     if objectp(bg) = 0 then
  90.       openXLib("Backdrop")
  91.       set bg to backdrop(mnew)
  92.       closeXLib("Backdrop")
  93.       if objectp(bg) then
  94.         bg(mHideInBack, 0)
  95.         bg(mSetColor, 253)
  96.         bg(mShow)
  97.       end if
  98.     end if
  99.     openXLib("Replace")
  100.     openXLib("InRect")
  101.     openXLib("FileExists")
  102.   end if
  103. end
  104.  
  105. on stopMovie
  106. end
  107.  
  108. on cleanClose
  109.   global bg, origSoundLevel, origColorDepth, myFlush
  110.   if origSoundLevel > 0 then
  111.     set the soundLevel to origSoundLevel
  112.   end if
  113.   if the colorDepth <> origColorDepth then
  114.     set the colorDepth to origColorDepth
  115.   end if
  116.   if objectp("Replace") then
  117.     closeXLib("Replace")
  118.   end if
  119.   if objectp("fileio") then
  120.     closeXLib("fileio")
  121.   end if
  122.   if objectp("InRect") then
  123.     closeXLib("InRect")
  124.   end if
  125.   if objectp("FileExists") then
  126.     closeXLib("FileExists")
  127.   end if
  128.   if objectp("johnny") then
  129.     closeXLib("johnny")
  130.     myFlush(mdispose)
  131.   end if
  132.   when keyDown then nothing
  133. end
  134.