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

  1. on getMenuItem
  2.   global linePtr, offsetPtr, theMenu, menuText, theMenuItem, castData, theClickLine
  3.   if theMenu = "index" then
  4.     set theMenuItem to line linePtr + 1 of field 441
  5.     put theMenuItem into field 442
  6.   else
  7.     if item 1 of castData = "searchResults" then
  8.       set theMenuItem to line linePtr + 1 of field 463
  9.     else
  10.       if item 1 of castData = "bookmark" then
  11.         set theMenuItem to line linePtr + 1 of field 483
  12.       else
  13.         set theClickLine to linePtr + 1 + offsetPtr
  14.         set theMenuItem to line theClickLine of menuText
  15.       end if
  16.     end if
  17.   end if
  18. end
  19.  
  20. on goToMenuItem
  21.   global browsetrail, browseNames, theClickLine, linePtr, subHeaderText, shMkrLst, theMenu, theMenuItem, browseMenuItems, articleList
  22.   if theMenu = "backtrack" then
  23.     selectMovie(theMenuItem)
  24.     delete line theClickLine of browseNames
  25.     delete line theClickLine of browsetrail
  26.   else
  27.     if theMenu = "subheadings" then
  28.       set x to the number of lines in subHeaderText
  29.       repeat with n = 1 to x
  30.         if line n of subHeaderText contains theMenuItem then
  31.           set theMarker to "p" & line n of shMkrLst
  32.           exit repeat
  33.         end if
  34.       end repeat
  35.       setUpSprites("6;8;10-12;37-48", 0)
  36.       go(marker(theMarker))
  37.     else
  38.       selectMovie(theMenuItem)
  39.     end if
  40.   end if
  41. end
  42.  
  43. on selectMovie theItem
  44.   global articleList, browseName
  45.   if stringp(theItem) = 0 then
  46.     exit
  47.   end if
  48.   set x to the number of lines in articleList
  49.   set y to the number of items in line 1 of articleList
  50.   if theItem = "Mandela, Nelson" then
  51.     delete item 2 of theItem
  52.   end if
  53.   set destMovie to EMPTY
  54.   repeat with n = 1 to x
  55.     if line n of articleList contains theItem then
  56.       if theItem <> browseName then
  57.         set destMovie to item y of line n of articleList
  58.         exit repeat
  59.       end if
  60.     end if
  61.   end repeat
  62.   if destMovie <> EMPTY then
  63.     setUpSprites("6;8;10-12;37-48", 0)
  64.     goNextLoc(destMovie, 1, marker(0))
  65.   else
  66.     beep()
  67.   end if
  68. end
  69.