home *** CD-ROM | disk | FTP | other *** search
/ Better Homes & Gardens: …oking for Today - Chicken / Image.iso / pc / shared.dxr / 01007_help.ls < prev    next >
Encoding:
Text File  |  1995-11-21  |  1.8 KB  |  79 lines

  1. on help
  2.   global gLastHelp, gHelpLinks, gHelpActive, gHelpSprite
  3.   if gHelpActive then
  4.     set num to count(gHelpLinks)
  5.     set roll to 0
  6.     repeat with i = 1 to num
  7.       set channel to getPropAt(gHelpLinks, i)
  8.       set aCast to the castNum of sprite channel
  9.       if (the mouseCast = aCast) and the visible of sprite channel then
  10.         set roll to getProp(gHelpLinks, channel)
  11.         exit repeat
  12.       end if
  13.     end repeat
  14.     helpPosition()
  15.     if roll <> gLastHelp then
  16.       if roll > 0 then
  17.         set text to field ("help" & roll)
  18.         put text into field "help"
  19.         helpPosition()
  20.         set the visible of sprite gHelpSprite to 1
  21.       else
  22.         set the visible of sprite gHelpSprite to 0
  23.       end if
  24.       set gLastHelp to roll
  25.     end if
  26.   end if
  27. end
  28.  
  29. on helpOff
  30.   global gHelpActive, gHelpSprite
  31.   set gHelpActive to 0
  32.   set the visible of sprite gHelpSprite to 0
  33.   updateStage()
  34.   set the locV of sprite gHelpSprite to 0
  35.   set the locH of sprite gHelpSprite to 0
  36.   updateStage()
  37.   puppetSprite(gHelpSprite, 0)
  38.   if the frame = label("video") then
  39.     set the visible of sprite 16 to 1
  40.   end if
  41. end
  42.  
  43. on helpPosition
  44.   global gHelpSprite
  45.   if the mouseV > 240 then
  46.     set offV to the height of cast 1031 + 20
  47.   else
  48.     set offV to -20
  49.   end if
  50.   if the mouseH > 320 then
  51.     set offH to the width of cast 1031 + 20
  52.   else
  53.     set offH to -20
  54.   end if
  55.   set the locV of sprite gHelpSprite to the mouseV - offV
  56.   set the locH of sprite gHelpSprite to the mouseH - offH
  57.   updateStage()
  58. end
  59.  
  60. on helpSound num
  61.   if num < 41 then
  62.     set aFolder to "HELP1"
  63.   else
  64.     if num < 81 then
  65.       set aFolder to "HELP2"
  66.     else
  67.       set aFolder to "HELP3"
  68.     end if
  69.   end if
  70.   if num < 10 then
  71.     put "00" before num
  72.   else
  73.     if num < 100 then
  74.       put "0" before num
  75.     end if
  76.   end if
  77.   loadSound(aFolder, num, "helpsnd")
  78. end
  79.