on getBehaviorDescription
return "This applies to the text or field sprite of the 'Ziggi Generic Text Scrolling Behaviours' set and brings text ability to scroll."
end
on isOKtoAttach me, spriteType, spriteNum
case spriteType of
#graphic:
meType = sprite(spriteNum).member.type
return meType = #text or meType = #field
#script:
return FALSE
end case
end
on beginSprite me
pMeScroll = #Null
pMeLastLine = 0
pMeSpriteNum = me.spriteNum
pMeMemberNum = sprite(pMeSpriteNum).memberNum
pMeCastLibNum = sprite(pMeSpriteNum).castLibNum
pMeType = member(pMeMemberNum, pMeCastLibNum).type
if pMeType = #text then
pMeLineH = linePosToLocV(member(pMeMemberNum, pMeCastLibNum), 1)
else
pMeLineH = member(pMeMemberNum, pMeCastLibNum).lineHeight
end if
pMeLineCount = member(pMeMemberNum, pMeCastLibNum).line.count
pMeBottom = (pMeLineCount * pMeLineH) - member(pMeMemberNum, pMeCastLibNum).pageHeight
member(pMeMemberNum, pMeCastLibNum).scrollTop = 0
end
on scrollUp me
if pMeScroll = #Null then
pMeScroll = #Up
pMeCount = pMeLineH
end if
end
on scrollDown me
if pMeScroll = #Null then
pMeScroll = #Downn
pMeCount = pMeLineH
end if
end
on scrollUpMore me
member(pMeMemberNum, pMeCastLibNum).scrollByLine(-1)
end
on scrollDownMore me
if member(pMeMemberNum, pMeCastLibNum).scrollTop < pMeBottom then member(pMeMemberNum, pMeCastLibNum).scrollByLine(1)
end
on prepareFrame me
if pMeCount > 0 then
if pMeScroll = #Up and member(pMeMemberNum, pMeCastLibNum).scrollTop > 0 then
member(pMeMemberNum, pMeCastLibNum).scrollTop = member(pMeMemberNum, pMeCastLibNum).scrollTop - 1
else if pMeScroll = #Downn and member(pMeMemberNum, pMeCastLibNum).scrollTop < pMeBottom then
member(pMeMemberNum, pMeCastLibNum).scrollTop = member(pMeMemberNum, pMeCastLibNum).scrollTop + 1
end if
pMeCount = pMeCount - 1
else
pMeScroll = #Null
end if
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA