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

  1. property Sp, fulb, stb, pmode, ic
  2.  
  3. on beginSprite me
  4.   Sp = sprite(me.spriteNum)
  5.   fulb = 100
  6.   stb = 60
  7.   Sp.blend = stb
  8.   pmode = "off"
  9. end
  10.  
  11. on mouseEnter me
  12.   cursor(280)
  13.   ic = 0
  14.   pmode = "in"
  15. end
  16.  
  17. on mouseLeave me
  18.   cursor(-1)
  19.   ic = 0
  20.   pmode = "out"
  21. end
  22.  
  23. on exitFrame me
  24.   case pmode of
  25.     "in":
  26.       ic = ic + 1
  27.       Sp.blend = stb + ic
  28.       if Sp.blend >= fulb then
  29.         Sp.blend = fulb
  30.         pmode = "on"
  31.       end if
  32.     "out":
  33.       ic = ic + 1
  34.       Sp.blend = fulb - ic
  35.       if Sp.blend <= stb then
  36.         Sp.blend = stb
  37.         pmode = "off"
  38.       end if
  39.   end case
  40. end
  41.