home *** CD-ROM | disk | FTP | other *** search
/ Encyklopedia Omnia / Planeta.iso / data / f_gen.dir / 00009_hScroll&Stop.ls < prev    next >
Encoding:
Text File  |  2000-11-09  |  1.1 KB  |  40 lines

  1. property NSconstraint, stopLoc, lastTicks, changePeriod
  2.  
  3. on beginSprite
  4.   set lastTicks to the ticks
  5. end
  6.  
  7. on mouseDown
  8.   set Ns to the currentSpriteNum
  9.   set the blend of sprite Ns to 100
  10.   set hOffset to the mouseH - the locH of sprite Ns
  11.   repeat while the stillDown
  12.     set newHloc to constrainH(NSconstraint, the mouseH - hOffset)
  13.     set the locH of sprite Ns to newHloc
  14.     updateStage()
  15.     if newHloc >= stopLoc then
  16.       go(#next)
  17.       exit
  18.     end if
  19.   end repeat
  20. end
  21.  
  22. on exitFrame
  23.   set diff to the ticks - lastTicks
  24.   set Ns to the currentSpriteNum
  25.   if diff >= (changePeriod * 2) then
  26.     set the blend of sprite Ns to 100
  27.     set lastTicks to the ticks
  28.     put "100"
  29.     exit
  30.   end if
  31.   if (diff >= changePeriod) and (the blend of sprite Ns = 100) then
  32.     set the blend of sprite Ns to 40
  33.   end if
  34. end
  35.  
  36. on getPropertyDescriptionList
  37.   set p_list to [#NSconstraint: [#comment: "Sprite di vincolo:", #format: #integer, #default: 0, #range: 1, 5: 120], #stopLoc: [#comment: "Stop al pixel:", #format: #integer, #default: 640], #changePeriod: [#comment: "Periodo di lampeggio:", #format: #integer, #default: 30]]
  38.   return p_list
  39. end
  40.