home *** CD-ROM | disk | FTP | other *** search
/ MacFormat UK 164 - Disc 1 / MF_UK_164_1.iso / Files / Scenes / HOME.DIR / Internal_11_RollOverExpose.ls < prev    next >
Encoding:
Text File  |  2005-11-16  |  1.3 KB  |  54 lines

  1. property Sp, backSp1, BackSp2, pEnd, myMode, fCounter, pMenuTxt, pBen, pBen2, pEnd2, myList, lastSp
  2. global menuStartSp, ShadowOffset, bWidth, bHeight, ActiveSection, MaxItems
  3.  
  4. on beginSprite me
  5.   menuTree = member("menutree")
  6.   return me
  7.   Sp = sprite(me.spriteNum)
  8.   myMode = "off"
  9. end
  10.  
  11. on pInit me, pList, menuBack1, menuBack2, MMSp
  12.   Sp = sprite(me.spriteNum)
  13.   myList = pList
  14.   backSp1 = menuBack1
  15.   if menuBack2 <> 0 then
  16.     BackSp2 = menuBack2
  17.   else
  18.     BackSp2 = 0
  19.   end if
  20.   pMenuTxt = sprite(MMSp)
  21.   pb = myList.count
  22.   if myList.count > MaxItems then
  23.     pEnd = myList[MaxItems]
  24.   else
  25.     pEnd = myList[pb]
  26.   end if
  27.   pEnd2 = myList[pb]
  28. end
  29.  
  30. on mouseEnter me
  31.   sendAllSprites(#HideMenu, 0)
  32.   tRect = rect(pMenuTxt.left, pMenuTxt.top - (bHeight / 2), pMenuTxt.right + 1, pEnd.bottom + (bHeight * 4))
  33.   sprite(backSp1).rect = tRect
  34.   if BackSp2 <> 0 then
  35.     bRect = rect(pMenuTxt.right - 5, pMenuTxt.bottom, pMenuTxt.right + bWidth, pEnd2.bottom + (bHeight * 4))
  36.     sprite(BackSp2).rect = bRect
  37.   end if
  38.   repeat with i = 1 to myList.count
  39.     myList[i].visible = 1
  40.   end repeat
  41.   pChar = Sp.member.char.count - 1
  42.   ActiveSection = Sp.member.text.char[1..pChar]
  43. end
  44.  
  45. on HideMenu me
  46.   repeat with i = 1 to myList.count
  47.     if myList[i] = sprite(pMenuTxt) then
  48.       myList[i].visible = 1
  49.       next repeat
  50.     end if
  51.     myList[i].visible = 0
  52.   end repeat
  53. end
  54.