home *** CD-ROM | disk | FTP | other *** search
/ Pro-motion 2 / PM02-Disk1.iso / mac / Parts / Main.dir / Script_28_Slider.ls < prev    next >
Encoding:
Text File  |  2001-01-31  |  951 b   |  60 lines

  1. property spriteNum
  2. global L, w, r, p, bh, mh, nowtime, endtime, nowrate, mdown, yubi, activsp, activsam, activpage
  3.  
  4. on beginSprite me
  5.   L = 30
  6.   w = 256
  7.   r = 286
  8. end
  9.  
  10. on mouseEnter me
  11.   cursor(yubi)
  12. end
  13.  
  14. on mouseLeave me
  15.   cursor(0)
  16. end
  17.  
  18. on mouseDown me
  19.   mdown = spriteNum
  20.   cursor = 0
  21. end
  22.  
  23. on mouseUp me
  24.   mdown = 0
  25.   cursor = 0
  26. end
  27.  
  28. on mouseUpOutSide me
  29.   mdown = 0
  30.   cursor = 0
  31. end
  32.  
  33. on exitFrame me
  34.   if mdown = spriteNum then
  35.     mh = mouseH()
  36.     if mh < L then
  37.       mh = L
  38.     else
  39.       if r < mh then
  40.         mh = r
  41.       end if
  42.     end if
  43.     p = float(mh - L) / float(w)
  44.     mt = float(endtime) * float(p)
  45.     sprite(100).movieRate = 0
  46.     sprite(100).visible = 1
  47.     sprite(100).movieTime = mt
  48.   end if
  49.   if nowtime <> 0 then
  50.     p = float(nowtime) / float(endtime)
  51.     bh = L + (float(p) * float(w))
  52.     set the locH of sprite 28 to bh
  53.     updateStage()
  54.   else
  55.     set the locH of sprite 28 to L
  56.     updateStage()
  57.   end if
  58.   pass()
  59. end
  60.