home *** CD-ROM | disk | FTP | other *** search
- property textSprite, myScrollDelay, minSafeArea, maxSafeArea, topLimit, bottomLimit, activeLeft, activeRight
- global gMasterObj
-
- on new me
- return me
- end
-
- on init me, whichTextSprite, scrollDelay, safeTop, safeBottom, tLimit, bLimit
- set textSprite to whichTextSprite
- set myScrollDelay to scrollDelay
- set minSafeArea to safeTop
- set maxSafeArea to safeBottom
- set topLimit to tLimit
- set bottomLimit to bLimit
- set activeLeft to the left of sprite textSprite
- set activeRight to the right of sprite textSprite
- puppetSprite(textSprite, 1)
- append(the actorList, me)
- end
-
- on stepFrame me
- if (the mouseH > activeLeft) and (the mouseH < activeRight) then
- if the mouseV > maxSafeArea then
- setCursorExemption(gMasterObj, 1)
- set myDirection to (the mouseV - (maxSafeArea - 10)) / myScrollDelay
- scrollUp(me, myDirection)
- else
- if the mouseV < minSafeArea then
- setCursorExemption(gMasterObj, 1)
- set myDirection to (the mouseV - (minSafeArea + 10)) / myScrollDelay
- scrollDown(me, myDirection)
- else
- setCursorExemption(gMasterObj, 0)
- cursor(-1)
- end if
- end if
- else
- setCursorExemption(gMasterObj, 0)
- end if
- end
-
- on scrollUp me, myDirection
- set newPos to the locV of sprite textSprite - myDirection
- if newPos < topLimit then
- cursor([7, 8])
- set the locV of sprite textSprite to topLimit
- else
- cursor([3, 4])
- set the locV of sprite textSprite to newPos
- end if
- put myDirection
- end
-
- on scrollDown me, myDirection
- set newPos to the locV of sprite textSprite - myDirection
- if newPos > bottomLimit then
- cursor([5, 6])
- set the locV of sprite textSprite to bottomLimit
- else
- cursor([1, 2])
- set the locV of sprite textSprite to newPos
- end if
- put myDirection
- end
-