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

  1. on mouseDown
  2.   global noteData, notePages, currPage, castData
  3.   if castData contains "popmenu" then
  4.     managePopMenu()
  5.   end if
  6.   if value(item 2 of castData) > 1000 then
  7.     exit
  8.   end if
  9.   moveWindow("6", marker(0))
  10.   if (the right of sprite 6 - the mouseH) < 23 then
  11.     if (the bottom of sprite 6 - the mouseV) < 23 then
  12.       if currPage < notePages then
  13.         set the castNum of sprite 6 to value(item 1 of noteData) + currPage
  14.         set currPage to currPage + 1
  15.       end if
  16.     end if
  17.   else
  18.     if (the right of sprite 6 - the mouseH) < 46 then
  19.       if (the bottom of sprite 6 - the mouseV) < 46 then
  20.         if currPage > 1 then
  21.           set currPage to currPage - 1
  22.           set the castNum of sprite 6 to value(item 1 of noteData) + currPage - 1
  23.         end if
  24.       end if
  25.       set the ink of sprite 6 to 36
  26.     end if
  27.   end if
  28. end
  29.  
  30. on managePopMenu
  31.   global castData, rectList
  32.   set baseCastNum to value(item 4 of castData)
  33.   set mItems to value(item 5 of castData)
  34.   set LT to value(getAt(rectList, 1))
  35.   set TP to value(getAt(rectList, 2))
  36.   set rt to LT + value(getAt(rectList, 3))
  37.   set bt to TP + value(getAt(rectList, 4))
  38.   set castPtr to 0
  39.   repeat while the mouseDown
  40.     set x to the mouseH
  41.     set y to the mouseV
  42.     if (x >= LT) and (x <= rt) then
  43.       if (y >= TP) and (y <= bt) then
  44.         set castPtr to integer(0.5 + ((y - TP) * mItems * 1.0 / (bt - TP)))
  45.         set the castNum of sprite 6 to baseCastNum + castPtr
  46.         updateStage()
  47.         next repeat
  48.       end if
  49.       set castPtr to 0
  50.       set the castNum of sprite 6 to baseCastNum
  51.       updateStage()
  52.     end if
  53.     set castPtr to 0
  54.     set the castNum of sprite 6 to baseCastNum
  55.     updateStage()
  56.   end repeat
  57.   if castPtr = 3 then
  58.     set castData to "1,99"
  59.     puppetSprite(6, 0)
  60.     puppetSprite(16, 1)
  61.     set the castNum of sprite 16 to 90
  62.     set the ink of sprite 16 to 36
  63.     spriteBox(16, 168, 190, 532, 304)
  64.   end if
  65. end
  66.