home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / pc / tutorial / ch08_lgo / tutor.dcr / 00001.ls next >
Encoding:
Text File  |  1996-12-06  |  856 b   |  50 lines

  1. global gVisited
  2.  
  3. on startMovie
  4.   initPseudoHTML()
  5.   setConstants()
  6.   refreshLinks(1)
  7. end
  8.  
  9. on setConstants
  10.   global gHelpOffset, gLoSprite, gHiSprite
  11.   set gHelpOffset to 20
  12.   set gLoSprite to 10
  13.   set gHiSprite to gLoSprite + 6
  14.   repeat with i = gLoSprite + gHelpOffset to gHiSprite + gHelpOffset
  15.     set the visible of sprite i to 0
  16.   end repeat
  17. end
  18.  
  19. on recordHistory theURL
  20.   if not gVisited then
  21.     set gVisited to []
  22.   end if
  23.   set index to getPos(gVisited, theURL)
  24.   if index then
  25.     deleteAt(gVisited, index)
  26.   end if
  27.   append(gVisited, theURL)
  28. end
  29.  
  30. on visited theLabel
  31.   if not gVisited then
  32.     set gVisited to []
  33.   end if
  34.   set index to getPos(gVisited, theLabel)
  35.   if index then
  36.     return 1
  37.   else
  38.     return 0
  39.   end if
  40. end
  41.  
  42. on goBack
  43.   deleteAt(gVisited, count(gVisited))
  44.   go(label(getLast(gVisited)))
  45. end
  46.  
  47. on stopMovie
  48.   refreshLinks()
  49. end
  50.