home *** CD-ROM | disk | FTP | other *** search
/ Organic Chemistry (8th Edition) / Image.iso / pc / data1.cab / Program_Files / PC_IR_Tutor / INTRO02 / 00002.ls next >
Encoding:
Text File  |  2003-05-14  |  2.0 KB  |  102 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.   when keyDown then checkKey
  7.   installMenu(106)
  8.   set the checkMark of menuItem 2 of menu "Intro" to 1
  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(1, "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.   if (the frame > 58) and (the frame < 84) then
  73.     set framePos to 59
  74.   else
  75.     set framePos to the frame
  76.   end if
  77.   set oldUseKeys to useKeys
  78.   if whichFrame = 0 then
  79.     go(whichMovie)
  80.     exit
  81.   else
  82.     go(1, whichMovie)
  83.   end if
  84. end
  85.  
  86. on setUseKeys theCode
  87.   global useKeys
  88.   set useKeys to theCode
  89. end
  90.  
  91. on dontLeave
  92.   global framePos, useKeys, oldUseKeys
  93.   set useKeys to oldUseKeys
  94.   go(framePos)
  95. end
  96.  
  97. on doLeave
  98.   global frameName, movieName
  99.   when keyDown then nothing
  100.   go(frameName, movieName)
  101. end
  102.