home *** CD-ROM | disk | FTP | other *** search
/ Better Homes & Gardens: Healthy Cooking / COOKBOOK.ISO / pc / multicom.dir / 00005_mainMenu.ls < prev    next >
Encoding:
Text File  |  1995-04-19  |  2.3 KB  |  98 lines

  1. on exitFrame
  2.   global gGoingToTopic
  3.   if gGoingToTopic <> 1 then
  4.     go(the frame)
  5.   else
  6.     set gGoingToTopic to 0
  7.   end if
  8. end
  9.  
  10. on enterFrame
  11.   global gGoingToTopic
  12.   setCursors()
  13.   puppetSprite(2, 1)
  14.   setPuppets(1)
  15.   set gGoingToTopic to 0
  16.   checkHilite()
  17. end
  18.  
  19. on checkHilite
  20.   global gTopicList, gButtonLast, gButtonBase
  21.   set vCast to the mouseCast
  22.   if vCast = -1 then
  23.     set vText to field "currentTitle"
  24.     if vText <> EMPTY then
  25.       put EMPTY into field "currentTitle"
  26.     end if
  27.     exit
  28.   end if
  29.   if (vCast > gButtonBase) and (vCast < gButtonLast) then
  30.     set vLine to vCast - gButtonBase
  31.     set vTitle to line vLine of field "titles"
  32.     set vTextNow to field "currentTitle"
  33.     if vTextNow <> vTitle then
  34.       put vTitle into field "currentTitle"
  35.     end if
  36.   else
  37.     set vText to field "currentTitle"
  38.     if vText <> EMPTY then
  39.       put EMPTY into field "currentTitle"
  40.     end if
  41.   end if
  42.   updateStage()
  43. end
  44.  
  45. on mouseDown
  46.   global gButtonBase, gTitleList, gSpriteBase, gGoingToTopic
  47.   set vCastNo to the mouseCast
  48.   set vName to the name of cast vCastNo
  49.   if (vName = "quitUp") or (vName = "currentTitle") or (vName = "mainBg") then
  50.     exit
  51.   end if
  52.   set vDisp to vCastNo - gButtonBase
  53.   set vSpriteNo to vDisp + gSpriteBase
  54.   set the castNum of sprite vSpriteNo to gButtonBase
  55.   updateStage()
  56.   set vOld to 0
  57.   repeat while the mouseDown
  58.     set vMcast to the mouseCast
  59.     if vMcast = gButtonBase then
  60.       nothing()
  61.     else
  62.       if vMcast = vCastNo then
  63.         set the castNum of sprite vSpriteNo to gButtonBase
  64.         updateStage()
  65.       else
  66.         set the castNum of sprite vSpriteNo to vCastNo
  67.         updateStage()
  68.       end if
  69.     end if
  70.     set vOld to vMcast
  71.   end repeat
  72.   set the castNum of sprite vSpriteNo to vCastNo
  73.   updateStage()
  74.   set vReleaseObj to the mouseCast
  75.   if vReleaseObj = vCastNo then
  76.     setDemo(vName, vDisp)
  77.     set gGoingToTopic to 1
  78.     set vGoto to vName & "main"
  79.     setPuppets(0)
  80.     go(vGoto)
  81.   end if
  82. end
  83.  
  84. on setDemo fTopic, fOffset
  85.   global gCurrentTopic, gTopicOffset, gTopicState
  86.   set gTopicState to "main"
  87.   set gCurrentTopic to fTopic
  88.   set gTopicOffset to fOffset
  89. end
  90.  
  91. on setCursors
  92.   global gHandCursor
  93.   repeat with i = 11 to 21
  94.     set the cursor of sprite i to gHandCursor
  95.   end repeat
  96.   set the cursor of sprite 3 to gHandCursor
  97. end
  98.