home *** CD-ROM | disk | FTP | other *** search
/ Encyklopedia Omnia / Planeta.iso / data / e_gen.dir / 00017_hScroll&Stop.ls < prev    next >
Encoding:
Text File  |  2000-10-16  |  1.1 KB  |  39 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.     exit
  29.   end if
  30.   if (diff >= changePeriod) and (the blend of sprite Ns = 100) then
  31.     set the blend of sprite Ns to 60
  32.   end if
  33. end
  34.  
  35. on getPropertyDescriptionList
  36.   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]]
  37.   return p_list
  38. end
  39.