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

  1. on exitFrame
  2.   global keyHotspots, castData, n, x1, y1, hiliteFlag
  3.   set x to the mouseH
  4.   set y to the mouseV
  5.   set n to PCinRect(x, y, keyHotspots)
  6.   if n <> EMPTY then
  7.     if (n = 10) and (marker(0) = 1) then
  8.       go(the frame - 1)
  9.       exit
  10.     end if
  11.     if (n = 11) and (marker(0) = marker(line the number of lines in the labelList - 1 of the labelList)) then
  12.       go(the frame - 1)
  13.       exit
  14.     end if
  15.     set l to line n of keyHotspots
  16.     set x1 to value(item 1 of l)
  17.     set y1 to value(item 2 of l)
  18.     set x2 to value(item 3 of l)
  19.     set y2 to value(item 4 of l)
  20.     set castData to item 6 to the number of items in l of l
  21.     set the castNum of sprite 5 to the number of cast (item 1 of castData && "hilite")
  22.     spriteBox(5, x1, y1, x2, y2)
  23.     set the visible of sprite 5 to 1
  24.     go(the frame - 1)
  25.   else
  26.     set the visible of sprite 5 to 0
  27.   end if
  28.   if rollOver(6) and (item 3 of castData = "showPopMenu") then
  29.     manageRollOverMenu()
  30.   else
  31.     if rollOver(39) and (item 1 of castData <> "searchResults") then
  32.       if the castNum of sprite 38 <> the number of cast "index" then
  33.         setUpTextHilite(39)
  34.       end if
  35.       go(the frame)
  36.       exit
  37.     end if
  38.   end if
  39.   if hiliteFlag = 1 then
  40.     set the visible of sprite 48 to 0
  41.     set hiliteFlag to 0
  42.   end if
  43.   go(the frame)
  44. end
  45.  
  46. on setUpTextHilite theSpriteNum
  47.   global hiliteFlag, linePtr, displayLines
  48.   puppetSprite(48, 1)
  49.   set the castNum of sprite 48 to 414
  50.   set x to the castNum of sprite theSpriteNum
  51.   set LT to the left of sprite theSpriteNum
  52.   set TP to the top of sprite theSpriteNum
  53.   set wd to the width of sprite theSpriteNum
  54.   set txtHt to the textHeight of field x
  55.   set the visible of sprite 48 to 0
  56.   set the locH of sprite 48 to LT
  57.   set the width of sprite 48 to wd
  58.   set the height of sprite 48 to txtHt + 1
  59.   set vPos to the mouseV
  60.   set linePtr to integer((vPos - TP) / txtHt)
  61.   if (linePtr + 1) > displayLines then
  62.     set the visible of sprite 48 to 0
  63.     exit
  64.   end if
  65.   set the locV of sprite 48 to integer(TP + (linePtr * txtHt))
  66.   set the visible of sprite 48 to 1
  67.   set hiliteFlag to 1
  68. end
  69.  
  70. on manageRollOverMenu
  71.   global castData, rectList
  72.   set baseCastNum to value(item 4 of castData)
  73.   set mItems to value(item 5 of castData)
  74.   set LT to value(getAt(rectList, 1))
  75.   set TP to value(getAt(rectList, 2))
  76.   set rt to LT + value(getAt(rectList, 3))
  77.   set bt to TP + value(getAt(rectList, 4))
  78.   set castPtr to 0
  79.   set x to the mouseH
  80.   set y to the mouseV
  81.   if (x >= LT) and (x <= rt) then
  82.     if (y >= TP) and (y <= bt) then
  83.       set castPtr to integer(0.5 + ((y - TP) * mItems * 1.0 / (bt - TP)))
  84.       set the castNum of sprite 6 to baseCastNum + castPtr
  85.     else
  86.       set castPtr to 0
  87.       set the castNum of sprite 6 to baseCastNum
  88.     end if
  89.   else
  90.     set castPtr to 0
  91.     set the castNum of sprite 6 to baseCastNum
  92.   end if
  93.   updateStage()
  94. end
  95.