home *** CD-ROM | disk | FTP | other *** search
/ Comic Book Maker: The Smurfs / COMIC.iso / pc / data_w / cba2_40 / 00017_progressObj.ls < prev    next >
Encoding:
Text File  |  2001-02-22  |  949 b   |  40 lines

  1. property progressInc, progressSize, theFrame, initialRect
  2.  
  3. on new me
  4.   return me
  5. end
  6.  
  7. on terminateProgress me
  8.   set frame to theFrame
  9.   tell window 1
  10.     set the locH of sprite (26 + frame) to 9000
  11.     updateStage()
  12.   end tell
  13. end
  14.  
  15. on initprogress me, frame, numberOfSteps
  16.   set theFrame to frame
  17.   set progressInc to 38.0 / numberOfSteps
  18.   set progressSize to 0
  19.   tell window 1
  20.     set R to the rect of sprite (13 + frame) - [300, 0, 300, 0]
  21.   end tell
  22.   set initialRect to R
  23.   tell window 1
  24.     set the locH of sprite (13 + frame) to the locH of sprite (13 + frame) - 300
  25.   end tell
  26. end
  27.  
  28. on progress me
  29.   set lastProgressSize to progressSize
  30.   set progressSize to min(37, integer(progressSize + progressInc))
  31.   if not (progressSize = lastProgressSize) then
  32.     set frame to theFrame
  33.     set newRect to initialRect + [0, progressSize, 0, 0]
  34.     tell window 1
  35.       set the rect of sprite 27 to newRect
  36.       updateStage()
  37.     end tell
  38.   end if
  39. end
  40.