home *** CD-ROM | disk | FTP | other *** search
/ Organic Chemistry (8th Edition) / Image.iso / pc / data1.cab / Program_Files / PC_IR_Tutor / INTRO03 / 00002.ls next >
Encoding:
Text File  |  2003-05-14  |  1.9 KB  |  98 lines

  1. on InitKeys
  2.   global leftArrow, rightArrow, retnKey, useKeys, expRegion
  3.   set leftArrow to 123
  4.   set rightArrow to 124
  5.   set retnKey to 36
  6.   installMenu(10)
  7.   set the checkMark of menuItem 3 of menu "Intro" to 1
  8.   when keyDown then checkKey
  9. end
  10.  
  11. on checkKey
  12.   global leftArrow, rightArrow, retnKey, useKeys
  13.   if useKeys = 1 then
  14.     if the keyCode = retnKey then
  15.       doLeave()
  16.     else
  17.       exit
  18.       dontPassEvent()
  19.     end if
  20.   end if
  21.   if useKeys = 2 then
  22.     if the keyCode = retnKey then
  23.       when keyDown then nothing
  24.       quit()
  25.     else
  26.       exit
  27.       dontPassEvent()
  28.     end if
  29.   end if
  30.   if (the keyCode = leftArrow) and (useKeys <> 3) then
  31.     go(marker(-1))
  32.   else
  33.     if (the keyCode = rightArrow) and (useKeys <> 4) then
  34.       go(marker(1))
  35.     end if
  36.   end if
  37.   dontPassEvent()
  38. end
  39.  
  40. on checkButton
  41.   global useKeys
  42.   set posH to the mouseH
  43.   set posV to the mouseV
  44.   if (posV > 465) or (posV < 440) or (posH > 605) or (posH < 262) then
  45.     exit
  46.   end if
  47.   if (posH > 579) and (useKeys <> 4) then
  48.     go(marker(1))
  49.   end if
  50.   if (posH > 534) and (posH < 560) and (useKeys <> 3) then
  51.     go(marker(-1))
  52.   end if
  53.   if (posH > 459) and (posH < 500) then
  54.     doExit(0, "Quit")
  55.     exit
  56.   end if
  57.   if (posH > 384) and (posH < 425) then
  58.     doExit(0, "Help")
  59.     exit
  60.   end if
  61.   if posH < 350 then
  62.     doExit("Intro", "MainProg")
  63.     exit
  64.   end if
  65. end
  66.  
  67. on doExit whichFrame, whichMovie
  68.   global framePos, frameName, movieName, useKeys, oldUseKeys
  69.   if useKeys < 3 then
  70.     exit
  71.   end if
  72.   set framePos to the frame
  73.   set oldUseKeys to useKeys
  74.   if whichFrame = 0 then
  75.     go(whichMovie)
  76.     exit
  77.   else
  78.     go(1, whichMovie)
  79.   end if
  80. end
  81.  
  82. on setUseKeys theCode
  83.   global useKeys
  84.   set useKeys to theCode
  85. end
  86.  
  87. on dontLeave
  88.   global framePos, useKeys, oldUseKeys
  89.   set useKeys to oldUseKeys
  90.   go(framePos)
  91. end
  92.  
  93. on doLeave
  94.   global frameName, movieName
  95.   when keyDown then nothing
  96.   go(frameName, movieName)
  97. end
  98.