home *** CD-ROM | disk | FTP | other *** search
/ 3D World 123 / 3DW_123.iso / pc / 3dw.exe / 3dw.dxr / Internal_45_content_back_button.ls < prev    next >
Encoding:
Text File  |  2009-06-30  |  1.3 KB  |  63 lines

  1. property Active, sp, pfadeMode, pfadeVal, pFadeMin, pfadeSpeed
  2. global currentThumbStart, currentSection, mainIndex, contentBackEnabled
  3.  
  4. on mouseUp me
  5.   if contentBackEnabled = 1 then
  6.     sprite(me.spriteNum + 1).color = rgb(0, 0, 0)
  7.     showThumbnails(currentThumbStart, currentSection)
  8.     sp.blend = pFadeMin
  9.     cursor(-1)
  10.   end if
  11. end
  12.  
  13. on beginSprite me
  14.   sp = sprite(me.spriteNum)
  15.   pfadeMode = 0
  16.   pFadeMin = 60
  17.   pfadeSpeed = 8
  18.   pfadeVal = pFadeMin
  19.   sp.blend = pfadeVal
  20.   Active = 1
  21. end
  22.  
  23. on mouseEnter me
  24.   if contentBackEnabled = 1 then
  25.     cursor(280)
  26.     sprite(me.spriteNum + 1).color = rgb(255, 255, 255)
  27.     if pfadeMode < 1 then
  28.       pfadeMode = 1
  29.     end if
  30.   end if
  31. end
  32.  
  33. on mouseLeave me
  34.   if contentBackEnabled = 1 then
  35.     cursor(-1)
  36.     sprite(me.spriteNum + 1).color = rgb(0, 0, 0)
  37.     if pfadeMode < 2 then
  38.       pfadeMode = 2
  39.     end if
  40.   end if
  41. end
  42.  
  43. on enterFrame me
  44.   if pfadeMode > 0 then
  45.     if pfadeMode = 2 then
  46.       if pfadeVal > pFadeMin then
  47.         pfadeVal = pfadeVal - pfadeSpeed
  48.       else
  49.         pfadeVal = pFadeMin
  50.         pfadeMode = 0
  51.       end if
  52.     else
  53.       if pfadeVal < 100 then
  54.         pfadeVal = pfadeVal + pfadeSpeed
  55.       else
  56.         pfadeVal = 100
  57.         pfadeMode = 0
  58.       end if
  59.     end if
  60.     sp.blend = pfadeVal
  61.   end if
  62. end
  63.