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

  1. on moveWindow theSprites, rtnFrame, HtextSprite, hotSpotList, soundFile
  2.   global castData
  3.   set theSprites to convertToList(theSprites)
  4.   set x to the number of items in theSprites
  5.   repeat with j = 1 to x
  6.     put the locV of sprite value(item j of theSprites) into item j of theLocVs
  7.     put the locH of sprite value(item j of theSprites) into item j of theLocHs
  8.   end repeat
  9.   set MV to the mouseV
  10.   set MH to the mouseH
  11.   if (MV - the top of sprite value(item 1 of theSprites)) < 10 then
  12.     if (MH - the left of sprite value(item 1 of theSprites)) < 10 then
  13.       if rtnFrame <> EMPTY then
  14.         stopSound(1, 10)
  15.         set soundFile to EMPTY
  16.         if goAwayBox(value(item 1 of theSprites)) = "dismiss" then
  17.           setUpSprites(theSprites, 0)
  18.           if string(HtextSprite) <> EMPTY then
  19.             setUpSprites(HtextSprite, 0)
  20.           end if
  21.           exit
  22.         end if
  23.       end if
  24.     end if
  25.     repeat while the mouseDown
  26.       if the mouseV > 5 then
  27.         if the mouseV < (the stageBottom - the stageTop - 5) then
  28.           set dMV to the mouseV - MV
  29.           set MV to MV + dMV
  30.         else
  31.           set dMV to 0
  32.         end if
  33.       else
  34.         set dMV to 0
  35.       end if
  36.       if the mouseH > 5 then
  37.         if the mouseH < (the stageRight - the stageLeft - 5) then
  38.           set dMH to the mouseH - MH
  39.           set MH to MH + dMH
  40.         else
  41.           set dMH to 0
  42.         end if
  43.       else
  44.         set dMH to 0
  45.       end if
  46.       repeat with n = 1 to x
  47.         put dMV + value(item n of theLocVs) into item n of theLocVs
  48.         put dMH + value(item n of theLocHs) into item n of theLocHs
  49.         set the locV of sprite value(item n of theSprites) to value(item n of theLocVs)
  50.         set the locH of sprite value(item n of theSprites) to value(item n of theLocHs)
  51.       end repeat
  52.       updateStage()
  53.     end repeat
  54.   else
  55.     if item 1 of castData = "searchResults" then
  56.       manageHiliter2(39, 442, 0)
  57.     else
  58.       if item 1 of castData = "bookmark" then
  59.       end if
  60.     end if
  61.   end if
  62. end
  63.  
  64. on WinHText hotSpotList, winSprite, HtextSprite
  65.   global CR, itemHit, gLocation, ViewOptions, gNewViewOptions, gObject
  66.   set itemHit to EMPTY
  67.   set areaList to the text of cast hotSpotList
  68.   set x to the mouseH
  69.   set y to the mouseV
  70.   set tx to the left of sprite winSprite
  71.   set ty to the top of sprite winSprite
  72.   InRect(x, y, tx, ty, areaList)
  73.   set n to the result
  74.   set n to value(n)
  75.   if n > 0 then
  76.     set itemHit to n
  77.     set m to line n of areaList
  78.     set theStr to item 6 of m
  79.     if theStr = "OK" then
  80.       if the castNum of sprite HtextSprite = 93 then
  81.         set theDownCast to 94
  82.       else
  83.         if the castNum of sprite HtextSprite = 96 then
  84.           set theDownCast to 98
  85.         else
  86.           if the castNum of sprite HtextSprite = 92 then
  87.             set theDownCast to 91
  88.           end if
  89.         end if
  90.       end if
  91.     else
  92.       if theStr = "Cancel" then
  93.         if the castNum of sprite HtextSprite = 93 then
  94.           set theDownCast to 95
  95.         else
  96.           if the castNum of sprite HtextSprite = 96 then
  97.             set theDownCast to 97
  98.           end if
  99.         end if
  100.       end if
  101.     end if
  102.     set theUpCast to the castNum of sprite HtextSprite
  103.     repeat while the mouseDown
  104.       set the castNum of sprite HtextSprite to theDownCast
  105.       updateStage()
  106.     end repeat
  107.     set the castNum of sprite HtextSprite to theUpCast
  108.     puppetSprite(HtextSprite, 0)
  109.     if theStr = "Cancel" then
  110.       exit
  111.     end if
  112.     if gObject = EMPTY then
  113.       exit
  114.     end if
  115.     set ViewOptions to gNewViewOptions
  116.     set the blend of sprite 14 to 0
  117.     put EMPTY into field 458
  118.     put EMPTY into field "ListName"
  119.     setUpSprites("9-14;17-24;33-39;41", 0)
  120.     if (gLocation = "London Views") and (theStr = "OK") then
  121.       go(marker("Lon") + 1)
  122.     else
  123.       if (gLocation = "LA Views") and (theStr = "OK") then
  124.         go(marker("LA") + 1)
  125.       end if
  126.     end if
  127.   else
  128.     nothing()
  129.   end if
  130.   set gObject to EMPTY
  131. end
  132.  
  133. on goAwayBox winSprite
  134.   puppetSprite(48, 1)
  135.   set the ink of sprite 48 to 0
  136.   set the castNum of sprite 48 to 529
  137.   set the immediate of sprite 48 to 1
  138.   set theT to the top of sprite winSprite + 2
  139.   set theB to theT + 12
  140.   set theL to the left of sprite winSprite + 2
  141.   set theR to theL + 11
  142.   set the ink of sprite 48 to 2
  143.   spriteBox(48, theL, theT, theR, theB)
  144.   set the visible of sprite 48 to 1
  145.   updateStage()
  146.   repeat while the mouseDown
  147.     set the castNum of sprite 48 to 530
  148.     updateStage()
  149.   end repeat
  150.   set the castNum of sprite 48 to 529
  151.   updateStage()
  152.   puppetSprite(48, 0)
  153.   if rollOver(48) then
  154.     return "dismiss"
  155.   else
  156.     return EMPTY
  157.   end if
  158. end
  159.