home *** CD-ROM | disk | FTP | other *** search
/ GameStar 1998 November (Bonus) / GAMESTAR11B.ISO / ENCYC99 / MM / T235412A.DCR / 00077_LabelTrackerMaker.ls < prev    next >
Encoding:
Text File  |  1998-04-20  |  887 b   |  48 lines

  1. property numLabels, movieEnd, lastTick
  2. global labelNames, labelFrames
  3.  
  4. on new me
  5.   initProps(me)
  6.   return me
  7. end
  8.  
  9. on initProps me
  10.   set numLabels to the number of lines in field "LabelField"
  11.   set lastTick to numLabels + 1
  12.   set movieEnd to the lastFrame
  13. end
  14.  
  15. on getFrame me, lNum
  16.   if lNum = 0 then
  17.     return 1
  18.   else
  19.     if lNum = lastTick then
  20.       return movieEnd
  21.     else
  22.       return getAt(labelFrames, lNum)
  23.     end if
  24.   end if
  25. end
  26.  
  27. on lastOne me
  28.   set nowFrame to the frame
  29.   repeat with i = numLabels down to 1
  30.     set thisMarker to getAt(labelFrames, i)
  31.     if nowFrame > thisMarker then
  32.       return thisMarker
  33.     end if
  34.   end repeat
  35.   return 1
  36. end
  37.  
  38. on nextOne me
  39.   set nowFrame to the frame
  40.   repeat with i = 1 to numLabels
  41.     set thisMarker to getAt(labelFrames, i)
  42.     if nowFrame < thisMarker then
  43.       return thisMarker
  44.     end if
  45.   end repeat
  46.   return movieEnd
  47. end
  48.