home *** CD-ROM | disk | FTP | other *** search
/ Pro One: Netcracker Netscape Navigator / ProOne: Netcracker Netscape Navigator.iso / pc / nc / wds / nc_hlp.geo / 00089_cursors.ls < prev    next >
Encoding:
Text File  |  1997-03-19  |  2.1 KB  |  92 lines

  1. on TheinitCursor
  2.   initCursorCastNum()
  3.   initCursorList()
  4.   set CursorCastNum to getCursor(2)
  5.   cursor([CursorCastNum, CursorCastNum + 1])
  6. end
  7.  
  8. on setDefaultCursor
  9.   set cursorList to getCursorList()
  10.   set counter to count(cursorList)
  11.   repeat with i = 1 to counter
  12.     set currItem to getAt(cursorList, i)
  13.     if currItem <> 0 then
  14.       set CursorCastNum to getCursor(currItem)
  15.       set the cursor of sprite i to [CursorCastNum, CursorCastNum + 1]
  16.     end if
  17.   end repeat
  18. end
  19.  
  20. on UpdateCursors theSp, theCursor
  21.   global cursorList
  22.   setAt(cursorList, theSp, theCursor)
  23.   if theCursor = 0 then
  24.     set the cursor of sprite theSp to theCursor
  25.   else
  26.     set CursorCastNum to getCursor(theCursor)
  27.     set the cursor of sprite theSp to [CursorCastNum, CursorCastNum + 1]
  28.   end if
  29. end
  30.  
  31. on setEmptyCursor
  32.   set cursorList to getCursorList()
  33.   set counter to count(cursorList)
  34.   repeat with i = 1 to counter
  35.     set currItem to getAt(cursorList, i)
  36.     if currItem <> 0 then
  37.       set the cursor of sprite i to 0
  38.       setAt(cursorList, i, 0)
  39.     end if
  40.   end repeat
  41. end
  42.  
  43. on setCursorTool int
  44.   global CursorTool
  45.   set CursorTool to int
  46. end
  47.  
  48. on initCursorCastNum
  49.   global CursorCastNum
  50.   set CursorCastNum to "400,402,404,406"
  51. end
  52.  
  53. on getCursor cursorNum
  54.   global CursorCastNum
  55.   return integer(item cursorNum of CursorCastNum)
  56. end
  57.  
  58. on initCursorList
  59.   global cursorList
  60.   set cursorList to [0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 3, 0, 0, 3]
  61.   setDefaultCursor()
  62. end
  63.  
  64. on getCursorList
  65.   global cursorList
  66.   return cursorList
  67. end
  68.  
  69. on switchButton spriteNum, castDown, macroName
  70.   set flag to 0
  71.   set SaveCast to the castNum of sprite spriteNum
  72.   set flag to swapCast(spriteNum, SaveCast, castDown)
  73.   repeat while the stillDown
  74.     set flag to swapCast(spriteNum, SaveCast, castDown)
  75.   end repeat
  76.   if flag = 1 then
  77.     do(macroName)
  78.   end if
  79. end
  80.  
  81. on swapCast spriteNum, SaveCast, castDown
  82.   if rollOver(spriteNum) then
  83.     set the castNum of sprite spriteNum to the number of cast castDown
  84.     updateStage()
  85.     return 1
  86.   else
  87.     set the castNum of sprite spriteNum to the number of cast SaveCast
  88.     updateStage()
  89.     return 0
  90.   end if
  91. end
  92.